From owner-svn-src-all@freebsd.org Sun Mar 26 00:40:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19B36D12429; Sun, 26 Mar 2017 00:40:37 +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 C382613A8; Sun, 26 Mar 2017 00:40:36 +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 v2Q0eZeM072271; Sun, 26 Mar 2017 00:40:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q0eZSd072270; Sun, 26 Mar 2017 00:40:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703260040.v2Q0eZSd072270@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:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315968 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 00:40:37 -0000 Author: kib Date: Sun Mar 26 00:40:35 2017 New Revision: 315968 URL: https://svnweb.freebsd.org/changeset/base/315968 Log: Provide less laborius way to enable busdma DMAR to only short list of devices. Kernel environment variable hw.busdma.default can take values 'bounce' and 'dmar' and selects corresponding busdma backend as default. Per-device environment variable hw.busdma.pci... takes the same values and overrides hw.busdma.default for the given device. Note that even with hw.busdma.default=bounce, DMA translation engines are still started if DMARs are enabled, to disable them use hw.dmar.dma tunable, as before. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/busdma_dmar.c Modified: head/sys/x86/iommu/busdma_dmar.c ============================================================================== --- head/sys/x86/iommu/busdma_dmar.c Sat Mar 25 22:58:37 2017 (r315967) +++ head/sys/x86/iommu/busdma_dmar.c Sun Mar 26 00:40:35 2017 (r315968) @@ -74,14 +74,34 @@ static bool dmar_bus_dma_is_dev_disabled(int domain, int bus, int slot, int func) { char str[128], *env; + int default_bounce; + bool ret; + static const char bounce_str[] = "bounce"; + static const char dmar_str[] = "dmar"; + + default_bounce = 0; + env = kern_getenv("hw.busdma.default"); + if (env != NULL) { + if (strcmp(env, bounce_str) == 0) + default_bounce = 1; + else if (strcmp(env, dmar_str) == 0) + default_bounce = 0; + freeenv(env); + } - snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d.bounce", + snprintf(str, sizeof(str), "hw.busdma.pci%d.%d.%d.%d", domain, bus, slot, func); env = kern_getenv(str); if (env == NULL) - return (false); + return (default_bounce != 0); + if (strcmp(env, bounce_str) == 0) + ret = true; + else if (strcmp(env, dmar_str) == 0) + ret = false; + else + ret = default_bounce != 0; freeenv(env); - return (true); + return (ret); } /* From owner-svn-src-all@freebsd.org Sun Mar 26 00:53:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 00:56:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 00:59:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 01:11:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 08:30:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDDCD1E47A; Sun, 26 Mar 2017 08:30:27 +0000 (UTC) (envelope-from dchagin@mordor.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 81107134D; Sun, 26 Mar 2017 08:30:26 +0000 (UTC) (envelope-from dchagin@mordor.heemeyer.club) Received: from mordor.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id v2Q8UMAc080501 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 26 Mar 2017 08:30:24 GMT (envelope-from dchagin@mordor.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be mordor.heemeyer.club Received: from mordor.heemeyer.club (localhost [127.0.0.1]) by mordor.heemeyer.club (8.15.2/8.15.1) with ESMTPS id v2Q8ULr5002254 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 26 Mar 2017 11:30:21 +0300 (MSK) (envelope-from dchagin@mordor.heemeyer.club) Received: (from dchagin@localhost) by mordor.heemeyer.club (8.15.2/8.15.2/Submit) id v2Q8UL6M002253; Sun, 26 Mar 2017 11:30:21 +0300 (MSK) (envelope-from dchagin) Date: Sun, 26 Mar 2017 11:30:21 +0300 From: Chagin Dmitry To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315959 - in head/sys: amd64/amd64 amd64/vmm amd64/vmm/amd i386/i386 x86/include x86/x86 x86/xen Message-ID: <20170326083021.GA1899@mordor.heemeyer.club> References: <201703251845.v2PIj9k2029497@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703251845.v2PIj9k2029497@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:30:27 -0000 On Sat, Mar 25, 2017 at 06:45:09PM +0000, Andriy Gapon wrote: > Author: avg > Date: Sat Mar 25 18:45:09 2017 > New Revision: 315959 > URL: https://svnweb.freebsd.org/changeset/base/315959 > > Log: > specific end of interrupt implementation for AMD Local APIC > > The change is more intrusive than I would like because the feature > requires that a vector number is written to a special register. > Thus, now the vector number has to be provided to lapic_eoi(). > It was readily available in the IO-APIC and MSI cases, but the IPI > handlers required more work. > Also, we now store the VMM IPI number in a global variable, so that it > is available to the justreturn handler for the same reason. > > Reviewed by: kib > MFC after: 6 weeks > Differential Revision: https://reviews.freebsd.org/D9880 > > Modified: > head/sys/amd64/amd64/apic_vector.S > head/sys/amd64/amd64/genassym.c Hi, Andriy, u broke the build /usr/local/bin/clang40 -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/home/git/head/sys -I/home/git/head/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.genassym.o -MTgenassym.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 /home/git/head/sys/amd64/amd64/genassym.c In file included from /home/git/head/sys/amd64/amd64/genassym.c:47: /home/git/head/sys/sys/bus.h:730:10: fatal error: 'device_if.h' file not found #include "device_if.h" ^~~~~~~~~~~~~ 1 error generated. *** Error code 1 > head/sys/amd64/vmm/amd/svm.c > head/sys/amd64/vmm/vmm.c > head/sys/amd64/vmm/vmm_host.h > head/sys/i386/i386/apic_vector.s > head/sys/i386/i386/genassym.c > head/sys/x86/include/apicvar.h > head/sys/x86/x86/io_apic.c > head/sys/x86/x86/local_apic.c > head/sys/x86/x86/msi.c > head/sys/x86/xen/xen_apic.c > > Modified: head/sys/amd64/amd64/apic_vector.S > ============================================================================== > --- head/sys/amd64/amd64/apic_vector.S Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/amd64/amd64/apic_vector.S Sat Mar 25 18:45:09 2017 (r315959) > @@ -50,22 +50,6 @@ > #define LK > #endif > > - .text > - SUPERALIGN_TEXT > - /* End Of Interrupt to APIC */ > -as_lapic_eoi: > - cmpl $0,x2apic_mode > - jne 1f > - movq lapic_map,%rax > - movl $0,LA_EOI(%rax) > - ret > -1: > - movl $MSR_APIC_EOI,%ecx > - xorl %eax,%eax > - xorl %edx,%edx > - wrmsr > - ret > - > /* > * I/O Interrupt Entry Point. Rather than having one entry point for > * each interrupt source, we use one entry point for each 32-bit word > @@ -182,7 +166,7 @@ IDTVEC(xen_intr_upcall) > > SUPERALIGN_TEXT > invltlb_ret: > - call as_lapic_eoi > + call native_lapic_eoi > POP_FRAME > jmp doreti_iret > > @@ -191,18 +175,21 @@ IDTVEC(invltlb) > PUSH_FRAME > > call invltlb_handler > + movl $IPI_INVLTLB, %edi > jmp invltlb_ret > > IDTVEC(invltlb_pcid) > PUSH_FRAME > > call invltlb_pcid_handler > + movl $IPI_INVLTLB, %edi > jmp invltlb_ret > > IDTVEC(invltlb_invpcid) > PUSH_FRAME > > call invltlb_invpcid_handler > + movl $IPI_INVLTLB, %edi > jmp invltlb_ret > > /* > @@ -215,6 +202,7 @@ IDTVEC(invlpg) > PUSH_FRAME > > call invlpg_handler > + movl $IPI_INVLPG, %edi > jmp invltlb_ret > > /* > @@ -226,6 +214,7 @@ IDTVEC(invlrng) > PUSH_FRAME > > call invlrng_handler > + movl $IPI_INVLRNG, %edi > jmp invltlb_ret > > /* > @@ -237,6 +226,7 @@ IDTVEC(invlcache) > PUSH_FRAME > > call invlcache_handler > + movl $IPI_INVLCACHE, %edi > jmp invltlb_ret > > /* > @@ -247,7 +237,8 @@ IDTVEC(invlcache) > IDTVEC(ipi_intr_bitmap_handler) > PUSH_FRAME > > - call as_lapic_eoi > + movl $IPI_BITMAP_VECTOR, %edi > + call native_lapic_eoi > > FAKE_MCOUNT(TF_RIP(%rsp)) > > @@ -263,7 +254,8 @@ IDTVEC(ipi_intr_bitmap_handler) > IDTVEC(cpustop) > PUSH_FRAME > > - call as_lapic_eoi > + movl $IPI_STOP, %edi > + call native_lapic_eoi > > call cpustop_handler > jmp doreti > @@ -277,7 +269,8 @@ IDTVEC(cpususpend) > PUSH_FRAME > > call cpususpend_handler > - call as_lapic_eoi > + movl $IPI_SUSPEND, %edi > + call native_lapic_eoi > jmp doreti > > /* > @@ -295,37 +288,22 @@ IDTVEC(rendezvous) > incq (%rax) > #endif > call smp_rendezvous_action > - call as_lapic_eoi > + movl $IPI_RENDEZVOUS, %edi > + call native_lapic_eoi > jmp doreti > > /* > * IPI handler whose purpose is to interrupt the CPU with minimum overhead. > * This is used by bhyve to force a host cpu executing in guest context to > * trap into the hypervisor. > - * > - * This handler is different from other IPI handlers in the following aspects: > - * > - * 1. It doesn't push a trapframe on the stack. > - * > - * This implies that a DDB backtrace involving 'justreturn' will skip the > - * function that was interrupted by this handler. > - * > - * 2. It doesn't 'swapgs' when userspace is interrupted. > - * > - * The 'justreturn' handler does not access any pcpu data so it is not an > - * issue. Moreover the 'justreturn' handler can only be interrupted by an NMI > - * whose handler already doesn't trust GS.base when kernel code is interrupted. > */ > .text > SUPERALIGN_TEXT > IDTVEC(justreturn) > - pushq %rax > - pushq %rcx > - pushq %rdx > - call as_lapic_eoi > - popq %rdx > - popq %rcx > - popq %rax > + PUSH_FRAME > + movl vmm_ipinum, %edi > + call native_lapic_eoi > + POP_FRAME > jmp doreti_iret > > #endif /* SMP */ > > Modified: head/sys/amd64/amd64/genassym.c > ============================================================================== > --- head/sys/amd64/amd64/genassym.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/amd64/amd64/genassym.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #ifdef HWPMC_HOOKS > #include > @@ -61,7 +62,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > #include > @@ -215,10 +218,19 @@ ASSYM(PC_LDT, offsetof(struct pcpu, pc_l > ASSYM(PC_COMMONTSSP, offsetof(struct pcpu, pc_commontssp)); > ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); > ASSYM(PC_PM_SAVE_CNT, offsetof(struct pcpu, pc_pm_save_cnt)); > - > + > ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); > ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); > > +ASSYM(IPI_INVLTLB, IPI_INVLTLB); > +ASSYM(IPI_INVLPG, IPI_INVLPG); > +ASSYM(IPI_INVLRNG, IPI_INVLRNG); > +ASSYM(IPI_INVLCACHE, IPI_INVLCACHE); > +ASSYM(IPI_BITMAP_VECTOR, IPI_BITMAP_VECTOR); > +ASSYM(IPI_STOP, IPI_STOP); > +ASSYM(IPI_SUSPEND, IPI_SUSPEND); > +ASSYM(IPI_RENDEZVOUS, IPI_RENDEZVOUS); > + > ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL)); > ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL)); > ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL)); > > Modified: head/sys/amd64/vmm/amd/svm.c > ============================================================================== > --- head/sys/amd64/vmm/amd/svm.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/amd64/vmm/amd/svm.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include "vmm_host.h" > #include "vmm_lapic.h" > #include "vmm_stat.h" > #include "vmm_ktr.h" > @@ -1620,7 +1621,7 @@ svm_inj_interrupts(struct svm_softc *sc, > * Although not explicitly specified in APMv2 the > * relative priorities were verified empirically. > */ > - ipi_cpu(curcpu, IPI_AST); /* XXX vmm_ipinum? */ > + ipi_cpu(curcpu, vmm_ipinum); > } else { > vm_nmi_clear(sc->vm, vcpu); > > > Modified: head/sys/amd64/vmm/vmm.c > ============================================================================== > --- head/sys/amd64/vmm/vmm.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/amd64/vmm/vmm.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -215,7 +215,6 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detec > &halt_detection_enabled, 0, > "Halt VM if all vcpus execute HLT with interrupts disabled"); > > -static int vmm_ipinum; > SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, > "IPI vector used for vcpu notifications"); > > > Modified: head/sys/amd64/vmm/vmm_host.h > ============================================================================== > --- head/sys/amd64/vmm/vmm_host.h Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/amd64/vmm/vmm_host.h Sat Mar 25 18:45:09 2017 (r315959) > @@ -33,6 +33,8 @@ > #error "no user-serviceable parts inside" > #endif > > +extern int vmm_ipinum; > + > struct xsave_limits { > int xsave_enabled; > uint64_t xcr0_allowed; > > Modified: head/sys/i386/i386/apic_vector.s > ============================================================================== > --- head/sys/i386/i386/apic_vector.s Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/i386/i386/apic_vector.s Sat Mar 25 18:45:09 2017 (r315959) > @@ -44,22 +44,6 @@ > > #include "assym.s" > > - .text > - SUPERALIGN_TEXT > - /* End Of Interrupt to APIC */ > -as_lapic_eoi: > - cmpl $0,x2apic_mode > - jne 1f > - movl lapic_map,%eax > - movl $0,LA_EOI(%eax) > - ret > -1: > - movl $MSR_APIC_EOI,%ecx > - xorl %eax,%eax > - xorl %edx,%edx > - wrmsr > - ret > - > /* > * I/O Interrupt Entry Point. Rather than having one entry point for > * each interrupt source, we use one entry point for each 32-bit word > @@ -188,7 +172,8 @@ IDTVEC(xen_intr_upcall) > .text > SUPERALIGN_TEXT > invltlb_ret: > - call as_lapic_eoi > + call native_lapic_eoi > + add $4, %esp > POP_FRAME > iret > > @@ -200,6 +185,7 @@ IDTVEC(invltlb) > > call invltlb_handler > > + pushl $IPI_INVLTLB > jmp invltlb_ret > > /* > @@ -214,6 +200,7 @@ IDTVEC(invlpg) > > call invlpg_handler > > + pushl $IPI_INVLPG > jmp invltlb_ret > > /* > @@ -228,6 +215,7 @@ IDTVEC(invlrng) > > call invlrng_handler > > + pushl $IPI_INVLRNG > jmp invltlb_ret > > /* > @@ -242,6 +230,7 @@ IDTVEC(invlcache) > > call invlcache_handler > > + pushl $IPI_INVLCACHE > jmp invltlb_ret > > /* > @@ -254,8 +243,10 @@ IDTVEC(ipi_intr_bitmap_handler) > SET_KERNEL_SREGS > cld > > - call as_lapic_eoi > - > + pushl $IPI_BITMAP_VECTOR > + call native_lapic_eoi > + add $4, %esp > + > FAKE_MCOUNT(TF_EIP(%esp)) > > call ipi_bitmap_handler > @@ -272,7 +263,9 @@ IDTVEC(cpustop) > SET_KERNEL_SREGS > cld > > - call as_lapic_eoi > + pushl $IPI_STOP > + call native_lapic_eoi > + add $4, %esp > call cpustop_handler > > POP_FRAME > @@ -288,7 +281,9 @@ IDTVEC(cpususpend) > SET_KERNEL_SREGS > cld > > - call as_lapic_eoi > + pushl $IPI_SUSPEND > + call native_lapic_eoi > + add $4, %esp > call cpususpend_handler > > POP_FRAME > @@ -313,7 +308,9 @@ IDTVEC(rendezvous) > #endif > call smp_rendezvous_action > > - call as_lapic_eoi > + pushl $IPI_RENDEZVOUS > + call native_lapic_eoi > + add $4, %esp > POP_FRAME > iret > > > Modified: head/sys/i386/i386/genassym.c > ============================================================================== > --- head/sys/i386/i386/genassym.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/i386/i386/genassym.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -70,7 +70,10 @@ __FBSDID("$FreeBSD$"); > #include > #include > #ifdef DEV_APIC > +#include > +#include > #include > +#include > #endif > #include > #include > @@ -219,6 +222,15 @@ ASSYM(PC_PRIVATE_TSS, offsetof(struct pc > #ifdef DEV_APIC > ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); > ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); > + > +ASSYM(IPI_INVLTLB, IPI_INVLTLB); > +ASSYM(IPI_INVLPG, IPI_INVLPG); > +ASSYM(IPI_INVLRNG, IPI_INVLRNG); > +ASSYM(IPI_INVLCACHE, IPI_INVLCACHE); > +ASSYM(IPI_BITMAP_VECTOR, IPI_BITMAP_VECTOR); > +ASSYM(IPI_STOP, IPI_STOP); > +ASSYM(IPI_SUSPEND, IPI_SUSPEND); > +ASSYM(IPI_RENDEZVOUS, IPI_RENDEZVOUS); > #endif > > ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL)); > > Modified: head/sys/x86/include/apicvar.h > ============================================================================== > --- head/sys/x86/include/apicvar.h Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/x86/include/apicvar.h Sat Mar 25 18:45:09 2017 (r315959) > @@ -210,7 +210,7 @@ struct apic_ops { > void (*setup)(int); > void (*dump)(const char *); > void (*disable)(void); > - void (*eoi)(void); > + void (*eoi)(u_int vector); > int (*id)(void); > int (*intr_pending)(u_int); > void (*set_logical_id)(u_int, u_int, u_int); > @@ -301,10 +301,10 @@ lapic_disable(void) > } > > static inline void > -lapic_eoi(void) > +lapic_eoi(u_int vector) > { > > - apic_ops.eoi(); > + apic_ops.eoi(vector); > } > > static inline int > @@ -469,6 +469,7 @@ lapic_set_lvt_triggermode(u_int apic_id, > return (apic_ops.set_lvt_triggermode(apic_id, lvt, trigger)); > } > > +void native_lapic_eoi(u_int vector); > void lapic_handle_cmc(void); > void lapic_handle_error(void); > void lapic_handle_intr(int vector, struct trapframe *frame); > > Modified: head/sys/x86/x86/io_apic.c > ============================================================================== > --- head/sys/x86/x86/io_apic.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/x86/x86/io_apic.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -151,10 +151,10 @@ _ioapic_eoi_source(struct intsrc *isrc, > volatile uint32_t *apic_eoi; > uint32_t low1; > > - lapic_eoi(); > + src = (struct ioapic_intsrc *)isrc; > + lapic_eoi(src->io_vector); > if (!lapic_eoi_suppression) > return; > - src = (struct ioapic_intsrc *)isrc; > if (src->io_edgetrigger) > return; > io = (struct ioapic *)isrc->is_pic; > > Modified: head/sys/x86/x86/local_apic.c > ============================================================================== > --- head/sys/x86/x86/local_apic.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/x86/x86/local_apic.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -83,6 +83,9 @@ __FBSDID("$FreeBSD$"); > #define GSEL_APIC GSEL(GCODE_SEL, SEL_KPL) > #endif > > +#define INTEL_SEOI 1 > +#define AMD_SEOI 2 > + > /* Sanity checks on IDT vectors. */ > CTASSERT(APIC_IO_INTS + APIC_NUM_IOINTS == APIC_TIMER_INT); > CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS); > @@ -184,6 +187,10 @@ static struct eventtimer lapic_et; > #ifdef SMP > static uint64_t lapic_ipi_wait_mult; > #endif > +#ifdef __amd64__ > +/* IPI vector used for VMM VCPU notifications. */ > +int vmm_ipinum; > +#endif > > SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); > SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); > @@ -312,7 +319,6 @@ static void native_lapic_xapic_mode(void > static void native_lapic_setup(int boot); > static void native_lapic_dump(const char *str); > static void native_lapic_disable(void); > -static void native_lapic_eoi(void); > static int native_lapic_id(void); > static int native_lapic_intr_pending(u_int vector); > static u_int native_apic_cpuid(u_int apic_id); > @@ -447,6 +453,31 @@ elvt_mode(struct lapic *la, u_int idx, u > return (lvt_mode_impl(la, elvt, idx, value)); > } > > +static inline uint32_t > +amd_read_ext_features(void) > +{ > + uint32_t version; > + > + if (cpu_vendor_id != CPU_VENDOR_AMD) > + return (0); > + version = lapic_read32(LAPIC_VERSION); > + if ((version & APIC_VER_AMD_EXT_SPACE) != 0) > + return (lapic_read32(LAPIC_EXT_FEATURES)); > + return (0); > +} > + > +static inline uint32_t > +amd_read_elvt_count(void) > +{ > + uint32_t extf; > + uint32_t count; > + > + extf = amd_read_ext_features(); > + count = (extf & APIC_EXTF_ELVT_MASK) >> APIC_EXTF_ELVT_SHIFT; > + count = min(count, APIC_ELVT_MAX + 1); > + return (count); > +} > + > /* > * Map the local APIC and setup necessary interrupt vectors. > */ > @@ -456,9 +487,9 @@ native_lapic_init(vm_paddr_t addr) > #ifdef SMP > uint64_t r, r1, r2, rx; > #endif > - uint32_t ver; > + uint32_t extf, ver; > u_int regs[4]; > - int i, arat; > + int i, arat, seoi_enable; > > /* > * Enable x2APIC mode if possible. Map the local APIC > @@ -546,16 +577,27 @@ native_lapic_init(vm_paddr_t addr) > */ > ver = lapic_read32(LAPIC_VERSION); > if ((ver & APIC_VER_EOI_SUPPRESSION) != 0) { > - lapic_eoi_suppression = 1; > + lapic_eoi_suppression = INTEL_SEOI; > + } else { > + extf = amd_read_ext_features(); > + if ((extf & APIC_EXTF_SEIO_CAP) != 0) > + lapic_eoi_suppression = AMD_SEOI; > + } > + if (lapic_eoi_suppression != 0) { > + seoi_enable = 1; > if (vm_guest == VM_GUEST_KVM) { > if (bootverbose) > printf( > "KVM -- disabling lapic eoi suppression\n"); > - lapic_eoi_suppression = 0; > + seoi_enable = 0; > } > TUNABLE_INT_FETCH("hw.lapic_eoi_suppression", > - &lapic_eoi_suppression); > + &seoi_enable); > + if (seoi_enable == 0) > + lapic_eoi_suppression = 0; > } > + if (lapic_eoi_suppression != 0) > + printf("LAPIC specific EOI enabled\n"); > > #ifdef SMP > #define LOOPS 100000 > @@ -642,32 +684,6 @@ native_lapic_create(u_int apic_id, int b > #endif > } > > -static inline uint32_t > -amd_read_ext_features(void) > -{ > - uint32_t version; > - > - if (cpu_vendor_id != CPU_VENDOR_AMD) > - return (0); > - version = lapic_read32(LAPIC_VERSION); > - if ((version & APIC_VER_AMD_EXT_SPACE) != 0) > - return (lapic_read32(LAPIC_EXT_FEATURES)); > - else > - return (0); > -} > - > -static inline uint32_t > -amd_read_elvt_count(void) > -{ > - uint32_t extf; > - uint32_t count; > - > - extf = amd_read_ext_features(); > - count = (extf & APIC_EXTF_ELVT_MASK) >> APIC_EXTF_ELVT_SHIFT; > - count = min(count, APIC_ELVT_MAX + 1); > - return (count); > -} > - > /* > * Dump contents of local APIC registers > */ > @@ -702,9 +718,11 @@ native_lapic_dump(const char* str) > extf = amd_read_ext_features(); > if (extf != 0) { > printf(" AMD ext features: 0x%08x\n", extf); > + extf = lapic_read32(LAPIC_EXT_CTRL); > + printf(" AMD ext control: 0x%08x\n", extf); > elvt_count = amd_read_elvt_count(); > for (i = 0; i < elvt_count; i++) > - printf(" AMD elvt%d: 0x%08x\n", i, > + printf(" AMD elvt%d: 0x%08x\n", i, > lapic_read32(LAPIC_EXT_LVT0 + i)); > } > } > @@ -1022,9 +1040,15 @@ lapic_enable(void) > value = lapic_read32(LAPIC_SVR); > value &= ~(APIC_SVR_VECTOR | APIC_SVR_FOCUS); > value |= APIC_SVR_FEN | APIC_SVR_SWEN | APIC_SPURIOUS_INT; > - if (lapic_eoi_suppression) > + if (lapic_eoi_suppression == INTEL_SEOI) > value |= APIC_SVR_EOI_SUPPRESSION; > lapic_write32(LAPIC_SVR, value); > + > + if (lapic_eoi_suppression == AMD_SEOI) { > + value = lapic_read32(LAPIC_EXT_CTRL); > + value |= APIC_EXTF_SEIO_CAP; > + lapic_write32(LAPIC_EXT_CTRL, value); > + } > } > > /* Reset the local APIC on the BSP during resume. */ > @@ -1227,11 +1251,14 @@ lapic_set_tpr(u_int vector) > #endif > } > > -static void > -native_lapic_eoi(void) > +void > +native_lapic_eoi(u_int vector) > { > > - lapic_write32_nofence(LAPIC_EOI, 0); > + if (lapic_eoi_suppression == AMD_SEOI) > + lapic_write32(LAPIC_EXT_SEOI, vector); > + else > + lapic_write32_nofence(LAPIC_EOI, 0); > } > > void > @@ -1252,7 +1279,7 @@ lapic_handle_timer(struct trapframe *fra > struct thread *td; > > /* Send EOI first thing. */ > - lapic_eoi(); > + lapic_eoi(APIC_TIMER_INT); > > #if defined(SMP) && !defined(SCHED_ULE) > /* > @@ -1373,7 +1400,7 @@ void > lapic_handle_cmc(void) > { > > - lapic_eoi(); > + lapic_eoi(APIC_CMC_INT); > cmc_intr(); > } > > @@ -1447,7 +1474,7 @@ lapic_handle_error(void) > esr = lapic_read32(LAPIC_ESR); > > printf("CPU%d: local APIC error 0x%x\n", PCPU_GET(cpuid), esr); > - lapic_eoi(); > + lapic_eoi(APIC_ERROR_INT); > } > > static u_int > > Modified: head/sys/x86/x86/msi.c > ============================================================================== > --- head/sys/x86/x86/msi.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/x86/x86/msi.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -177,16 +177,18 @@ msi_enable_source(struct intsrc *isrc) > static void > msi_disable_source(struct intsrc *isrc, int eoi) > { > + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; > > if (eoi == PIC_EOI) > - lapic_eoi(); > + lapic_eoi(msi->msi_vector); > } > > static void > msi_eoi_source(struct intsrc *isrc) > { > + struct msi_intsrc *msi = (struct msi_intsrc *)isrc; > > - lapic_eoi(); > + lapic_eoi(msi->msi_vector); > } > > static void > > Modified: head/sys/x86/xen/xen_apic.c > ============================================================================== > --- head/sys/x86/xen/xen_apic.c Sat Mar 25 15:57:47 2017 (r315958) > +++ head/sys/x86/xen/xen_apic.c Sat Mar 25 18:45:09 2017 (r315959) > @@ -147,7 +147,7 @@ xen_pv_lapic_is_x2apic(void) > } > > static void > -xen_pv_lapic_eoi(void) > +xen_pv_lapic_eoi(u_int vector) > { > > XEN_APIC_UNSUPPORTED; -- From owner-svn-src-all@freebsd.org Sun Mar 26 08:36:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B272D1EA4A; Sun, 26 Mar 2017 08:36:22 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1854319CC; Sun, 26 Mar 2017 08:36:22 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2Q8aLYa068945; Sun, 26 Mar 2017 08:36:21 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8aLXn068944; Sun, 26 Mar 2017 08:36:21 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201703260836.v2Q8aLXn068944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 26 Mar 2017 08:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315973 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:36:22 -0000 Author: mmel Date: Sun Mar 26 08:36:20 2017 New Revision: 315973 URL: https://svnweb.freebsd.org/changeset/base/315973 Log: Save VFP state on fork(). Update the copy of VFP state in PCB before it is cloned for new process. MFC after: 2 weeks Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Sun Mar 26 01:10:59 2017 (r315972) +++ head/sys/arm/arm/vm_machdep.c Sun Mar 26 08:36:20 2017 (r315973) @@ -111,6 +111,14 @@ cpu_fork(register struct thread *td1, re pmap_use_minicache(td2->td_kstack, td2->td_kstack_pages * PAGE_SIZE); #endif #endif +#ifdef VFP + /* Store actual state of VFP */ + if (curthread == td1) { + critical_enter(); + vfp_store(&td1->td_pcb->pcb_vfpstate, false); + critical_exit(); + } +#endif td2->td_pcb = pcb2; /* Clone td1's pcb */ From owner-svn-src-all@freebsd.org Sun Mar 26 08:36:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8E3FD1EAF8; Sun, 26 Mar 2017 08:36:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B303B1B52; Sun, 26 Mar 2017 08:36:57 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2Q8auUb069009; Sun, 26 Mar 2017 08:36:56 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q8auoU069005; Sun, 26 Mar 2017 08:36:56 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201703260836.v2Q8auoU069005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 26 Mar 2017 08:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315974 - in head: lib/libthread_db/arch/arm sys/arm/arm sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 08:36:58 -0000 Author: mmel Date: Sun Mar 26 08:36:56 2017 New Revision: 315974 URL: https://svnweb.freebsd.org/changeset/base/315974 Log: Preserve VFP state across signal delivery. We don't have enouch space to store full VFP context within mcontext stucture. Due to this: - follow i386/amd64 way and store VFP state outside of the mcontext_t but point to it. Use the size of VFP state structure as an 'magic' indicator of the saved VFP state presence. - teach set_mcontext() about this external storage. - for signal delivery, store VFP state to expanded 'struct sigframe'. Submited by: Andrew Gierth (initial version) PR: 217611 MFC after: 2 weeks Modified: head/lib/libthread_db/arch/arm/libpthread_md.c head/sys/arm/arm/machdep.c head/sys/arm/include/frame.h head/sys/arm/include/ucontext.h Modified: head/lib/libthread_db/arch/arm/libpthread_md.c ============================================================================== --- head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:20 2017 (r315973) +++ head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:56 2017 (r315974) @@ -90,7 +90,9 @@ pt_fpreg_to_ucontext(const struct fpreg mcontext_t *mc = &uc->uc_mcontext; /* XXX */ - memset(&mc->mc_spare, 0, sizeof(mc->mc_spare)); + mc->mc_vfp_size = 0; + mc->mc_vfp_ptr = NULL; + memset(mc->mc_spare, 0, sizeof(mc->mc_spare)); } void Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Mar 26 08:36:20 2017 (r315973) +++ head/sys/arm/arm/machdep.c Sun Mar 26 08:36:56 2017 (r315974) @@ -146,105 +146,6 @@ static delay_func *delay_impl; static void *delay_arg; #endif -void -sendsig(catcher, ksi, mask) - sig_t catcher; - ksiginfo_t *ksi; - sigset_t *mask; -{ - struct thread *td; - struct proc *p; - struct trapframe *tf; - struct sigframe *fp, frame; - struct sigacts *psp; - struct sysentvec *sysent; - int onstack; - int sig; - int code; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - sig = ksi->ksi_signo; - code = ksi->ksi_code; - psp = p->p_sigacts; - mtx_assert(&psp->ps_mtx, MA_OWNED); - tf = td->td_frame; - onstack = sigonstack(tf->tf_usr_sp); - - CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, - catcher, sig); - - /* Allocate and validate space for the signal handler context. */ - if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && - SIGISMEMBER(psp->ps_sigonstack, sig)) { - fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + - td->td_sigstk.ss_size); -#if defined(COMPAT_43) - td->td_sigstk.ss_flags |= SS_ONSTACK; -#endif - } else - fp = (struct sigframe *)td->td_frame->tf_usr_sp; - - /* make room on the stack */ - fp--; - - /* make the stack aligned */ - fp = (struct sigframe *)STACKALIGN(fp); - /* Populate the siginfo frame. */ - get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); - frame.sf_si = ksi->ksi_info; - frame.sf_uc.uc_sigmask = *mask; - frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK ) - ? ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; - frame.sf_uc.uc_stack = td->td_sigstk; - mtx_unlock(&psp->ps_mtx); - PROC_UNLOCK(td->td_proc); - - /* Copy the sigframe out to the user's stack. */ - if (copyout(&frame, fp, sizeof(*fp)) != 0) { - /* Process has trashed its stack. Kill it. */ - CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); - PROC_LOCK(p); - sigexit(td, SIGILL); - } - - /* - * Build context to run handler in. We invoke the handler - * directly, only returning via the trampoline. Note the - * trampoline version numbers are coordinated with machine- - * dependent code in libc. - */ - - tf->tf_r0 = sig; - tf->tf_r1 = (register_t)&fp->sf_si; - tf->tf_r2 = (register_t)&fp->sf_uc; - - /* the trampoline uses r5 as the uc address */ - tf->tf_r5 = (register_t)&fp->sf_uc; - tf->tf_pc = (register_t)catcher; - tf->tf_usr_sp = (register_t)fp; - sysent = p->p_sysent; - if (sysent->sv_sigcode_base != 0) - tf->tf_usr_lr = (register_t)sysent->sv_sigcode_base; - else - tf->tf_usr_lr = (register_t)(sysent->sv_psstrings - - *(sysent->sv_szsigcode)); - /* Set the mode to enter in the signal handler */ -#if __ARM_ARCH >= 7 - if ((register_t)catcher & 1) - tf->tf_spsr |= PSR_T; - else - tf->tf_spsr &= ~PSR_T; -#endif - - CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_usr_lr, - tf->tf_usr_sp); - - PROC_LOCK(p); - mtx_lock(&psp->ps_mtx); -} - struct kva_md_info kmi; /* @@ -488,6 +389,47 @@ exec_setregs(struct thread *td, struct i tf->tf_spsr = PSR_USR32_MODE; } + +#ifdef VFP +/* + * Get machine VFP context. + */ +static void +get_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) +{ + struct pcb *curpcb; + + curpcb = curthread->td_pcb; + critical_enter(); + + vfp_store(&curpcb->pcb_vfpstate, false); + memcpy(vfp->mcv_reg, curpcb->pcb_vfpstate.reg, + sizeof(vfp->mcv_reg)); + vfp->mcv_fpscr = curpcb->pcb_vfpstate.fpscr; + + critical_exit(); +} + +/* + * Set machine VFP context. + */ +static void +set_vfpcontext(struct thread *td, mcontext_vfp_t *vfp) +{ + struct pcb *curpcb; + + curpcb = curthread->td_pcb; + critical_enter(); + + vfp_discard(td); + memcpy(curpcb->pcb_vfpstate.reg, vfp->mcv_reg, + sizeof(curpcb->pcb_vfpstate.reg)); + curpcb->pcb_vfpstate.fpscr = vfp->mcv_fpscr; + + critical_exit(); +} +#endif + /* * Get machine context. */ @@ -520,6 +462,10 @@ get_mcontext(struct thread *td, mcontext gr[_REG_LR] = tf->tf_usr_lr; gr[_REG_PC] = tf->tf_pc; + mcp->mc_vfp_size = 0; + mcp->mc_vfp_ptr = NULL; + memset(&mcp->mc_spare, 0, sizeof(mcp->mc_spare)); + return (0); } @@ -532,9 +478,29 @@ get_mcontext(struct thread *td, mcontext int set_mcontext(struct thread *td, mcontext_t *mcp) { + mcontext_vfp_t mc_vfp, *vfp; struct trapframe *tf = td->td_frame; const __greg_t *gr = mcp->__gregs; +#ifdef WITNESS + if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_size != sizeof(mc_vfp)) { + printf("%s: %s: Malformed mc_vfp_size: %d (0x%08X)\n", + td->td_proc->p_comm, __func__, + mcp->mc_vfp_size, mcp->mc_vfp_size); + } else if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_ptr == NULL) { + printf("%s: %s: c_vfp_size != 0 but mc_vfp_ptr == NULL\n", + td->td_proc->p_comm, __func__); + } +#endif + + if (mcp->mc_vfp_size == sizeof(mc_vfp) && mcp->mc_vfp_ptr != NULL) { + if (copyin(mcp->mc_vfp_ptr, &mc_vfp, sizeof(mc_vfp)) != 0) + return (EFAULT); + vfp = &mc_vfp; + } else { + vfp = NULL; + } + tf->tf_r0 = gr[_REG_R0]; tf->tf_r1 = gr[_REG_R1]; tf->tf_r2 = gr[_REG_R2]; @@ -552,10 +518,120 @@ set_mcontext(struct thread *td, mcontext tf->tf_usr_lr = gr[_REG_LR]; tf->tf_pc = gr[_REG_PC]; tf->tf_spsr = gr[_REG_CPSR]; - +#ifdef VFP + if (vfp != NULL) + set_vfpcontext(td, vfp); +#endif return (0); } +void +sendsig(catcher, ksi, mask) + sig_t catcher; + ksiginfo_t *ksi; + sigset_t *mask; +{ + struct thread *td; + struct proc *p; + struct trapframe *tf; + struct sigframe *fp, frame; + struct sigacts *psp; + struct sysentvec *sysent; + int onstack; + int sig; + int code; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + code = ksi->ksi_code; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + tf = td->td_frame; + onstack = sigonstack(tf->tf_usr_sp); + + CTR4(KTR_SIG, "sendsig: td=%p (%s) catcher=%p sig=%d", td, p->p_comm, + catcher, sig); + + /* Allocate and validate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct sigframe *)((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size); +#if defined(COMPAT_43) + td->td_sigstk.ss_flags |= SS_ONSTACK; +#endif + } else + fp = (struct sigframe *)td->td_frame->tf_usr_sp; + + /* make room on the stack */ + fp--; + + /* make the stack aligned */ + fp = (struct sigframe *)STACKALIGN(fp); + /* Populate the siginfo frame. */ + get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); +#ifdef VFP + get_vfpcontext(td, &frame.sf_vfp); + frame.sf_uc.uc_mcontext.mc_vfp_size = sizeof(fp->sf_vfp); + frame.sf_uc.uc_mcontext.mc_vfp_ptr = &fp->sf_vfp; +#else + frame.sf_uc.uc_mcontext.mc_vfp_size = 0; + frame.sf_uc.uc_mcontext.mc_vfp_ptr = NULL; +#endif + frame.sf_si = ksi->ksi_info; + frame.sf_uc.uc_sigmask = *mask; + frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK ) + ? ((onstack) ? SS_ONSTACK : 0) : SS_DISABLE; + frame.sf_uc.uc_stack = td->td_sigstk; + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(td->td_proc); + + /* Copy the sigframe out to the user's stack. */ + if (copyout(&frame, fp, sizeof(*fp)) != 0) { + /* Process has trashed its stack. Kill it. */ + CTR2(KTR_SIG, "sendsig: sigexit td=%p fp=%p", td, fp); + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + /* + * Build context to run handler in. We invoke the handler + * directly, only returning via the trampoline. Note the + * trampoline version numbers are coordinated with machine- + * dependent code in libc. + */ + + tf->tf_r0 = sig; + tf->tf_r1 = (register_t)&fp->sf_si; + tf->tf_r2 = (register_t)&fp->sf_uc; + + /* the trampoline uses r5 as the uc address */ + tf->tf_r5 = (register_t)&fp->sf_uc; + tf->tf_pc = (register_t)catcher; + tf->tf_usr_sp = (register_t)fp; + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_usr_lr = (register_t)sysent->sv_sigcode_base; + else + tf->tf_usr_lr = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); + /* Set the mode to enter in the signal handler */ +#if __ARM_ARCH >= 7 + if ((register_t)catcher & 1) + tf->tf_spsr |= PSR_T; + else + tf->tf_spsr &= ~PSR_T; +#endif + + CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_usr_lr, + tf->tf_usr_sp); + + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} + int sys_sigreturn(td, uap) struct thread *td; @@ -578,7 +654,7 @@ sys_sigreturn(td, uap) if ((spsr & PSR_MODE) != PSR_USR32_MODE || (spsr & (PSR_I | PSR_F)) != 0) return (EINVAL); - /* Restore register context. */ + /* Restore register context. */ set_mcontext(td, &uc.uc_mcontext); /* Restore signal mask. */ Modified: head/sys/arm/include/frame.h ============================================================================== --- head/sys/arm/include/frame.h Sun Mar 26 08:36:20 2017 (r315973) +++ head/sys/arm/include/frame.h Sun Mar 26 08:36:56 2017 (r315974) @@ -94,6 +94,7 @@ struct trapframe { struct sigframe { siginfo_t sf_si; /* actual saved siginfo */ ucontext_t sf_uc; /* actual saved ucontext */ + mcontext_vfp_t sf_vfp; /* actual saved VFP context */ }; Modified: head/sys/arm/include/ucontext.h ============================================================================== --- head/sys/arm/include/ucontext.h Sun Mar 26 08:36:20 2017 (r315973) +++ head/sys/arm/include/ucontext.h Sun Mar 26 08:36:56 2017 (r315974) @@ -63,6 +63,14 @@ typedef __greg_t __gregset_t[_NGREG]; #define _REG_LR _REG_R14 #define _REG_PC _REG_R15 +/* + * Floating point register state + */ +typedef struct { + __uint64_t mcv_reg[32]; + __uint32_t mcv_fpscr; +} mcontext_vfp_t; + typedef struct { __gregset_t __gregs; @@ -70,7 +78,10 @@ typedef struct { * Originally, rest of this structure was named __fpu, 35 * 4 bytes * long, never accessed from kernel. */ - unsigned int mc_spare[35]; + size_t mc_vfp_size; + void *mc_vfp_ptr; + unsigned int mc_spare[33]; } mcontext_t; +#define UC_ #endif /* !_MACHINE_MCONTEXT_H_ */ From owner-svn-src-all@freebsd.org Sun Mar 26 08:50:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 08:51:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 08:52:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 08:52:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 08:53:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 08:54:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 09:10:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C0E0D1D1D1; Sun, 26 Mar 2017 09:10:03 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED4791826; Sun, 26 Mar 2017 09:10:02 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2Q9A2cC081834; Sun, 26 Mar 2017 09:10:02 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q9A26Z081833; Sun, 26 Mar 2017 09:10:02 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703260910.v2Q9A26Z081833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 26 Mar 2017 09:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315981 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 09:10:03 -0000 Author: avos Date: Sun Mar 26 09:10:01 2017 New Revision: 315981 URL: https://svnweb.freebsd.org/changeset/base/315981 Log: iwn: omit unneeded bus_dmamap_sync() calls when compiled without 'options IWN_DEBUG' Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 08:54:08 2017 (r315980) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 09:10:01 2017 (r315981) @@ -3944,6 +3944,7 @@ iwn_notif_intr(struct iwn_softc *sc) sc->errptr = le32toh(uc->errptr); break; } +#ifdef IWN_DEBUG case IWN_STATE_CHANGED: { /* @@ -3953,27 +3954,26 @@ iwn_notif_intr(struct iwn_softc *sc) */ bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef IWN_DEBUG + uint32_t *status = (uint32_t *)(desc + 1); DPRINTF(sc, IWN_DEBUG_INTR | IWN_DEBUG_STATE, "state changed to %x\n", le32toh(*status)); -#endif break; } case IWN_START_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); -#ifdef IWN_DEBUG + struct iwn_start_scan *scan = (struct iwn_start_scan *)(desc + 1); DPRINTF(sc, IWN_DEBUG_ANY, "%s: scanning channel %d status %x\n", __func__, scan->chan, le32toh(scan->status)); -#endif break; } +#endif case IWN_STOP_SCAN: { bus_dmamap_sync(sc->rxq.data_dmat, data->map, From owner-svn-src-all@freebsd.org Sun Mar 26 09:41:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F5A7D1E168; Sun, 26 Mar 2017 09:41:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47A9318B5; Sun, 26 Mar 2017 09:41:09 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2Q9f87E094174; Sun, 26 Mar 2017 09:41:08 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2Q9f8hh094173; Sun, 26 Mar 2017 09:41:08 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703260941.v2Q9f8hh094173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 26 Mar 2017 09:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315982 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 09:41:09 -0000 Author: avos Date: Sun Mar 26 09:41:08 2017 New Revision: 315982 URL: https://svnweb.freebsd.org/changeset/base/315982 Log: iwn: deduplicate code in iwn_tx_data() and iwn_tx_data_raw(). Some code was additionally moved for (future) lock splitting. Tested with Intel 6205, STA mode. Differential Revision: https://reviews.freebsd.org/D10106 Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 09:10:01 2017 (r315981) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 09:41:08 2017 (r315982) @@ -232,6 +232,8 @@ static int iwn_tx_data(struct iwn_softc static int iwn_tx_data_raw(struct iwn_softc *, struct mbuf *, struct ieee80211_node *, const struct ieee80211_bpf_params *params); +static int iwn_tx_cmd(struct iwn_softc *, struct mbuf *, + struct ieee80211_node *, struct iwn_tx_ring *); static void iwn_xmit_task(void *arg0, int pending); static int iwn_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); @@ -4392,32 +4394,25 @@ iwn_tx_rate_to_linkq_offset(struct iwn_s static int iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) { - struct iwn_ops *ops = &sc->ops; const struct ieee80211_txparam *tp = ni->ni_txparms; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; struct iwn_node *wn = (void *)ni; struct iwn_tx_ring *ring; - struct iwn_tx_desc *desc; - struct iwn_tx_data *data; struct iwn_tx_cmd *cmd; struct iwn_cmd_data *tx; struct ieee80211_frame *wh; struct ieee80211_key *k = NULL; - struct mbuf *m1; uint32_t flags; - uint16_t qos; - u_int hdrlen; - bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER]; + uint16_t seqno, qos; uint8_t tid, type; - int ac, i, totlen, error, pad, nsegs = 0, rate; + int ac, totlen, rate; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); IWN_LOCK_ASSERT(sc); wh = mtod(m, struct ieee80211_frame *); - hdrlen = ieee80211_anyhdrsize(wh); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; /* Select EDCA Access Category and TX ring for this frame. */ @@ -4428,7 +4423,21 @@ iwn_tx_data(struct iwn_softc *sc, struct qos = 0; tid = 0; } - ac = M_WME_GETAC(m); + + /* Choose a TX rate index. */ + if (type == IEEE80211_FC0_TYPE_MGT || + type == IEEE80211_FC0_TYPE_CTL || + (m->m_flags & M_EAPOL) != 0) + rate = tp->mgmtrate; + else if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + rate = tp->mcastrate; + else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) + rate = tp->ucastrate; + else { + /* XXX pass pktlen */ + (void) ieee80211_ratectl_rate(ni, NULL, 0); + rate = ni->ni_txrate; + } /* * XXX TODO: Group addressed frames aren't aggregated and must @@ -4436,12 +4445,13 @@ iwn_tx_data(struct iwn_softc *sc, struct * assigned from net80211. */ + ac = M_WME_GETAC(m); + seqno = ni->ni_txseqs[tid]; if (m->m_flags & M_AMPDU_MPDU) { - uint16_t seqno; struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[ac]; if (!IEEE80211_AMPDU_RUNNING(tap)) { - return EINVAL; + return (EINVAL); } /* @@ -4452,39 +4462,10 @@ iwn_tx_data(struct iwn_softc *sc, struct * being used! */ ac = *(int *)tap->txa_private; - seqno = ni->ni_txseqs[tid]; *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); - ring = &sc->txq[ac]; - if ((seqno % 256) != ring->cur) { - device_printf(sc->sc_dev, - "%s: m=%p: seqno (%d) (%d) != ring index (%d) !\n", - __func__, - m, - seqno, - seqno % 256, - ring->cur); - } ni->ni_txseqs[tid]++; } - ring = &sc->txq[ac]; - desc = &ring->desc[ring->cur]; - data = &ring->data[ring->cur]; - - /* Choose a TX rate index. */ - if (type == IEEE80211_FC0_TYPE_MGT || - type == IEEE80211_FC0_TYPE_CTL || - (m->m_flags & M_EAPOL) != 0) - rate = tp->mgmtrate; - else if (IEEE80211_IS_MULTICAST(wh->i_addr1)) - rate = tp->mcastrate; - else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) - rate = tp->ucastrate; - else { - /* XXX pass pktlen */ - (void) ieee80211_ratectl_rate(ni, NULL, 0); - rate = ni->ni_txrate; - } /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { @@ -4509,17 +4490,6 @@ iwn_tx_data(struct iwn_softc *sc, struct ieee80211_radiotap_tx(vap, m); } - /* Prepare TX firmware command. */ - cmd = &ring->cmd[ring->cur]; - cmd->code = IWN_CMD_TX_DATA; - cmd->flags = 0; - cmd->qid = ring->qid; - cmd->idx = ring->cur; - - tx = (struct iwn_cmd_data *)cmd->data; - /* NB: No need to clear tx, all fields are reinitialized here. */ - tx->scratch = 0; /* clear "scratch" area */ - flags = 0; if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) { /* Unicast frame, check if an ACK is expected. */ @@ -4562,6 +4532,25 @@ iwn_tx_data(struct iwn_softc *sc, struct } } + ring = &sc->txq[ac]; + if ((m->m_flags & M_AMPDU_MPDU) != 0 && + (seqno % 256) != ring->cur) { + device_printf(sc->sc_dev, + "%s: m=%p: seqno (%d) (%d) != ring index (%d) !\n", + __func__, + m, + seqno, + seqno % 256, + ring->cur); + } + + /* Prepare TX firmware command. */ + cmd = &ring->cmd[ring->cur]; + tx = (struct iwn_cmd_data *)cmd->data; + + /* NB: No need to clear tx, all fields are reinitialized here. */ + tx->scratch = 0; /* clear "scratch" area */ + if (IEEE80211_IS_MULTICAST(wh->i_addr1) || type != IEEE80211_FC0_TYPE_DATA) tx->id = sc->broadcast_id; @@ -4582,19 +4571,6 @@ iwn_tx_data(struct iwn_softc *sc, struct } else tx->timeout = htole16(0); - if (hdrlen & 3) { - /* First segment length must be a multiple of 4. */ - flags |= IWN_TX_NEED_PADDING; - pad = 4 - (hdrlen & 3); - } else - pad = 0; - - tx->len = htole16(totlen); - tx->tid = tid; - tx->rts_ntries = 60; - tx->data_ntries = 15; - tx->lifetime = htole32(IWN_LIFETIME_INFINITE); - tx->rate = iwn_rate_to_plcp(sc, ni, rate); if (tx->id == sc->broadcast_id) { /* Group or management frame. */ tx->linkq = 0; @@ -4603,115 +4579,28 @@ iwn_tx_data(struct iwn_softc *sc, struct flags |= IWN_TX_LINKQ; /* enable MRR */ } - /* Set physical address of "scratch area". */ - tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); - tx->hiaddr = IWN_HIADDR(data->scratch_paddr); - - /* Copy 802.11 header in TX command. */ - memcpy((uint8_t *)(tx + 1), wh, hdrlen); - - /* Trim 802.11 header. */ - m_adj(m, hdrlen); + tx->tid = tid; + tx->rts_ntries = 60; + tx->data_ntries = 15; + tx->lifetime = htole32(IWN_LIFETIME_INFINITE); + tx->rate = iwn_rate_to_plcp(sc, ni, rate); tx->security = 0; tx->flags = htole32(flags); - error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, - &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - if (error != EFBIG) { - device_printf(sc->sc_dev, - "%s: can't map mbuf (error %d)\n", __func__, error); - return error; - } - /* Too many DMA segments, linearize mbuf. */ - m1 = m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER - 1); - if (m1 == NULL) { - device_printf(sc->sc_dev, - "%s: could not defrag mbuf\n", __func__); - return ENOBUFS; - } - m = m1; - - error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, - segs, &nsegs, BUS_DMA_NOWAIT); - if (error != 0) { - device_printf(sc->sc_dev, - "%s: can't map mbuf (error %d)\n", __func__, error); - return error; - } - } - - data->m = m; - data->ni = ni; - - DPRINTF(sc, IWN_DEBUG_XMIT, - "%s: qid %d idx %d len %d nsegs %d flags 0x%08x rate 0x%04x plcp 0x%08x\n", - __func__, - ring->qid, - ring->cur, - m->m_pkthdr.len, - nsegs, - flags, - rate, - tx->rate); - - /* Fill TX descriptor. */ - desc->nsegs = 1; - if (m->m_len != 0) - desc->nsegs += nsegs; - /* First DMA segment is used by the TX command. */ - desc->segs[0].addr = htole32(IWN_LOADDR(data->cmd_paddr)); - desc->segs[0].len = htole16(IWN_HIADDR(data->cmd_paddr) | - (4 + sizeof (*tx) + hdrlen + pad) << 4); - /* Other DMA segments are for data payload. */ - seg = &segs[0]; - for (i = 1; i <= nsegs; i++) { - desc->segs[i].addr = htole32(IWN_LOADDR(seg->ds_addr)); - desc->segs[i].len = htole16(IWN_HIADDR(seg->ds_addr) | - seg->ds_len << 4); - seg++; - } - - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(ring->cmd_dma.tag, ring->cmd_dma.map, - BUS_DMASYNC_PREWRITE); - bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, - BUS_DMASYNC_PREWRITE); - - /* Update TX scheduler. */ - if (ring->qid >= sc->firstaggqueue) - ops->update_sched(sc, ring->qid, ring->cur, tx->id, totlen); - - /* Kick TX ring. */ - ring->cur = (ring->cur + 1) % IWN_TX_RING_COUNT; - IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur); - - /* Mark TX ring as full if we reach a certain threshold. */ - if (++ring->queued > IWN_TX_RING_HIMARK) - sc->qfullmsk |= 1 << ring->qid; - - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); - - return 0; + return (iwn_tx_cmd(sc, m, ni, ring)); } static int iwn_tx_data_raw(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, const struct ieee80211_bpf_params *params) { - struct iwn_ops *ops = &sc->ops; struct ieee80211vap *vap = ni->ni_vap; struct iwn_tx_cmd *cmd; struct iwn_cmd_data *tx; struct ieee80211_frame *wh; struct iwn_tx_ring *ring; - struct iwn_tx_desc *desc; - struct iwn_tx_data *data; - struct mbuf *m1; - bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER]; uint32_t flags; - u_int hdrlen; - int ac, totlen, error, pad, nsegs = 0, i, rate; + int ac, rate; uint8_t type; DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__); @@ -4719,29 +4608,12 @@ iwn_tx_data_raw(struct iwn_softc *sc, st IWN_LOCK_ASSERT(sc); wh = mtod(m, struct ieee80211_frame *); - hdrlen = ieee80211_anyhdrsize(wh); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; ac = params->ibp_pri & 3; - ring = &sc->txq[ac]; - desc = &ring->desc[ring->cur]; - data = &ring->data[ring->cur]; - /* Choose a TX rate. */ rate = params->ibp_rate0; - totlen = m->m_pkthdr.len; - - /* Prepare TX firmware command. */ - cmd = &ring->cmd[ring->cur]; - cmd->code = IWN_CMD_TX_DATA; - cmd->flags = 0; - cmd->qid = ring->qid; - cmd->idx = ring->cur; - - tx = (struct iwn_cmd_data *)cmd->data; - /* NB: No need to clear tx, all fields are reinitialized here. */ - tx->scratch = 0; /* clear "scratch" area */ flags = 0; if ((params->ibp_flags & IEEE80211_BPF_NOACK) == 0) @@ -4762,6 +4634,23 @@ iwn_tx_data_raw(struct iwn_softc *sc, st } else flags |= IWN_TX_NEED_CTS | IWN_TX_FULL_TXOP; } + + if (ieee80211_radiotap_active_vap(vap)) { + struct iwn_tx_radiotap_header *tap = &sc->sc_txtap; + + tap->wt_flags = 0; + tap->wt_rate = rate; + + ieee80211_radiotap_tx(vap, m); + } + + ring = &sc->txq[ac]; + cmd = &ring->cmd[ring->cur]; + + tx = (struct iwn_cmd_data *)cmd->data; + /* NB: No need to clear tx, all fields are reinitialized here. */ + tx->scratch = 0; /* clear "scratch" area */ + if (type == IEEE80211_FC0_TYPE_MGT) { uint8_t subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; @@ -4777,44 +4666,68 @@ iwn_tx_data_raw(struct iwn_softc *sc, st } else tx->timeout = htole16(0); - if (hdrlen & 3) { - /* First segment length must be a multiple of 4. */ - flags |= IWN_TX_NEED_PADDING; - pad = 4 - (hdrlen & 3); - } else - pad = 0; - - if (ieee80211_radiotap_active_vap(vap)) { - struct iwn_tx_radiotap_header *tap = &sc->sc_txtap; - - tap->wt_flags = 0; - tap->wt_rate = rate; - - ieee80211_radiotap_tx(vap, m); - } - - tx->len = htole16(totlen); tx->tid = 0; tx->id = sc->broadcast_id; tx->rts_ntries = params->ibp_try1; tx->data_ntries = params->ibp_try0; tx->lifetime = htole32(IWN_LIFETIME_INFINITE); tx->rate = iwn_rate_to_plcp(sc, ni, rate); + tx->security = 0; + tx->flags = htole32(flags); /* Group or management frame. */ tx->linkq = 0; + return (iwn_tx_cmd(sc, m, ni, ring)); +} + +static int +iwn_tx_cmd(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni, + struct iwn_tx_ring *ring) +{ + struct iwn_ops *ops = &sc->ops; + struct iwn_tx_cmd *cmd; + struct iwn_cmd_data *tx; + struct ieee80211_frame *wh; + struct iwn_tx_desc *desc; + struct iwn_tx_data *data; + bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER]; + struct mbuf *m1; + u_int hdrlen; + int totlen, error, pad, nsegs = 0, i; + + wh = mtod(m, struct ieee80211_frame *); + hdrlen = ieee80211_anyhdrsize(wh); + totlen = m->m_pkthdr.len; + + desc = &ring->desc[ring->cur]; + data = &ring->data[ring->cur]; + + /* Prepare TX firmware command. */ + cmd = &ring->cmd[ring->cur]; + cmd->code = IWN_CMD_TX_DATA; + cmd->flags = 0; + cmd->qid = ring->qid; + cmd->idx = ring->cur; + + tx = (struct iwn_cmd_data *)cmd->data; + tx->len = htole16(totlen); + /* Set physical address of "scratch area". */ tx->loaddr = htole32(IWN_LOADDR(data->scratch_paddr)); tx->hiaddr = IWN_HIADDR(data->scratch_paddr); + if (hdrlen & 3) { + /* First segment length must be a multiple of 4. */ + tx->flags |= htole32(IWN_TX_NEED_PADDING); + pad = 4 - (hdrlen & 3); + } else + pad = 0; /* Copy 802.11 header in TX command. */ memcpy((uint8_t *)(tx + 1), wh, hdrlen); /* Trim 802.11 header. */ m_adj(m, hdrlen); - tx->security = 0; - tx->flags = htole32(flags); error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, &nsegs, BUS_DMA_NOWAIT); @@ -4845,8 +4758,9 @@ iwn_tx_data_raw(struct iwn_softc *sc, st data->m = m; data->ni = ni; - DPRINTF(sc, IWN_DEBUG_XMIT, "%s: qid %d idx %d len %d nsegs %d\n", - __func__, ring->qid, ring->cur, m->m_pkthdr.len, nsegs); + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: qid %d idx %d len %d nsegs %d " + "plcp %d\n", + __func__, ring->qid, ring->cur, totlen, nsegs, tx->rate); /* Fill TX descriptor. */ desc->nsegs = 1; From owner-svn-src-all@freebsd.org Sun Mar 26 10:31:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CCC5D1D5D2; Sun, 26 Mar 2017 10:31:50 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C2541379; Sun, 26 Mar 2017 10:31:50 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QAVnIs016272; Sun, 26 Mar 2017 10:31:49 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QAVnU8016269; Sun, 26 Mar 2017 10:31:49 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703261031.v2QAVnU8016269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 26 Mar 2017 10:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315983 - in head/sys: conf libkern/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 10:31:50 -0000 Author: bde Date: Sun Mar 26 10:31:48 2017 New Revision: 315983 URL: https://svnweb.freebsd.org/changeset/base/315983 Log: Use inline asm instead of unportable intrinsics for the SSE4 crc32 optimization. This fixes building with gcc-4.2.1 (it doesn't support SSE4). gas-2.17.50 [FreeBSD] supports SSE4 instructions, so this doesn't need using .byte directives. This fixes depending on host user headers in the kernel. Fix user includes (don't depend on namespace pollution in that is not included now). The instrinsics had no advantages except to sometimes avoid compiler pessimixations. clang understands them a bit better than inline asm, and generates better looking code which also runs better for cem, but for me it just at the same speed or slower by doing excessive unrollowing in all the wrong places. gcc-4.2.1 also doesn't understand what it is doing with unrolling, but with -O3 somehow it does more unrolling that helps. Reduce 1 of the the compiler pessimizations (copying a variable which already satisfies an "rm" constraint in a good way by being in memory and not used again, to different memory and accessing it there. Force copying it to a register instead). Try to optimize the inner loops significantly, so as to run at full speed on smaller inputs. The algorithm is already very MD, and was tuned for the throughput of 3 crc32 instructions per cycle found on at least Sandybridge through Haswell. Now it is even more tuned for this, so depends more on the compiler not rearranging or unrolling things too much. The main inner loop for should have no difficulty runing at full speed on these CPUs unless the compiler unrolls it too much. However, the main inner loop wasn't even used for buffers smaller than 24K. Now it is used for buffers larger than 384 bytes. Now it is not so long, and the main outer loop is used more. The new optimization is to try to arrange that the outer loop runs in parallel with the next inner loop except for the final iteration; then reduce the loop sizes significantly to take advantage of this. Approved by: cem Not tested in production by: bde Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/libkern/x86/crc32_sse42.c Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Mar 26 09:41:08 2017 (r315982) +++ head/sys/conf/files.amd64 Sun Mar 26 10:31:48 2017 (r315983) @@ -545,6 +545,9 @@ isa/syscons_isa.c optional sc isa/vga_isa.c optional vga kern/kern_clocksource.c standard kern/link_elf_obj.c standard +libkern/x86/crc32_sse42.c standard +libkern/memmove.c standard +libkern/memset.c standard # # IA32 binary support # @@ -602,14 +605,6 @@ compat/ndis/subr_pe.c optional ndisapi compat/ndis/subr_usbd.c optional ndisapi pci compat/ndis/winx64_wrap.S optional ndisapi pci # -crc32_sse42.o standard \ - dependency "$S/libkern/x86/crc32_sse42.c" \ - compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ - no-implicit-rule \ - clean "crc32_sse42.o" -libkern/memmove.c standard -libkern/memset.c standard -# # x86 real mode BIOS emulator, required by dpms/pci/vesa # compat/x86bios/x86bios.c optional x86bios | dpms | pci | vesa Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Mar 26 09:41:08 2017 (r315982) +++ head/sys/conf/files.i386 Sun Mar 26 10:31:48 2017 (r315983) @@ -524,11 +524,6 @@ kern/kern_clocksource.c standard kern/imgact_aout.c optional compat_aout kern/imgact_gzip.c optional gzip kern/subr_sfbuf.c standard -crc32_sse42.o standard \ - dependency "$S/libkern/x86/crc32_sse42.c" \ - compile-with "${CC} -c ${CFLAGS:N-nostdinc} ${WERROR} ${PROF} -msse4 ${.IMPSRC}" \ - no-implicit-rule \ - clean "crc32_sse42.o" libkern/divdi3.c standard libkern/ffsll.c standard libkern/flsll.c standard @@ -539,6 +534,7 @@ libkern/qdivrem.c standard libkern/ucmpdi2.c standard libkern/udivdi3.c standard libkern/umoddi3.c standard +libkern/x86/crc32_sse42.c standard i386/xbox/xbox.c optional xbox i386/xbox/xboxfb.c optional xboxfb dev/fb/boot_font.c optional xboxfb Modified: head/sys/libkern/x86/crc32_sse42.c ============================================================================== --- head/sys/libkern/x86/crc32_sse42.c Sun Mar 26 09:41:08 2017 (r315982) +++ head/sys/libkern/x86/crc32_sse42.c Sun Mar 26 10:31:48 2017 (r315983) @@ -31,14 +31,40 @@ __FBSDID("$FreeBSD$"); */ #ifdef USERSPACE_TESTING #include +#include #else #include -#include -#include #include +#include #endif -#include +static __inline uint32_t +_mm_crc32_u8(uint32_t x, uint8_t y) +{ + /* + * clang (at least 3.9.[0-1]) pessimizes "rm" (y) and "m" (y) + * significantly and "r" (y) a lot by copying y to a different + * local variable (on the stack or in a register), so only use + * the latter. This costs a register and an instruction but + * not a uop. + */ + __asm("crc32b %1,%0" : "+r" (x) : "r" (y)); + return (x); +} + +static __inline uint32_t +_mm_crc32_u32(uint32_t x, uint32_t y) +{ + __asm("crc32l %1,%0" : "+r" (x) : "r" (y)); + return (x); +} + +static __inline uint64_t +_mm_crc32_u64(uint64_t x, uint64_t y) +{ + __asm("crc32q %1,%0" : "+r" (x) : "r" (y)); + return (x); +} /* CRC-32C (iSCSI) polynomial in reversed bit order. */ #define POLY 0x82f63b78 @@ -47,12 +73,18 @@ __FBSDID("$FreeBSD$"); * Block sizes for three-way parallel crc computation. LONG and SHORT must * both be powers of two. */ -#define LONG 8192 -#define SHORT 256 +#define LONG 128 +#define SHORT 64 -/* Tables for hardware crc that shift a crc by LONG and SHORT zeros. */ +/* + * Tables for updating a crc for LONG, 2 * LONG, SHORT and 2 * SHORT bytes + * of value 0 later in the input stream, in the same way that the hardware + * would, but in software without calculating intermediate steps. + */ static uint32_t crc32c_long[4][256]; +static uint32_t crc32c_2long[4][256]; static uint32_t crc32c_short[4][256]; +static uint32_t crc32c_2short[4][256]; /* * Multiply a matrix times a vector over the Galois field of two elements, @@ -171,7 +203,9 @@ __attribute__((__constructor__)) crc32c_init_hw(void) { crc32c_zeros(crc32c_long, LONG); + crc32c_zeros(crc32c_2long, 2 * LONG); crc32c_zeros(crc32c_short, SHORT); + crc32c_zeros(crc32c_2short, 2 * SHORT); } #ifdef _KERNEL SYSINIT(crc32c_sse42, SI_SUB_LOCK, SI_ORDER_ANY, crc32c_init_hw, NULL); @@ -190,7 +224,11 @@ sse42_crc32c(uint32_t crc, const unsigne const size_t align = 4; #endif const unsigned char *next, *end; - uint64_t crc0, crc1, crc2; /* need to be 64 bits for crc32q */ +#ifdef __amd64__ + uint64_t crc0, crc1, crc2; +#else + uint32_t crc0, crc1, crc2; +#endif next = buf; crc0 = crc; @@ -202,6 +240,7 @@ sse42_crc32c(uint32_t crc, const unsigne len--; } +#if LONG > SHORT /* * Compute the crc on sets of LONG*3 bytes, executing three independent * crc instructions, each on LONG bytes -- this is optimized for the @@ -209,6 +248,7 @@ sse42_crc32c(uint32_t crc, const unsigne * have a throughput of one crc per cycle, but a latency of three * cycles. */ + crc = 0; while (len >= LONG * 3) { crc1 = 0; crc2 = 0; @@ -229,16 +269,64 @@ sse42_crc32c(uint32_t crc, const unsigne #endif next += align; } while (next < end); - crc0 = crc32c_shift(crc32c_long, crc0) ^ crc1; - crc0 = crc32c_shift(crc32c_long, crc0) ^ crc2; + /*- + * Update the crc. Try to do it in parallel with the inner + * loop. 'crc' is used to accumulate crc0 and crc1 + * produced by the inner loop so that the next iteration + * of the loop doesn't depend on anything except crc2. + * + * The full expression for the update is: + * crc = S*S*S*crc + S*S*crc0 + S*crc1 + * where the terms are polynomials modulo the CRC polynomial. + * We regroup this subtly as: + * crc = S*S * (S*crc + crc0) + S*crc1. + * This has an extra dependency which reduces possible + * parallelism for the expression, but it turns out to be + * best to intentionally delay evaluation of this expression + * so that it competes less with the inner loop. + * + * We also intentionally reduce parallelism by feedng back + * crc2 to the inner loop as crc0 instead of accumulating + * it in crc. This synchronizes the loop with crc update. + * CPU and/or compiler schedulers produced bad order without + * this. + * + * Shifts take about 12 cycles each, so 3 here with 2 + * parallelizable take about 24 cycles and the crc update + * takes slightly longer. 8 dependent crc32 instructions + * can run in 24 cycles, so the 3-way blocking is worse + * than useless for sizes less than 8 * = 64 + * on amd64. In practice, SHORT = 32 confirms these + * timing calculations by giving a small improvement + * starting at size 96. Then the inner loop takes about + * 12 cycles and the crc update about 24, but these are + * partly in parallel so the total time is less than the + * 36 cycles that 12 dependent crc32 instructions would + * take. + * + * To have a chance of completely hiding the overhead for + * the crc update, the inner loop must take considerably + * longer than 24 cycles. LONG = 64 makes the inner loop + * take about 24 cycles, so is not quite large enough. + * LONG = 128 works OK. Unhideable overheads are about + * 12 cycles per inner loop. All assuming timing like + * Haswell. + */ + crc = crc32c_shift(crc32c_long, crc) ^ crc0; + crc1 = crc32c_shift(crc32c_long, crc1); + crc = crc32c_shift(crc32c_2long, crc) ^ crc1; + crc0 = crc2; next += LONG * 2; len -= LONG * 3; } + crc0 ^= crc; +#endif /* LONG > SHORT */ /* * Do the same thing, but now on SHORT*3 blocks for the remaining data * less than a LONG*3 block */ + crc = 0; while (len >= SHORT * 3) { crc1 = 0; crc2 = 0; @@ -259,11 +347,14 @@ sse42_crc32c(uint32_t crc, const unsigne #endif next += align; } while (next < end); - crc0 = crc32c_shift(crc32c_short, crc0) ^ crc1; - crc0 = crc32c_shift(crc32c_short, crc0) ^ crc2; + crc = crc32c_shift(crc32c_short, crc) ^ crc0; + crc1 = crc32c_shift(crc32c_short, crc1); + crc = crc32c_shift(crc32c_2short, crc) ^ crc1; + crc0 = crc2; next += SHORT * 2; len -= SHORT * 3; } + crc0 ^= crc; /* Compute the crc on the remaining bytes at native word size. */ end = next + (len - (len & (align - 1))); From owner-svn-src-all@freebsd.org Sun Mar 26 13:03:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A793BD1B8EF; Sun, 26 Mar 2017 13:03:17 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82248103A; Sun, 26 Mar 2017 13:03:17 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QD3G2E081283; Sun, 26 Mar 2017 13:03:16 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QD3GM3081280; Sun, 26 Mar 2017 13:03:16 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703261303.v2QD3GM3081280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 26 Mar 2017 13:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315984 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 13:03:17 -0000 Author: bde Date: Sun Mar 26 13:03:16 2017 New Revision: 315984 URL: https://svnweb.freebsd.org/changeset/base/315984 Log: Restore switching to a separate kernel terminal "input" state and extend it to a separate state for each CPU. Terminal "input" is user or kernel output. Its state includes the current parser state for escape sequences and multi-byte characters, and some results of previous parsing (mainly attributes), and in teken the cursor position, but not completed output. This state must be switched for kernel output since the kernel can preempt anything, including itself, and this must not affect the preempted state more than necessary. Since vty0 is shared, it is necessary to affect the frame buffer and cursor position and history, but escape sequences must not be affected and attributes for further output must not be affected. This used to work. The syscons terminal state contained mainly the parser state for escape sequences and attributes, but not the cursor position, and was switched. This was first broken by SMP and/or preemptive kernels. Then there should really be a separate state for each thread, and one more for ddb, or locking to prevent preemption. Serialization of printf() helps. But it is arcane that full syscons escape sequences mostly work in kernel printf(), and I have never seen them used except by me to test this fix. They worked perfectly except for the races, since "input" from the kernel was not special in any way. This was broken to use teken. The general switch was removed, and the kernel normal attribute was switched specially. The kernel reverse attribute (config option SC_CONS_REVERSE_ATTR) became unused, and is still unusable because teken doesn't support default reverse attributes (it used to only be used via the ANSI escape sequence to set reverse video). The only new difficulty for using teken seems to be that the cursor position is in the "input" state, so it must be updated in the active input state for each half of the switch. Do this to complete the restoration. The per-CPU state is mainly to make per-CPU coloring work cleanly, at a cost of some space. Each CPU gets its own full set of attribute (not just the current attribute) maintained in the usual way. This also reduces races from unserialized printf()s. However, this gives races for serialized printf()s that otherwise have none. Nothing prevents the CPU doing the a printf() changing in the middle of an escape sequence. Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Sun Mar 26 10:31:48 2017 (r315983) +++ head/sys/dev/syscons/scterm-teken.c Sun Mar 26 13:03:16 2017 (r315984) @@ -162,23 +162,12 @@ scteken_term(scr_stat *scp, void **softc } static void -scteken_puts(scr_stat *scp, u_char *buf, int len, int kernel) +scteken_puts(scr_stat *scp, u_char *buf, int len) { teken_stat *ts = scp->ts; - teken_attr_t backup, kattr; scp->sc->write_in_progress++; - if (kernel) { - /* Use special colors for kernel messages. */ - backup = *teken_get_curattr(&ts->ts_teken); - scteken_sc_to_te_attr(sc_kattr(), &kattr); - teken_set_curattr(&ts->ts_teken, &kattr); - teken_input(&ts->ts_teken, buf, len); - teken_set_curattr(&ts->ts_teken, &backup); - } else { - /* Print user messages with regular colors. */ - teken_input(&ts->ts_teken, buf, len); - } + teken_input(&ts->ts_teken, buf, len); scp->sc->write_in_progress--; } Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sun Mar 26 10:31:48 2017 (r315983) +++ head/sys/dev/syscons/syscons.c Sun Mar 26 13:03:16 2017 (r315984) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -97,6 +98,7 @@ static int sc_console_unit = -1; static int sc_saver_keyb_only = 1; static scr_stat *sc_console; static struct consdev *sc_consptr; +static void *kernel_console_ts[MAXCPU]; static scr_stat main_console; static struct tty *main_devs[MAXCONS]; @@ -181,7 +183,7 @@ static void scshutdown(void *, int); static void scsuspend(void *); static void scresume(void *); static u_int scgetc(sc_softc_t *sc, u_int flags, struct sc_cnstate *sp); -static void sc_puts(scr_stat *scp, u_char *buf, int len, int kernel); +static void sc_puts(scr_stat *scp, u_char *buf, int len); #define SCGETC_CN 1 #define SCGETC_NONBLOCK 2 static void sccnupdate(scr_stat *scp); @@ -218,6 +220,7 @@ static void update_font(scr_stat *); static int save_kbd_state(scr_stat *scp); static int update_kbd_state(scr_stat *scp, int state, int mask); static int update_kbd_leds(scr_stat *scp, int which); +static int sc_kattr(void); static timeout_t blink_screen; static struct tty *sc_alloc_tty(int, int); @@ -394,7 +397,7 @@ sctty_outwakeup(struct tty *tp) if (len == 0) break; SC_VIDEO_LOCK(scp->sc); - sc_puts(scp, buf, len, 0); + sc_puts(scp, buf, len); SC_VIDEO_UNLOCK(scp->sc); } } @@ -541,7 +544,8 @@ sc_attach_unit(int unit, int flags) sc_softc_t *sc; scr_stat *scp; struct cdev *dev; - int vc; + void *oldts, *ts; + int i, vc; if (!vty_enabled(VTY_SC)) return ENXIO; @@ -556,8 +560,27 @@ sc_attach_unit(int unit, int flags) /* assert(sc_console != NULL) */ flags |= SC_KERNEL_CONSOLE; scmeminit(NULL); + + scinit(unit, flags); + + if (sc_console->tsw->te_size > 0) { + /* assert(sc_console->ts != NULL); */ + oldts = sc_console->ts; + for (i = 0; i <= mp_maxid; i++) { + ts = malloc(sc_console->tsw->te_size, M_DEVBUF, M_WAITOK); + bcopy(oldts, ts, sc_console->tsw->te_size); + sc_console->ts = ts; + (*sc_console->tsw->te_default_attr)(sc_console, sc_kattrtab[i], + SC_KERNEL_CONS_REV_ATTR); + kernel_console_ts[i] = ts; + } + sc_console->ts = oldts; + (*sc_console->tsw->te_default_attr)(sc_console, SC_NORM_ATTR, + SC_NORM_REV_ATTR); + } + } else { + scinit(unit, flags); } - scinit(unit, flags); sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE); sc->config = flags; @@ -1885,6 +1908,7 @@ sc_cnputc(struct consdev *cd, int c) struct sc_cnstate st; u_char buf[1]; scr_stat *scp = sc_console; + void *oldts, *ts; #ifndef SC_NO_HISTORY #if 0 struct tty *tp; @@ -1948,7 +1972,16 @@ sc_cnputc(struct consdev *cd, int c) if (atomic_load_acq_int(&sc_cnputc_loghead) - sc_cnputc_logtail >= sizeof(sc_cnputc_log)) continue; - sc_puts(scp, buf, 1, 1); + /* Console output has a per-CPU "input" state. Switch for it. */ + oldts = scp->ts; + ts = kernel_console_ts[PCPU_GET(cpuid)]; + if (ts != NULL) { + scp->ts = ts; + (*scp->tsw->te_set_cursor)(scp, scp->xpos, scp->ypos); + } + sc_puts(scp, buf, 1); + scp->ts = oldts; + (*scp->tsw->te_set_cursor)(scp, scp->xpos, scp->ypos); } s = spltty(); /* block sckbdevent and scrn_timer */ @@ -2890,7 +2923,7 @@ exchange_scr(sc_softc_t *sc) } static void -sc_puts(scr_stat *scp, u_char *buf, int len, int kernel) +sc_puts(scr_stat *scp, u_char *buf, int len) { #ifdef DEV_SPLASH /* make screensaver happy */ @@ -2899,7 +2932,7 @@ sc_puts(scr_stat *scp, u_char *buf, int #endif if (scp->tsw) - (*scp->tsw->te_puts)(scp, buf, len, kernel); + (*scp->tsw->te_puts)(scp, buf, len); if (scp->sc->delayed_next_scr) sc_switch_scr(scp->sc, scp->sc->delayed_next_scr - 1); } @@ -3135,7 +3168,8 @@ scinit(int unit, int flags) (void *)sc_buffer, FALSE); if (sc_init_emulator(scp, SC_DFLT_TERM)) sc_init_emulator(scp, "*"); - (*scp->tsw->te_default_attr)(scp, SC_NORM_ATTR, SC_NORM_REV_ATTR); + (*scp->tsw->te_default_attr)(scp, SC_KERNEL_CONS_ATTR, + SC_KERNEL_CONS_REV_ATTR); } else { /* assert(sc_malloc) */ sc->dev = malloc(sizeof(struct tty *)*sc->vtys, M_DEVBUF, @@ -4068,9 +4102,11 @@ sc_bell(scr_stat *scp, int pitch, int du } } -int +static int sc_kattr(void) { + if (sc_console == NULL) + return (SC_KERNEL_CONS_ATTR); return (sc_kattrtab[PCPU_GET(cpuid) % nitems(sc_kattrtab)]); } Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Sun Mar 26 10:31:48 2017 (r315983) +++ head/sys/dev/syscons/syscons.h Sun Mar 26 13:03:16 2017 (r315984) @@ -381,7 +381,7 @@ typedef int sc_term_init_t(scr_stat *scp #define SC_TE_COLD_INIT 0 #define SC_TE_WARM_INIT 1 typedef int sc_term_term_t(scr_stat *scp, void **tcp); -typedef void sc_term_puts_t(scr_stat *scp, u_char *buf, int len, int kernel); +typedef void sc_term_puts_t(scr_stat *scp, u_char *buf, int len); typedef int sc_term_ioctl_t(scr_stat *scp, struct tty *tp, u_long cmd, caddr_t data, struct thread *td); typedef int sc_term_reset_t(scr_stat *scp, int code); @@ -583,7 +583,6 @@ void sc_paste(scr_stat *scp, const u_ch void sc_respond(scr_stat *scp, const u_char *p, int count, int wakeup); void sc_bell(scr_stat *scp, int pitch, int duration); -int sc_kattr(void); /* schistory.c */ #ifndef SC_NO_HISTORY From owner-svn-src-all@freebsd.org Sun Mar 26 14:09:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11031D1D8F9; Sun, 26 Mar 2017 14:09:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C787019BD; Sun, 26 Mar 2017 14:09:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QE9PGY005796; Sun, 26 Mar 2017 14:09:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QE9PB6005791; Sun, 26 Mar 2017 14:09:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201703261409.v2QE9PB6005791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 26 Mar 2017 14:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315985 - in head/usr.bin/diff: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 14:09:27 -0000 Author: jilles Date: Sun Mar 26 14:09:25 2017 New Revision: 315985 URL: https://svnweb.freebsd.org/changeset/base/315985 Log: diff: Fix mtime of file1 in -u/-c header line. PR: 218018 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10140 Added: head/usr.bin/diff/tests/header.out (contents, props changed) Modified: head/usr.bin/diff/diffreg.c head/usr.bin/diff/tests/Makefile head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Sun Mar 26 13:03:16 2017 (r315984) +++ head/usr.bin/diff/diffreg.c Sun Mar 26 14:09:25 2017 (r315985) @@ -1614,7 +1614,7 @@ print_header(const char *file1, const ch char buf2[256]; char end1[10]; char end2[10]; - struct tm *tm_ptr1, *tm_ptr2; + struct tm tm1, tm2, *tm_ptr1, *tm_ptr2; int nsec1 = TIMESPEC_NS (stb1.st_mtime); int nsec2 = TIMESPEC_NS (stb2.st_mtime); @@ -1626,8 +1626,8 @@ print_header(const char *file1, const ch if (cflag) time_format = "%c"; - tm_ptr1 = localtime(&stb1.st_mtime); - tm_ptr2 = localtime(&stb2.st_mtime); + tm_ptr1 = localtime_r(&stb1.st_mtime, &tm1); + tm_ptr2 = localtime_r(&stb2.st_mtime, &tm2); strftime(buf1, 256, time_format, tm_ptr1); strftime(buf2, 256, time_format, tm_ptr2); if (!cflag) { Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Sun Mar 26 13:03:16 2017 (r315984) +++ head/usr.bin/diff/tests/Makefile Sun Mar 26 14:09:25 2017 (r315985) @@ -19,7 +19,8 @@ ${PACKAGE}FILES+= \ simple_p.out \ unified_p.out \ unified_c9999.out \ - unified_9999.out + unified_9999.out \ + header.out NETBSD_ATF_TESTS_SH+= netbsd_diff_test Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Sun Mar 26 13:03:16 2017 (r315984) +++ head/usr.bin/diff/tests/diff_test.sh Sun Mar 26 14:09:25 2017 (r315985) @@ -2,6 +2,7 @@ atf_test_case simple atf_test_case unified +atf_test_case header simple_body() { @@ -46,8 +47,20 @@ unified_body() diff -u9999 -L input_c1.in -L input_c2.in "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in" } +header_body() +{ + export TZ=UTC + : > empty + echo hello > hello + touch -d 2015-04-03T01:02:03 empty + touch -d 2016-12-22T11:22:33 hello + atf_check -o "file:$(atf_get_srcdir)/header.out" -s eq:1 \ + diff -u empty hello +} + atf_init_test_cases() { atf_add_test_case simple atf_add_test_case unified + atf_add_test_case header } Added: head/usr.bin/diff/tests/header.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/header.out Sun Mar 26 14:09:25 2017 (r315985) @@ -0,0 +1,4 @@ +--- empty 2015-04-03 01:02:03.000000000 +0000 ++++ hello 2016-12-22 11:22:33.000000000 +0000 +@@ -0,0 +1 @@ ++hello From owner-svn-src-all@freebsd.org Sun Mar 26 14:31:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B9BBD1DF26; Sun, 26 Mar 2017 14:31:31 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C061514B4; Sun, 26 Mar 2017 14:31:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QEVTQi013763; Sun, 26 Mar 2017 14:31:29 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QEVTGJ013762; Sun, 26 Mar 2017 14:31:29 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703261431.v2QEVTGJ013762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 26 Mar 2017 14:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315986 - head/sys/dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 14:31:31 -0000 Author: bde Date: Sun Mar 26 14:31:29 2017 New Revision: 315986 URL: https://svnweb.freebsd.org/changeset/base/315986 Log: Fix 3 entries in mode tables related to mono and 90-column text modes. Newer VGAs don't support any mono modes, but bugs in the tables created 2 virtual mono modes (#45 90x43 and #112 80x43) that behaved more strangely than crashing. 90-column modes are tweaked 80-column ones and also fail to work on newer VGAs. #45 did crash (hang) on some hardware. Modified: head/sys/dev/fb/vga.c Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Sun Mar 26 14:09:25 2017 (r315985) +++ head/sys/dev/fb/vga.c Sun Mar 26 14:31:29 2017 (r315986) @@ -345,7 +345,7 @@ static video_info_t bios_vmode[] = { { M_EGAMONO80x25, 0, 80, 25, 8, 14, 2, 1, MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, /* EGA */ - { M_ENH_B80x43, 0, 80, 43, 8, 8, 2, 1, + { M_ENH_B80x43, V_INFO_COLOR, 80, 43, 8, 8, 2, 1, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, { M_ENH_C80x43, V_INFO_COLOR, 80, 43, 8, 8, 4, 1, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, @@ -375,7 +375,7 @@ static video_info_t bios_vmode[] = { { M_VGA_C90x30, V_INFO_COLOR, 90, 30, 8, 16, 4, 1, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, { M_VGA_M90x43, 0, 90, 43, 8, 8, 2, 1, - CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, + MDA_BUF_BASE, MDA_BUF_SIZE, MDA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, { M_VGA_C90x43, V_INFO_COLOR, 90, 43, 8, 8, 4, 1, CGA_BUF_BASE, CGA_BUF_SIZE, CGA_BUF_SIZE, 0, 0, V_INFO_MM_TEXT }, { M_VGA_M90x50, 0, 90, 50, 8, 8, 2, 1, @@ -591,7 +591,7 @@ map_mode_num(int mode) { M_VGA_C90x25, M_VGA_C80x25 }, { M_VGA_M90x30, M_VGA_M80x25 }, { M_VGA_C90x30, M_VGA_C80x25 }, - { M_VGA_M90x43, M_ENH_B80x25 }, + { M_VGA_M90x43, M_VGA_M80x25 }, { M_VGA_C90x43, M_ENH_C80x25 }, { M_VGA_M90x50, M_VGA_M80x25 }, { M_VGA_C90x50, M_VGA_C80x25 }, From owner-svn-src-all@freebsd.org Sun Mar 26 14:37:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3147D1E0F9; Sun, 26 Mar 2017 14:37:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 702D3191F; Sun, 26 Mar 2017 14:37:13 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QEbCIb017603; Sun, 26 Mar 2017 14:37:12 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QEbCp9017599; Sun, 26 Mar 2017 14:37:12 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703261437.v2QEbCp9017599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 26 Mar 2017 14:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315987 - in head/libexec/bootpd: . tools/bootptest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 14:37:13 -0000 Author: rwatson Date: Sun Mar 26 14:37:12 2017 New Revision: 315987 URL: https://svnweb.freebsd.org/changeset/base/315987 Log: Emply contemporary function prototypes in bootpd, rather than relying on locally defined K&R prototypes in .c files; use appropriate casts for pointer types now that types for arguments are available at compile time. This ensures that compilers with multiple incompatible calling conventions can select the correct calling convention for external functions. Sponsored by: DARPA, AFRL MFC after: 1 week Modified: head/libexec/bootpd/getif.c head/libexec/bootpd/tools/bootptest/bootptest.c head/libexec/bootpd/tools/bootptest/bootptest.h head/libexec/bootpd/tools/bootptest/print-bootp.c Modified: head/libexec/bootpd/getif.c ============================================================================== --- head/libexec/bootpd/getif.c Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/getif.c Sun Mar 26 14:37:12 2017 (r315987) @@ -36,7 +36,7 @@ static struct ifreq ifreq[10]; /* Holds interface configuration */ static struct ifconf ifconf; /* points to ifreq */ -static int nmatch(); +static int nmatch(u_char *ca, u_char *cb); /* Return a pointer to the interface struct for the passed address. */ struct ifreq * Modified: head/libexec/bootpd/tools/bootptest/bootptest.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/bootptest.c Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/tools/bootptest/bootptest.c Sun Mar 26 14:37:12 2017 (r315987) @@ -71,7 +71,7 @@ char *usage = "bootptest [-h] server-nam #include "patchlevel.h" -static void send_request(); +static void send_request(int s); #define LOG_ERR 1 #define BUFLEN 1024 @@ -122,9 +122,6 @@ unsigned char vm_cmu[4] = VM_CMU; unsigned char vm_rfc1048[4] = VM_RFC1048; short secs; /* How long client has waited */ -char *get_errmsg(); -extern void bootp_print(); - /* * Initialization such as command-line processing is done, then * the receiver loop is started. Die when interrupted. @@ -429,7 +426,7 @@ main(argc, argv) /* set globals needed by bootp_print() */ snaplen = n; snapend = (unsigned char *) rcvbuf + snaplen; - bootp_print(rcvbuf, n, sin_from.sin_port, 0); + bootp_print((struct bootp *)rcvbuf, n, sin_from.sin_port, 0); putchar('\n'); /* * This no longer exits immediately after receiving @@ -447,7 +444,7 @@ send_request(s) { /* Print the request packet. */ printf("Sending to %s", inet_ntoa(sin_server.sin_addr)); - bootp_print(sndbuf, snaplen, sin_from.sin_port, 0); + bootp_print((struct bootp *)sndbuf, snaplen, sin_from.sin_port, 0); putchar('\n'); /* Send the request packet. */ Modified: head/libexec/bootpd/tools/bootptest/bootptest.h ============================================================================== --- head/libexec/bootpd/tools/bootptest/bootptest.h Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/tools/bootptest/bootptest.h Sun Mar 26 14:37:12 2017 (r315987) @@ -20,4 +20,7 @@ extern int vflag; /* verbose flag */ extern unsigned char *packetp; extern unsigned char *snapend; -extern char *ipaddr_string(struct in_addr *); +void bootp_print(struct bootp *bp, int length, u_short sport, + u_short dport); +char *ipaddr_string(struct in_addr *); +int printfn(u_char *s, u_char *ep); Modified: head/libexec/bootpd/tools/bootptest/print-bootp.c ============================================================================== --- head/libexec/bootpd/tools/bootptest/print-bootp.c Sun Mar 26 14:31:29 2017 (r315986) +++ head/libexec/bootpd/tools/bootptest/print-bootp.c Sun Mar 26 14:37:12 2017 (r315987) @@ -42,11 +42,10 @@ #include "bootptest.h" /* These decode the vendor data. */ -extern int printfn(); -static void rfc1048_print(); -static void cmu_print(); -static void other_print(); -static void dump_hex(); +static void rfc1048_print(u_char *bp, int length); +static void cmu_print(u_char *bp, int length); +static void other_print(u_char *bp, int length); +static void dump_hex(u_char *bp, int len); /* * Print bootp requests From owner-svn-src-all@freebsd.org Sun Mar 26 14:43:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9DA3D1E517; Sun, 26 Mar 2017 14:43:28 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 381AA1F24; Sun, 26 Mar 2017 14:43:27 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from hermann ([78.52.132.127]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MhiPD-1cVEp112t1-00Mwx4; Sun, 26 Mar 2017 16:43:20 +0200 Date: Sun, 26 Mar 2017 16:43:18 +0200 From: "Hartmann, O." To: Andriy Voskoboinyk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315981 - head/sys/dev/iwn Message-ID: <20170326164309.759fc5b9@hermann> In-Reply-To: <201703260910.v2Q9A26Z081833@repo.freebsd.org> References: <201703260910.v2Q9A26Z081833@repo.freebsd.org> Organization: walstatt.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:5vhWXp6TtXknNrarH+OicNk2VELzxyozLSr92IM4wwxfwkMYHnu ecXSJ/piTsaM7uq5q2oGegftW3kG8VHUjtYj14524TqvrQaMQMNSQBVLDnjRw7ec4UAtnDD 81rKXGEWG+UqvYpruW0XzrJI4OQGOpw1jSPlmYUPNe2ugIR8bpLnehnWv7d5p8suowbZHB3 MYaD8XOPHFlbyZ2uW4hSQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:5cDFssN/zzw=:KNsuVid3O9QmS15FGuX8L3 oobpnmGB17RWXOCudLw15Tx61j1VqHAiLms5Y+jvbb2mAYehXn96Z0xc5lBCqlylpj4/YR8NA dzk6S0vfB8Zen9yGb9tUG2i3P6/oiXWw3esVqV8PX2Uid8govv2nzTqSk5Zh6jQKcltrtKkNm U7UATf2WkY/eJmSUUOp7DY1niDIzco5J1qYzAuc6hTT68c9mCnO470zM8TwaxanLNUNZAQyjw xqa9JL3vM7TXfISPH0eOC3hOfiV1QLfQ9cqEQFQPkclSgqsMLSACPWqh3pFQy0IGRGeLH42ux N0ZoUgjbsXtfvNKif9wHVc3qddRb2TvWi2bAx3s6oFRu6gXUQKnYjZxDgY71eh/PRsc6WVMWh 7mmGuCMfNRGtLWPMgZEzVOalAgsakLnUWwKFlqOei9tJzUP1SxHIXB/+aEE5sXLRVUWgaIis7 sm0T1bNnVAUNo+tgyMd7zFMPNKc41KjFLLV3bAh4dL2qWq0K3uXj3qTaAhYYnXviPlXptox9/ Fg7A1jMHnckob90uUVU5USy8HDaYWFlGCaLrFUYDtcOukOp8/tVbBzigsBFCT3Unhf3Y8CTGO xAFEjo/5mJT/OoWICC3CHrO98Yhj8mCseVN6lhk4nLy396CUw+xxS/lJy/zrt6+KfNeXlbXpF H3IsL21xt7PbSSYo2gguDN9mc9BMIS7ONWCry1FqW0hr7gbFHmA5pwd96tMw8ACMgQ9Q4eknE IAPjeZEgDajdEmvkYTAKTGFH2Qosp9wSBwecuFGRnl404OrlkYl8XV0asbutoWVZcyO1+pWuW 0t429ft X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 14:43:28 -0000 On Sun, 26 Mar 2017 09:10:02 +0000 (UTC) Andriy Voskoboinyk wrote: > Author: avos > Date: Sun Mar 26 09:10:01 2017 > New Revision: 315981 > URL: https://svnweb.freebsd.org/changeset/base/315981 > > Log: > iwn: omit unneeded bus_dmamap_sync() calls when compiled without > 'options IWN_DEBUG' > > Modified: > head/sys/dev/iwn/if_iwn.c > > Modified: head/sys/dev/iwn/if_iwn.c > ============================================================================== > --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 08:54:08 2017 > (r315980) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 09:10:01 > 2017 (r315981) @@ -3944,6 +3944,7 @@ iwn_notif_intr(struct > iwn_softc *sc) sc->errptr = le32toh(uc->errptr); > break; > } > +#ifdef IWN_DEBUG > case IWN_STATE_CHANGED: > { > /* > @@ -3953,27 +3954,26 @@ iwn_notif_intr(struct iwn_softc *sc) > */ > bus_dmamap_sync(sc->rxq.data_dmat, data->map, > BUS_DMASYNC_POSTREAD); > -#ifdef IWN_DEBUG > + > uint32_t *status = (uint32_t *)(desc + 1); > DPRINTF(sc, IWN_DEBUG_INTR | IWN_DEBUG_STATE, > "state changed to %x\n", > le32toh(*status)); > -#endif > break; > } > case IWN_START_SCAN: > { > bus_dmamap_sync(sc->rxq.data_dmat, data->map, > BUS_DMASYNC_POSTREAD); > -#ifdef IWN_DEBUG > + > struct iwn_start_scan *scan = > (struct iwn_start_scan *)(desc + 1); > DPRINTF(sc, IWN_DEBUG_ANY, > "%s: scanning channel %d status %x\n", > __func__, scan->chan, > le32toh(scan->status)); -#endif > break; > } > +#endif > case IWN_STOP_SCAN: > { > bus_dmamap_sync(sc->rxq.data_dmat, data->map, > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org" It seems when iwm is configured in a kernel without debugging enabled, builkernel failsas shown below: [...] -------------------------------------------------------------- >>> stage 3.1: building everything -------------------------------------------------------------- cd /usr/obj/usr/src/sys/HERMANN; COMPILER_VERSION=40000 COMPILER_TYPE=clang COMPILER_FREEBSD_VERSION=1200006 MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=amd64 MACHINE=amd64 CPUTYPE=native BUILD_TOOLS_META=.NOMETA_CMP GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac CC="cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CXX="c++ -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" CPP="cpp -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/usr/src/tmp -B/usr/obj/usr/src/tmp/usr/bin" AS="as" AR="ar" LD="ld" LLVM_LINK="" NM=nm OBJCOPY="objcopy" RANLIB=ranlib STRINGS= SIZE="size" INSTALL="sh /usr/src/tools/install.sh" PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin make -m /usr/src/share/mk KERNEL=kernel all -DNO_MODULES_OBJ Building /usr/obj/usr/src/sys/HERMANN/if_iwm_scan.o /usr/src/sys/dev/iwm/if_iwm_scan.c:224:12: error: unused variable 'aborted' [-Werror,-Wunused-variable] boolean_t aborted = (scan_notif->status == IWM_SCAN_OFFLOAD_ABORTED); ^ /usr/src/sys/dev/iwm/if_iwm_scan.c:251:11: error: unused variable 'uid' [-Werror,-Wunused-variable] uint32_t uid = le32toh(notif->uid); From owner-svn-src-all@freebsd.org Sun Mar 26 16:46:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E7E3D1E605; Sun, 26 Mar 2017 16:46:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30B911BC1; Sun, 26 Mar 2017 16:46:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QGkdCY071931; Sun, 26 Mar 2017 16:46:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QGkdj7071930; Sun, 26 Mar 2017 16:46:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703261646.v2QGkdj7071930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 26 Mar 2017 16:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315988 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 16:46:40 -0000 Author: avos Date: Sun Mar 26 16:46:39 2017 New Revision: 315988 URL: https://svnweb.freebsd.org/changeset/base/315988 Log: iwn: drop unneeded bus_dmamap_sync() calls. 1) They are using wrong tag (Tx) + map (Rx) combination. 2) Rx descriptor is already synchronized in iwn_notif_intr() 3) It's not needed for transmitted data since device does not change mbuf contents. Tested with Intel 6205 (amd64), STA mode. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 14:37:12 2017 (r315987) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 16:46:39 2017 (r315988) @@ -3516,11 +3516,7 @@ iwn4965_tx_done(struct iwn_softc *sc, st struct iwn_rx_data *data) { struct iwn4965_tx_stat *stat = (struct iwn4965_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring; - int qid; - - qid = desc->qid & 0xf; - ring = &sc->txq[qid]; + int qid = desc->qid & 0xf; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d RTS retries %d ACK retries %d nkill %d rate %x duration %d status %x\n", @@ -3531,7 +3527,6 @@ iwn4965_tx_done(struct iwn_softc *sc, st stat->rate, le16toh(stat->duration), le32toh(stat->status)); - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); if (qid >= sc->firstaggqueue) { iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, stat->rtsfailcnt, stat->ackfailcnt, &stat->status); @@ -3546,11 +3541,7 @@ iwn5000_tx_done(struct iwn_softc *sc, st struct iwn_rx_data *data) { struct iwn5000_tx_stat *stat = (struct iwn5000_tx_stat *)(desc + 1); - struct iwn_tx_ring *ring; - int qid; - - qid = desc->qid & 0xf; - ring = &sc->txq[qid]; + int qid = desc->qid & 0xf; DPRINTF(sc, IWN_DEBUG_XMIT, "%s: " "qid %d idx %d RTS retries %d ACK retries %d nkill %d rate %x duration %d status %x\n", @@ -3566,7 +3557,6 @@ iwn5000_tx_done(struct iwn_softc *sc, st iwn5000_reset_sched(sc, desc->qid & 0xf, desc->idx); #endif - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); if (qid >= sc->firstaggqueue) { iwn_ampdu_tx_done(sc, qid, desc->idx, stat->nframes, stat->rtsfailcnt, stat->ackfailcnt, &stat->status); From owner-svn-src-all@freebsd.org Sun Mar 26 16:49:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F139D1E6A7; Sun, 26 Mar 2017 16:49:22 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8EEB1D22; Sun, 26 Mar 2017 16:49:21 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QGnKF9072089; Sun, 26 Mar 2017 16:49:20 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QGnKXP072087; Sun, 26 Mar 2017 16:49:20 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201703261649.v2QGnKXP072087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Sun, 26 Mar 2017 16:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r315989 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 16:49:22 -0000 Author: jpaetzel Date: Sun Mar 26 16:49:20 2017 New Revision: 315989 URL: https://svnweb.freebsd.org/changeset/base/315989 Log: 7603 xuio_stat_wbuf_* should be declared (void) illumos/illumos-gate@99aa8b55058e512798eafbd71f72f916bdc10181 https://github.com/illumos/illumos-gate/commit/99aa8b55058e512798eafbd71f72f916bdc10181 https://www.illumos.org/issues/7603 The funcs are declared k&r style, where the args are not specified: void xuio_stat_wbuf_copied(); They should be declared to take no arguments: void xuio_stat_wbuf_copied(void); Need to change both .c and .h. Author: Prashanth Sreenivasa Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Robert Mustacchi Approved by: Richard Lowe Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Sun Mar 26 16:46:39 2017 (r315988) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu.c Sun Mar 26 16:49:20 2017 (r315989) @@ -1124,13 +1124,13 @@ xuio_stat_fini(void) } void -xuio_stat_wbuf_copied() +xuio_stat_wbuf_copied(void) { XUIOSTAT_BUMP(xuiostat_wbuf_copied); } void -xuio_stat_wbuf_nocopy() +xuio_stat_wbuf_nocopy(void) { XUIOSTAT_BUMP(xuiostat_wbuf_nocopy); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Sun Mar 26 16:46:39 2017 (r315988) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h Sun Mar 26 16:49:20 2017 (r315989) @@ -753,8 +753,8 @@ int dmu_xuio_add(struct xuio *uio, struc int dmu_xuio_cnt(struct xuio *uio); struct arc_buf *dmu_xuio_arcbuf(struct xuio *uio, int i); void dmu_xuio_clear(struct xuio *uio, int i); -void xuio_stat_wbuf_copied(); -void xuio_stat_wbuf_nocopy(); +void xuio_stat_wbuf_copied(void); +void xuio_stat_wbuf_nocopy(void); extern boolean_t zfs_prefetch_disable; extern int zfs_max_recordsize; From owner-svn-src-all@freebsd.org Sun Mar 26 17:22:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CACAD1F312; Sun, 26 Mar 2017 17:22:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C6581D23; Sun, 26 Mar 2017 17:22:46 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QHMjQF088154; Sun, 26 Mar 2017 17:22:45 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QHMjVE088151; Sun, 26 Mar 2017 17:22:45 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703261722.v2QHMjVE088151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 26 Mar 2017 17:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315990 - in head: contrib/top usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 17:22:46 -0000 Author: rwatson Date: Sun Mar 26 17:22:44 2017 New Revision: 315990 URL: https://svnweb.freebsd.org/changeset/base/315990 Log: Provide proper contemporary function prototypes for many of the functions implemented in top(1), rather than relying on K&R prototypes, which can cause problems on targets where there are multiple incompatible calling conventions and the compiler requires argument information to select the correct one. (There's a bit more to do here, since it looks like top(1) also sometimes provides prototypes for various curses functions rather than relying on the header file...) Sponsored by: DARPA, AFRL MFC after: 1 week Modified: head/contrib/top/machine.h head/contrib/top/top.c head/usr.bin/top/machine.c Modified: head/contrib/top/machine.h ============================================================================== --- head/contrib/top/machine.h Sun Mar 26 16:49:20 2017 (r315989) +++ head/contrib/top/machine.h Sun Mar 26 17:22:44 2017 (r315990) @@ -81,14 +81,15 @@ struct process_select /* routines defined by the machine dependent module */ -char *format_header(); -char *format_next_process(); +char *format_header(char *uname_field); +char *format_next_process(caddr_t handle, char *(*get_userid)(int), + int flags); void toggle_pcpustats(void); void get_system_info(struct system_info *si); int machine_init(struct statics *statics, char do_unames); int proc_owner(int pid); /* non-int routines typically used by the machine dependent module */ -char *printable(); +char *printable(char *string); #endif /* MACHINE_H */ Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Sun Mar 26 16:49:20 2017 (r315989) +++ head/contrib/top/top.c Sun Mar 26 17:22:44 2017 (r315990) @@ -112,7 +112,8 @@ extern int io_compare(); #endif time_t time(); -caddr_t get_process_info(); +caddr_t get_process_info(struct system_info *si, struct process_select *sel, + int (*compare)(const void *, const void *)); /* different routines for displaying the user's identification */ /* (values assigned to get_userid) */ @@ -120,16 +121,16 @@ char *username(); char *itoa7(); /* pointers to display routines */ -void (*d_loadave)() = i_loadave; -void (*d_procstates)() = i_procstates; -void (*d_cpustates)() = i_cpustates; -void (*d_memory)() = i_memory; -void (*d_arc)() = i_arc; -void (*d_carc)() = i_carc; -void (*d_swap)() = i_swap; -void (*d_message)() = i_message; -void (*d_header)() = i_header; -void (*d_process)() = i_process; +void (*d_loadave)(int mpid, double *avenrun) = i_loadave; +void (*d_procstates)(int total, int *brkdn) = i_procstates; +void (*d_cpustates)(int *states) = i_cpustates; +void (*d_memory)(int *stats) = i_memory; +void (*d_arc)(int *stats) = i_arc; +void (*d_carc)(int *stats) = i_carc; +void (*d_swap)(int *stats) = i_swap; +void (*d_message)(void) = i_message; +void (*d_header)(char *text) = i_header; +void (*d_process)(int line, char *thisline) = i_process; void reset_display(void); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sun Mar 26 16:49:20 2017 (r315989) +++ head/usr.bin/top/machine.c Sun Mar 26 17:22:44 2017 (r315990) @@ -241,7 +241,7 @@ static int pageshift; /* log base 2 of ((kip)->ki_swrss > (kip)->ki_rssize ? (kip)->ki_swrss - (kip)->ki_rssize : 0) /* useful externals */ -long percentages(); +long percentages(int cnt, int *out, long *new, long *old, long *diffs); #ifdef ORDER /* From owner-svn-src-all@freebsd.org Sun Mar 26 17:46:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 17:59:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66301D1E2D9; Sun, 26 Mar 2017 17:59:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 359281088; Sun, 26 Mar 2017 17:59:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QHxpGd001120; Sun, 26 Mar 2017 17:59:51 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QHxpTX001119; Sun, 26 Mar 2017 17:59:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703261759.v2QHxpTX001119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 26 Mar 2017 17:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315992 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 17:59:52 -0000 Author: avos Date: Sun Mar 26 17:59:51 2017 New Revision: 315992 URL: https://svnweb.freebsd.org/changeset/base/315992 Log: iwn: fix error handling for one well-known corner case. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 17:46:42 2017 (r315991) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 17:59:51 2017 (r315992) @@ -4739,9 +4739,19 @@ iwn_tx_cmd(struct iwn_softc *sc, struct error = bus_dmamap_load_mbuf_sg(ring->data_dmat, data->map, m, segs, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { + /* XXX fix this */ + /* + * NB: Do not return error; + * original mbuf does not exist anymore. + */ device_printf(sc->sc_dev, - "%s: can't map mbuf (error %d)\n", __func__, error); - return error; + "%s: can't map mbuf (error %d)\n", + __func__, error); + if_inc_counter(ni->ni_vap->iv_ifp, + IFCOUNTER_OERRORS, 1); + ieee80211_free_node(ni); + m_freem(m); + return 0; } } From owner-svn-src-all@freebsd.org Sun Mar 26 18:01:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:04:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:06:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:06:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C70D1E66D; Sun, 26 Mar 2017 18:06:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D507019FD; Sun, 26 Mar 2017 18:06:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QI6pOF005302; Sun, 26 Mar 2017 18:06:51 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QI6pXZ005301; Sun, 26 Mar 2017 18:06:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703261806.v2QI6pXZ005301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 26 Mar 2017 18:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315996 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:06:53 -0000 Author: avos Date: Sun Mar 26 18:06:51 2017 New Revision: 315996 URL: https://svnweb.freebsd.org/changeset/base/315996 Log: iwn: fix debug message Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 18:06:22 2017 (r315995) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 18:06:51 2017 (r315996) @@ -3292,8 +3292,8 @@ iwn5000_rx_calib_results(struct iwn_soft /* Runtime firmware should not send such a notification. */ if (sc->sc_flags & IWN_FLAG_CALIB_DONE){ - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received after clib done\n", - __func__); + DPRINTF(sc, IWN_DEBUG_TRACE, + "->%s received after calib done\n", __func__); return; } len = (le32toh(desc->len) & 0x3fff) - 4; From owner-svn-src-all@freebsd.org Sun Mar 26 18:08:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:08:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:11:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:12:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-all@freebsd.org Sun Mar 26 18:46:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B31CAD1F429; Sun, 26 Mar 2017 18:46:37 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72E69109A; Sun, 26 Mar 2017 18:46:37 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QIkaLG021906; Sun, 26 Mar 2017 18:46:36 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QIkZEq021897; Sun, 26 Mar 2017 18:46:35 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703261846.v2QIkZEq021897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 26 Mar 2017 18:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316001 - in head/sys: amd64/include arm/include arm64/include ddb i386/include mips/include powerpc/include riscv/include sparc64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 18:46:37 -0000 Author: bde Date: Sun Mar 26 18:46:35 2017 New Revision: 316001 URL: https://svnweb.freebsd.org/changeset/base/316001 Log: Fix printing of negative offsets (typically from frame pointers) again. I fixed this in 1997, but the fix was over-engineered and fragile and was broken in 2003 if not before. i386 parameters were copied to 8 other arches verbatim, mostly after they stopped working on i386, and mostly without the large comment saying how the values were chosen on i386. powerpc has a non-verbatim copy which just changes the uncritical parameter and seems to add a sign extension bug to it. Just treat negative offsets as offsets if they are no more negative than -db_offset_max (default -64K), and remove all the broken parameters. -64K is not very negative, but it is enough for frame and stack pointer offsets since kernel stacks are small. The over-engineering was mainly to go more negative than -64K for the negative offset format, without affecting printing for more than a single address. Addresses in the top 64K of a (full 32-bit or 64-bit) address space are now printed less well, but there aren't many interesting ones. For arches that have many interesting ones very near the top (e.g., 68k has interrupt vectors there), there would be no good limit for the negative offset format and -64K is a good as anything. Modified: head/sys/amd64/include/db_machdep.h head/sys/arm/include/db_machdep.h head/sys/arm64/include/db_machdep.h head/sys/ddb/db_sym.c head/sys/i386/include/db_machdep.h head/sys/mips/include/db_machdep.h head/sys/powerpc/include/db_machdep.h head/sys/riscv/include/db_machdep.h head/sys/sparc64/include/db_machdep.h Modified: head/sys/amd64/include/db_machdep.h ============================================================================== --- head/sys/amd64/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/amd64/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -81,19 +81,4 @@ do { \ #define inst_load(ins) 0 #define inst_store(ins) 0 -/* - * There no interesting addresses below _kstack = 0xefbfe000. There - * are small absolute values for GUPROF, but we don't want to see them. - * Treat "negative" addresses below _kstack as non-small to allow for - * future reductions of _kstack and to avoid sign extension problems. - * - * There is one interesting symbol above -db_maxoff = 0xffff0000, - * namely _APTD = 0xfffff000. Accepting this would mess up the - * printing of small negative offsets. The next largest symbol is - * _APTmap = 0xffc00000. Accepting this is OK (unless db_maxoff is - * set to >= 0x400000 - (max stack offset)). - */ -#define DB_SMALL_VALUE_MAX 0x7fffffff -#define DB_SMALL_VALUE_MIN (-0x400001) - #endif /* !_MACHINE_DB_MACHDEP_H_ */ Modified: head/sys/arm/include/db_machdep.h ============================================================================== --- head/sys/arm/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/arm/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -89,9 +89,6 @@ typedef int db_expr_t; #define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + INSN_SIZE)) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 32 int db_validate_address(vm_offset_t); Modified: head/sys/arm64/include/db_machdep.h ============================================================================== --- head/sys/arm64/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/arm64/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -118,9 +118,6 @@ typedef long db_expr_t; #define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + 4)) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 64 #endif /* !_MACHINE_DB_MACHDEP_H_ */ Modified: head/sys/ddb/db_sym.c ============================================================================== --- head/sys/ddb/db_sym.c Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/ddb/db_sym.c Sun Mar 26 18:46:35 2017 (r316001) @@ -432,19 +432,16 @@ db_printsym(db_expr_t off, db_strategy_t db_expr_t d; char *filename; const char *name; - db_expr_t value; int linenum; c_db_sym_t cursym; - cursym = db_search_symbol(off, strategy, &d); - db_symbol_values(cursym, &name, &value); - if (name == NULL) - value = off; - if (value >= DB_SMALL_VALUE_MIN && value <= DB_SMALL_VALUE_MAX) { + if (off < 0 && off >= -db_maxoff) { db_printf("%+#lr", (long)off); return; } - if (name == NULL || d >= (unsigned long)db_maxoff) { + cursym = db_search_symbol(off, strategy, &d); + db_symbol_values(cursym, &name, NULL); + if (name == NULL || d >= (db_addr_t)db_maxoff) { db_printf("%#lr", (unsigned long)off); return; } Modified: head/sys/i386/include/db_machdep.h ============================================================================== --- head/sys/i386/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/i386/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -83,21 +83,6 @@ do { \ #define inst_load(ins) 0 #define inst_store(ins) 0 -/* - * There no interesting addresses below _kstack = 0xefbfe000. There - * are small absolute values for GUPROF, but we don't want to see them. - * Treat "negative" addresses below _kstack as non-small to allow for - * future reductions of _kstack and to avoid sign extension problems. - * - * There is one interesting symbol above -db_maxoff = 0xffff0000, - * namely _APTD = 0xfffff000. Accepting this would mess up the - * printing of small negative offsets. The next largest symbol is - * _APTmap = 0xffc00000. Accepting this is OK (unless db_maxoff is - * set to >= 0x400000 - (max stack offset)). - */ -#define DB_SMALL_VALUE_MAX 0x7fffffff -#define DB_SMALL_VALUE_MIN (-0x400001) - int db_segsize(struct trapframe *tfp); #endif /* !_MACHINE_DB_MACHDEP_H_ */ Modified: head/sys/mips/include/db_machdep.h ============================================================================== --- head/sys/mips/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/mips/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -87,9 +87,6 @@ db_addr_t next_instr_address(db_addr_t, #define inst_load(i) (db_inst_type(i) == IT_LOAD) #define inst_store(i) (db_inst_type(i) == IT_STORE) -#define DB_SMALL_VALUE_MAX 0x7fffffff -#define DB_SMALL_VALUE_MIN (-0x400001) - int db_inst_type(int); db_addr_t branch_taken(int inst, db_addr_t pc); int32_t kdbpeek(int *); Modified: head/sys/powerpc/include/db_machdep.h ============================================================================== --- head/sys/powerpc/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/powerpc/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -87,7 +87,4 @@ typedef intptr_t db_expr_t; /* expressio #define inst_load(ins) 0 #define inst_store(ins) 0 -#define DB_SMALL_VALUE_MAX (KERNBASE-1) -#define DB_SMALL_VALUE_MIN (-0x40001) - #endif /* _POWERPC_DB_MACHDEP_H_ */ Modified: head/sys/riscv/include/db_machdep.h ============================================================================== --- head/sys/riscv/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/riscv/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -83,9 +83,6 @@ typedef long db_expr_t; #define next_instr_address(pc, bd) ((bd) ? (pc) : ((pc) + 4)) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 64 #endif /* !_MACHINE_DB_MACHDEP_H_ */ Modified: head/sys/sparc64/include/db_machdep.h ============================================================================== --- head/sys/sparc64/include/db_machdep.h Sun Mar 26 18:12:50 2017 (r316000) +++ head/sys/sparc64/include/db_machdep.h Sun Mar 26 18:46:35 2017 (r316001) @@ -61,9 +61,6 @@ typedef long db_expr_t; #define inst_load(ins) (0) #define inst_store(ins) (0) -#define DB_SMALL_VALUE_MAX (0x7fffffff) -#define DB_SMALL_VALUE_MIN (-0x40001) - #define DB_ELFSIZE 64 #endif /* !_MACHINE_DB_MACHDEP_H_ */ From owner-svn-src-all@freebsd.org Sun Mar 26 19:47:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5929BD1E43F; Sun, 26 Mar 2017 19:47:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F571FE3; Sun, 26 Mar 2017 19:47:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QJlihu049167; Sun, 26 Mar 2017 19:47:44 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QJlh5A049163; Sun, 26 Mar 2017 19:47:43 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201703261947.v2QJlh5A049163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 26 Mar 2017 19:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316002 - in head/usr.bin/diff: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 19:47:45 -0000 Author: jilles Date: Sun Mar 26 19:47:43 2017 New Revision: 316002 URL: https://svnweb.freebsd.org/changeset/base/316002 Log: diff: Show nanoseconds in -u/-c header line. Show nanoseconds in the -u/-c header line. The present portability conditionals cannot handle the POSIX standard st_mtim, so remove them and unconditionally use st_mtim. PR: 218018 Reported by: jbeich Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10145 Added: head/usr.bin/diff/tests/header_ns.out (contents, props changed) Modified: head/usr.bin/diff/diffreg.c head/usr.bin/diff/tests/Makefile head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Sun Mar 26 18:46:35 2017 (r316001) +++ head/usr.bin/diff/diffreg.c Sun Mar 26 19:47:43 2017 (r316002) @@ -94,12 +94,6 @@ __FBSDID("$FreeBSD$"); #define _PATH_PR "/usr/bin/pr" -#ifdef ST_MTIM_NSEC -# define TIMESPEC_NS(timespec) ((timespec).ST_MTIM_NSEC) -#else -# define TIMESPEC_NS(timespec) 0 -#endif - /* * diff - compare two files. */ @@ -1615,14 +1609,10 @@ print_header(const char *file1, const ch char end1[10]; char end2[10]; struct tm tm1, tm2, *tm_ptr1, *tm_ptr2; - int nsec1 = TIMESPEC_NS (stb1.st_mtime); - int nsec2 = TIMESPEC_NS (stb2.st_mtime); + int nsec1 = stb1.st_mtim.tv_nsec; + int nsec2 = stb2.st_mtim.tv_nsec; -#ifdef ST_MTIM_NSEC - time_format = "%Y-%m-%d %H:%M:%S.%N"; -#else - time_format = "%Y-%m-%d %H:%M:%S"; -#endif + time_format = "%Y-%m-%d %H:%M:%S"; if (cflag) time_format = "%c"; Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Sun Mar 26 18:46:35 2017 (r316001) +++ head/usr.bin/diff/tests/Makefile Sun Mar 26 19:47:43 2017 (r316002) @@ -20,7 +20,8 @@ ${PACKAGE}FILES+= \ unified_p.out \ unified_c9999.out \ unified_9999.out \ - header.out + header.out \ + header_ns.out NETBSD_ATF_TESTS_SH+= netbsd_diff_test Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Sun Mar 26 18:46:35 2017 (r316001) +++ head/usr.bin/diff/tests/diff_test.sh Sun Mar 26 19:47:43 2017 (r316002) @@ -3,6 +3,7 @@ atf_test_case simple atf_test_case unified atf_test_case header +atf_test_case header_ns simple_body() { @@ -58,9 +59,21 @@ header_body() diff -u empty hello } +header_ns_body() +{ + export TZ=UTC + : > empty + echo hello > hello + touch -d 2015-04-03T01:02:03.123456789 empty + touch -d 2016-12-22T11:22:33.987654321 hello + atf_check -o "file:$(atf_get_srcdir)/header_ns.out" -s eq:1 \ + diff -u empty hello +} + atf_init_test_cases() { atf_add_test_case simple atf_add_test_case unified atf_add_test_case header + atf_add_test_case header_ns } Added: head/usr.bin/diff/tests/header_ns.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/header_ns.out Sun Mar 26 19:47:43 2017 (r316002) @@ -0,0 +1,4 @@ +--- empty 2015-04-03 01:02:03.123456789 +0000 ++++ hello 2016-12-22 11:22:33.987654321 +0000 +@@ -0,0 +1 @@ ++hello From owner-svn-src-all@freebsd.org Sun Mar 26 20:15:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B95BD1EF80; Sun, 26 Mar 2017 20:15:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3355812F7; Sun, 26 Mar 2017 20:15:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QKF98g062427; Sun, 26 Mar 2017 20:15:09 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QKF9k9062425; Sun, 26 Mar 2017 20:15:09 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703262015.v2QKF9k9062425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 26 Mar 2017 20:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316003 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 20:15:10 -0000 Author: rwatson Date: Sun Mar 26 20:15:08 2017 New Revision: 316003 URL: https://svnweb.freebsd.org/changeset/base/316003 Log: Add a man page for the kernel's dynamic per-CPU memory allocator. MFC after: 3 days Added: head/share/man/man9/dpcpu.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Mar 26 19:47:43 2017 (r316002) +++ head/share/man/man9/Makefile Sun Mar 26 20:15:08 2017 (r316003) @@ -116,6 +116,7 @@ MAN= accept_filter.9 \ disk.9 \ dnv.9 \ domain.9 \ + dpcpu.9 \ drbr.9 \ driver.9 \ DRIVER_MODULE.9 \ Added: head/share/man/man9/dpcpu.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/dpcpu.9 Sun Mar 26 20:15:08 2017 (r316003) @@ -0,0 +1,163 @@ +.\"- +.\" Copyright (c) 2017 Robert N. M. Watson +.\" 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 AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd March 26, 2017 +.Dt DPCPU 9 +.Os +.Sh NAME +.Nm dpcpu +.Nd Kernel Dynamic Per-CPU Memory Allocator +.Sh SYNOPSIS +.In sys/pcpu.h +.Ss Per-CPU Variable Definition and Declaration +.Fn DPCPU_DEFINE "type" "name" +.Fn DPCPU_DECLARE "type" "name" +.Ss Current CPU Accessor Functions +.Fn DPCPU_PTR "name" +.Fn DPCPU_GET "name" +.Fn DPCPU_SET "name" "value" +.Ss Named CPU Accessor Functions +.Fn DPCPU_ID_PTR "cpu" "name" +.Fn DPCPU_ID_GET "cpu" "name" +.Fn DPCPU_ID_SET "cpu" "name" "value" +.Sh DESCRIPTION +.Nm +instantiates one instance of a global variable with each CPU in the system. +Dynamically allocated per-CPU variables are defined using +.Fn DPCPU_DEFINE , +which defines a variable of name +.Ar name +and type +.Ar type . +Arbitrary C types may be used, including structures and arrays. +If no initialization is provided, then each per-CPU instance of the variable +will be zero-filled (i.e., as though allocated in BSS): +.Bd -literal -offset 1234 +DPCPU_DEFINE(int, fooint); +.Ed +.Pp +Values may also be initialized statically with the definition, causing each +per-CPU instance to be initialized with the value: +.Bd -literal -offset 1234 +DPCPU_DEFINE(int, fooint) = 1; +.Ed +.Pp +Syntactically, the definition may be treated as a variable. +For example, a dynamic per-CPU variable may be declared as +.Dv static : +.Bd -literal -offset 1234 +static DPCPU_DEFINE(int, fooint); +.Ed +.Pp +.Fn DPCPU_DECLARE +produces a declaration of the per-CPU variable suitable for use in header +files. +.Pp +The current CPU's variable instance can be accessed via +.Nm DPCPU_PTR +(which returns a pointer to the per-CPU instance), +.Nm DPCPU_GET +(which retrieves the value of the per-CPU instance), +and +.Nm DPCPU_SET +(which sets the value of the per-CPU instance). +.Pp +Instances of variables associated with specific CPUs can be accessed via the +.Nm DPCPU_ID_PTR , +.Nm DPCPU_ID_GET , +and +.Nm DPGPU_ID_SET +accessor functions, which accept an additional CPU ID argument, +.Ar cpu . +.Ss Synchronization +In addition to the ordinary synchronization concerns associated with global +variables, which may imply the use of +.Xr atomic 9 , +.Xr mutex 9 , +or other kernel synchronization primitives, it is further the case that +thread migration could dynamically change the instance of a variable being +accessed by a thread between operations. +This requires additional care when reasoning about and protecting per-CPU +variables. +.Pp +For example, it may be desirable to protect access using +.Xr critical_section 9 +to prevent both preemption and migration during use. +Alternatively, it may be desirable to cache the CPU ID at the start of a +sequence of accesses, using suitable synchronization to make non-atomic +sequences safe in the presence of migration. +.Bd -literal -offset 1234 +static DPCPU_DEFINE(int, foo_int); +static DPCPU_DEFINE(struct mutex, foo_lock); + +void +foo_int_increment(void) +{ + int cpu, value; + + /* Safe as atomic access. */ + atomic_add_int(DPCPU_PTR(foo_int), 1); + + /* + * Protect with a critical section, which prevents preemption + * and migration. However, access to instances from remote CPUs + * is not safe, as critical sections prevent concurrent access + * only from the current CPU. + */ + critical_enter(); + value = DPCPU_GET(foo_int); + value++; + DPCPU_SET(foo_int, value); + critical_exit(); + + /* + * Protect with a per-CPU mutex, tolerating migration, but + * potentially accessing the variable from multiple CPUs if + * migration occurs after reading curcpu. Remote access to a + * per-CPU variable is safe as long as the correct mutex is + * acquired. + */ + cpu = curcpu; + mtx_lock(DPCPU_ID_PTR(cpu, foo_lock)); + value = DPCPU_ID_GET(cpu, foo_int); + value++; + DPCPU_ID_SET(cpu, foo_int); + mtx_unlock(DPCPU_ID_PTR(cpu, foo_lock)); +} +.Ed +.Sh SEE ALSO +.Xr atomic 9 , +.Xr critical_enter 9 , +.Xr mutex 9 +.Sh HISTORY +.Nm +was first introduced by +.An Jeff Roberson +in +.Fx 8.0 . +This manual page was written by +.An Robert N. M. Watson. From owner-svn-src-all@freebsd.org Sun Mar 26 20:24:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EB47D1F20F; Sun, 26 Mar 2017 20:24:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 336EC19F5; Sun, 26 Mar 2017 20:24:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QKOR6E067070; Sun, 26 Mar 2017 20:24:27 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QKORt5067069; Sun, 26 Mar 2017 20:24:27 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703262024.v2QKORt5067069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 26 Mar 2017 20:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316004 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 20:24:28 -0000 Author: rwatson Date: Sun Mar 26 20:24:27 2017 New Revision: 316004 URL: https://svnweb.freebsd.org/changeset/base/316004 Log: Slightly improve consistency of "fooint" vs "foo_int" in DPCPU(9) examples. MFC after: 3 days Modified: head/share/man/man9/dpcpu.9 Modified: head/share/man/man9/dpcpu.9 ============================================================================== --- head/share/man/man9/dpcpu.9 Sun Mar 26 20:15:08 2017 (r316003) +++ head/share/man/man9/dpcpu.9 Sun Mar 26 20:24:27 2017 (r316004) @@ -57,20 +57,20 @@ Arbitrary C types may be used, including If no initialization is provided, then each per-CPU instance of the variable will be zero-filled (i.e., as though allocated in BSS): .Bd -literal -offset 1234 -DPCPU_DEFINE(int, fooint); +DPCPU_DEFINE(int, foo_int); .Ed .Pp Values may also be initialized statically with the definition, causing each per-CPU instance to be initialized with the value: .Bd -literal -offset 1234 -DPCPU_DEFINE(int, fooint) = 1; +DPCPU_DEFINE(int, foo_int) = 1; .Ed .Pp Syntactically, the definition may be treated as a variable. For example, a dynamic per-CPU variable may be declared as .Dv static : .Bd -literal -offset 1234 -static DPCPU_DEFINE(int, fooint); +static DPCPU_DEFINE(int, foo_int); .Ed .Pp .Fn DPCPU_DECLARE From owner-svn-src-all@freebsd.org Sun Mar 26 20:36:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFADDD1F5B9; Sun, 26 Mar 2017 20:36:37 +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 BE60A115B; Sun, 26 Mar 2017 20:36:37 +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 v2QKaawd071461; Sun, 26 Mar 2017 20:36:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QKaZAD071444; Sun, 26 Mar 2017 20:36:35 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201703262036.v2QKaZAD071444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 26 Mar 2017 20:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316005 - in head/contrib/compiler-rt/lib/builtins: . arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 20:36:38 -0000 Author: dim Date: Sun Mar 26 20:36:35 2017 New Revision: 316005 URL: https://svnweb.freebsd.org/changeset/base/316005 Log: Revert r314907, and pull in r298713 from upstream compiler-rt trunk (by Weiming Zhao): builtins: Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA. Summary: Value of __ARM_ARCH_ISA_THUMB isn't based on the actual compilation mode (-mthumb, -marm), it reflect's capability of given CPU. Due to this: - use __tbumb__ and __thumb2__ insteand of __ARM_ARCH_ISA_THUMB - use '.thumb' directive consistently in all affected files - decorate all thumb functions using DEFINE_COMPILERRT_THUMB_FUNCTION() --------- Note: This patch doesn't fix broken Thumb1 variant of __udivsi3 ! Reviewers: weimingz, rengolin, compnerd Subscribers: aemerson, dim Differential Revision: https://reviews.llvm.org/D30938 Discussed with: mmel X-MFC-With: r314564 Modified: head/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S head/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S head/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S head/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S head/contrib/compiler-rt/lib/builtins/arm/clzdi2.S head/contrib/compiler-rt/lib/builtins/arm/clzsi2.S head/contrib/compiler-rt/lib/builtins/arm/comparesf2.S head/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S head/contrib/compiler-rt/lib/builtins/arm/divsi3.S head/contrib/compiler-rt/lib/builtins/arm/modsi3.S head/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S head/contrib/compiler-rt/lib/builtins/arm/udivsi3.S head/contrib/compiler-rt/lib/builtins/arm/umodsi3.S head/contrib/compiler-rt/lib/builtins/assembly.h Modified: head/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/aeabi_idivmod.S Sun Mar 26 20:36:35 2017 (r316005) @@ -20,16 +20,25 @@ #endif .syntax unified + .syntax unified + .text +#if defined(USE_THUMB_PROLOGUE) + .thumb +#endif .p2align 2 +#if defined(USE_THUMB_PROLOGUE) +DEFINE_COMPILERRT_THUMB_FUNCTION(__aeabi_idivmod) +#else DEFINE_COMPILERRT_FUNCTION(__aeabi_idivmod) -#if __ARM_ARCH_ISA_THUMB == 1 +#endif +#if defined(USE_THUMB_1) push {r0, r1, lr} bl SYMBOL_NAME(__divsi3) pop {r1, r2, r3} // now r0 = quot, r1 = num, r2 = denom muls r2, r2, r0 // r2 = quot * denom subs r1, r1, r2 JMP (r3) -#else +#else // defined(USE_THUMB_1) push { lr } sub sp, sp, #4 mov r2, sp @@ -42,7 +51,7 @@ DEFINE_COMPILERRT_FUNCTION(__aeabi_idivm ldr r1, [sp] add sp, sp, #4 pop { pc } -#endif // __ARM_ARCH_ISA_THUMB == 1 +#endif // defined(USE_THUMB_1) END_COMPILERRT_FUNCTION(__aeabi_idivmod) NO_EXEC_STACK_DIRECTIVE Modified: head/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/aeabi_uidivmod.S Sun Mar 26 20:36:35 2017 (r316005) @@ -21,8 +21,16 @@ #endif .syntax unified + .text +#if defined(USE_THUMB_PROLOGUE) + .thumb +#endif .p2align 2 +#if defined(USE_THUMB_PROLOGUE) +DEFINE_COMPILERRT_THUMB_FUNCTION(__aeabi_uidivmod) +#else DEFINE_COMPILERRT_FUNCTION(__aeabi_uidivmod) +#endif #if __ARM_ARCH_ISA_THUMB == 1 cmp r0, r1 bcc LOCAL_LABEL(case_denom_larger) Modified: head/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/bswapdi2.S Sun Mar 26 20:36:35 2017 (r316005) @@ -11,7 +11,7 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -21,7 +21,7 @@ // Reverse all the bytes in a 64-bit integer. // .p2align 2 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__bswapdi2) #else DEFINE_COMPILERRT_FUNCTION(__bswapdi2) Modified: head/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/bswapsi2.S Sun Mar 26 20:36:35 2017 (r316005) @@ -11,7 +11,7 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -21,7 +21,7 @@ // Reverse all the bytes in a 32-bit integer. // .p2align 2 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__bswapsi2) #else DEFINE_COMPILERRT_FUNCTION(__bswapsi2) Modified: head/contrib/compiler-rt/lib/builtins/arm/clzdi2.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/clzdi2.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/clzdi2.S Sun Mar 26 20:36:35 2017 (r316005) @@ -15,13 +15,13 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif .p2align 2 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__clzdi2) #else DEFINE_COMPILERRT_FUNCTION(__clzdi2) Modified: head/contrib/compiler-rt/lib/builtins/arm/clzsi2.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/clzsi2.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/clzsi2.S Sun Mar 26 20:36:35 2017 (r316005) @@ -15,12 +15,12 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif .p2align 2 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__clzsi2) #else DEFINE_COMPILERRT_FUNCTION(__clzsi2) Modified: head/contrib/compiler-rt/lib/builtins/arm/comparesf2.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/comparesf2.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/comparesf2.S Sun Mar 26 20:36:35 2017 (r316005) @@ -38,15 +38,20 @@ //===----------------------------------------------------------------------===// #include "../assembly.h" -.syntax unified -#if __ARM_ARCH_ISA_THUMB == 2 -.thumb + .syntax unified + .text +#if defined(USE_THUMB_PROLOGUE) + .thumb #endif @ int __eqsf2(float a, float b) .p2align 2 +#if defined(USE_THUMB_PROLOGUE) +DEFINE_COMPILERRT_THUMB_FUNCTION(__eqsf2) +#else DEFINE_COMPILERRT_FUNCTION(__eqsf2) +#endif #if defined(COMPILER_RT_ARMHF_TARGET) vmov r0, s0 vmov r1, s1 @@ -67,7 +72,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // flag if both a and b are zero (of either sign). The shift of r3 doesn't // effect this at all, but it *does* make sure that the C flag is clear for // the subsequent operations. -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) lsrs r6, r3, #1 orrs r6, r2, r6 #else @@ -75,7 +80,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) #endif // Next, we check if a and b have the same or different signs. If they have // opposite signs, this eor will set the N flag. -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) beq 1f movs r6, r0 eors r6, r1 @@ -89,7 +94,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // ignoring NaNs for now), this subtract will zero out r0. If they have the // same sign, the flags are updated as they would be for a comparison of the // absolute values of a and b. -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) bmi 1f subs r0, r2, r3 1: @@ -108,7 +113,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // still clear from the shift argument in orrs; if a is positive and b // negative, this places 0 in r0; if a is negative and b positive, -1 is // placed in r0. -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) bhs 1f // Here if a and b have the same sign and absA < absB, the result is thus // b < 0 ? 1 : -1. Same if a and b have the opposite sign (ignoring Nan). @@ -127,7 +132,7 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // the sign of b in r0. Thus, if both are negative and a < b, -1 is placed // in r0, which is the desired result. Conversely, if both are positive // and a > b, zero is placed in r0. -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) bls 1f // Here both have the same sign and absA > absB. movs r0, #1 @@ -145,14 +150,14 @@ DEFINE_COMPILERRT_FUNCTION(__eqsf2) // If a == b, then the Z flag is set, so we can get the correct final value // into r0 by simply or'ing with 1 if Z is clear. // For Thumb-1, r0 contains -1 if a < b, 0 if a > b and 0 if a == b. -#if __ARM_ARCH_ISA_THUMB != 1 +#if defined(USE_THUMB_1) it ne orrne r0, r0, #1 #endif // Finally, we need to deal with NaNs. If either argument is NaN, replace // the value in r0 with 1. -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) LOCAL_LABEL(CHECK_NAN): movs r6, #0xff lsls r6, #24 @@ -180,7 +185,11 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__nesf2 @ int __gtsf2(float a, float b) .p2align 2 +#if defined(USE_THUMB) +DEFINE_COMPILERRT_THUMB_FUNCTION(__gtsf2) +#else DEFINE_COMPILERRT_FUNCTION(__gtsf2) +#endif // Identical to the preceding except in that we return -1 for NaN values. // Given that the two paths share so much code, one might be tempted to // unify them; however, the extra code needed to do so makes the code size @@ -189,7 +198,7 @@ DEFINE_COMPILERRT_FUNCTION(__gtsf2) vmov r0, s0 vmov r1, s1 #endif -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) push {r6, lr} lsls r2, r0, #1 lsls r3, r1, #1 @@ -254,7 +263,12 @@ DEFINE_COMPILERRT_FUNCTION_ALIAS(__gesf2 @ int __unordsf2(float a, float b) .p2align 2 +#if defined(USE_THUMB) +DEFINE_COMPILERRT_THUMB_FUNCTION(__unordsf2) +#else DEFINE_COMPILERRT_FUNCTION(__unordsf2) +#endif + #if defined(COMPILER_RT_ARMHF_TARGET) vmov r0, s0 vmov r1, s1 @@ -263,7 +277,7 @@ DEFINE_COMPILERRT_FUNCTION(__unordsf2) lsls r2, r0, #1 lsls r3, r1, #1 movs r0, #0 -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) movs r1, #0xff lsls r1, #24 cmp r2, r1 Modified: head/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/divmodsi4.S Sun Mar 26 20:36:35 2017 (r316005) @@ -23,7 +23,7 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -32,7 +32,7 @@ @ value is the quotient, the remainder is placed in the variable. .p2align 3 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__divmodsi4) #else DEFINE_COMPILERRT_FUNCTION(__divmodsi4) Modified: head/contrib/compiler-rt/lib/builtins/arm/divsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/divsi3.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/divsi3.S Sun Mar 26 20:36:35 2017 (r316005) @@ -20,10 +20,10 @@ #define CLEAR_FRAME_AND_RETURN \ pop {r4, r7, pc} - .syntax unified - .text -#if __ARM_ARCH_ISA_THUMB == 2 - .thumb + .syntax unified + .text +#if defined(USE_THUMB_PROLOGUE) + .thumb #endif .p2align 3 @@ -33,7 +33,7 @@ DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_idiv @ int __divsi3(int divident, int divisor) @ Calculate and return the quotient of the (signed) division. -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__divsi3) #else DEFINE_COMPILERRT_FUNCTION(__divsi3) @@ -72,7 +72,7 @@ ESTABLISH_FRAME // abs(a) / abs(b) bl SYMBOL_NAME(__udivsi3) // Apply sign of quotient to result and return. -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) asrs r4, #31 eors r0, r4 subs r0, r0, r4 Modified: head/contrib/compiler-rt/lib/builtins/arm/modsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/modsi3.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/modsi3.S Sun Mar 26 20:36:35 2017 (r316005) @@ -22,7 +22,7 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -30,7 +30,7 @@ @ Calculate and return the remainder of the (signed) division. .p2align 3 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__modsi3) #else DEFINE_COMPILERRT_FUNCTION(__modsi3) Modified: head/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/udivmodsi4.S Sun Mar 26 20:36:35 2017 (r316005) @@ -16,8 +16,7 @@ .syntax unified .text - -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -27,7 +26,7 @@ @ value is the quotient, the remainder is placed in the variable. .p2align 2 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__udivmodsi4) #else DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) @@ -67,7 +66,7 @@ DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) clz r3, r1 /* r0 >= r1 implies clz(r0) <= clz(r1), so ip <= r3. */ sub r3, r3, ip -# if __ARM_ARCH_ISA_THUMB == 2 +# if defined(USE_THUMB_2) adr ip, LOCAL_LABEL(div0block) + 1 sub ip, ip, r3, lsl #1 # else @@ -78,7 +77,7 @@ DEFINE_COMPILERRT_FUNCTION(__udivmodsi4) mov r3, #0 bx ip # else -# if __ARM_ARCH_ISA_THUMB == 2 +# if defined(USE_THUMB_2) # error THUMB mode requires CLZ or UDIV # endif str r4, [sp, #-8]! Modified: head/contrib/compiler-rt/lib/builtins/arm/udivsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/udivsi3.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/udivsi3.S Sun Mar 26 20:36:35 2017 (r316005) @@ -16,8 +16,7 @@ .syntax unified .text - -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -27,7 +26,7 @@ DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_uidi @ unsigned int __udivsi3(unsigned int divident, unsigned int divisor) @ Calculate and return the quotient of the (unsigned) division. -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__udivsi3) #else DEFINE_COMPILERRT_FUNCTION(__udivsi3) @@ -40,7 +39,7 @@ DEFINE_COMPILERRT_FUNCTION(__udivsi3) #else cmp r1, #1 bcc LOCAL_LABEL(divby0) -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) bne LOCAL_LABEL(num_neq_denom) JMP(lr) LOCAL_LABEL(num_neq_denom): @@ -49,7 +48,7 @@ LOCAL_LABEL(num_neq_denom): JMPc(lr, eq) #endif cmp r0, r1 -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) bhs LOCAL_LABEL(num_ge_denom) movs r0, #0 JMP(lr) @@ -81,7 +80,7 @@ LOCAL_LABEL(num_ge_denom): clz r3, r1 /* r0 >= r1 implies clz(r0) <= clz(r1), so ip <= r3. */ sub r3, r3, ip -# if __ARM_ARCH_ISA_THUMB == 2 +# if defined(USE_THUMB_2) adr ip, LOCAL_LABEL(div0block) + 1 sub ip, ip, r3, lsl #1 # else @@ -92,17 +91,17 @@ LOCAL_LABEL(num_ge_denom): mov r3, #0 bx ip # else /* No CLZ Feature */ -# if __ARM_ARCH_ISA_THUMB == 2 +# if defined(USE_THUMB_2) # error THUMB mode requires CLZ or UDIV # endif -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) # define BLOCK_SIZE 10 # else # define BLOCK_SIZE 12 # endif mov r2, r0 -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) mov ip, r0 adr r0, LOCAL_LABEL(div0block) adds r0, #1 @@ -111,7 +110,7 @@ LOCAL_LABEL(num_ge_denom): # endif lsrs r3, r2, #16 cmp r3, r1 -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) blo LOCAL_LABEL(skip_16) movs r2, r3 subs r0, r0, #(16 * BLOCK_SIZE) @@ -123,7 +122,7 @@ LOCAL_LABEL(skip_16): lsrs r3, r2, #8 cmp r3, r1 -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) blo LOCAL_LABEL(skip_8) movs r2, r3 subs r0, r0, #(8 * BLOCK_SIZE) @@ -135,7 +134,7 @@ LOCAL_LABEL(skip_8): lsrs r3, r2, #4 cmp r3, r1 -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) blo LOCAL_LABEL(skip_4) movs r2, r3 subs r0, r0, #(4 * BLOCK_SIZE) @@ -147,7 +146,7 @@ LOCAL_LABEL(skip_4): lsrs r3, r2, #2 cmp r3, r1 -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) blo LOCAL_LABEL(skip_2) movs r2, r3 subs r0, r0, #(2 * BLOCK_SIZE) @@ -158,7 +157,7 @@ LOCAL_LABEL(skip_2): # endif /* Last block, no need to update r2 or r3. */ -# if __ARM_ARCH_ISA_THUMB == 1 +# if defined(USE_THUMB_1) lsrs r3, r2, #1 cmp r3, r1 blo LOCAL_LABEL(skip_1) @@ -191,7 +190,7 @@ LOCAL_LABEL(divby0): JMP(lr) -#if __ARM_ARCH_ISA_THUMB == 1 +#if defined(USE_THUMB_1) #define block(shift) \ lsls r2, r1, IMM shift; \ cmp r0, r2; \ Modified: head/contrib/compiler-rt/lib/builtins/arm/umodsi3.S ============================================================================== --- head/contrib/compiler-rt/lib/builtins/arm/umodsi3.S Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/arm/umodsi3.S Sun Mar 26 20:36:35 2017 (r316005) @@ -16,7 +16,7 @@ .syntax unified .text -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) .thumb #endif @@ -24,7 +24,7 @@ @ Calculate and return the remainder of the (unsigned) division. .p2align 2 -#if __ARM_ARCH_ISA_THUMB == 2 +#if defined(USE_THUMB_PROLOGUE) DEFINE_COMPILERRT_THUMB_FUNCTION(__umodsi3) #else DEFINE_COMPILERRT_FUNCTION(__umodsi3) @@ -65,7 +65,7 @@ DEFINE_COMPILERRT_FUNCTION(__umodsi3) clz r3, r1 /* r0 >= r1 implies clz(r0) <= clz(r1), so ip <= r3. */ sub r3, r3, ip -# if __ARM_ARCH_ISA_THUMB == 2 +# if defined(USE_THUMB_2) adr ip, LOCAL_LABEL(div0block) + 1 sub ip, ip, r3, lsl #1 # else @@ -74,7 +74,7 @@ DEFINE_COMPILERRT_FUNCTION(__umodsi3) sub ip, ip, r3, lsl #3 bx ip # else -# if __ARM_ARCH_ISA_THUMB == 2 +# if defined(USE_THUMB_2) # error THUMB mode requires CLZ or UDIV # endif mov r2, r0 Modified: head/contrib/compiler-rt/lib/builtins/assembly.h ============================================================================== --- head/contrib/compiler-rt/lib/builtins/assembly.h Sun Mar 26 20:24:27 2017 (r316004) +++ head/contrib/compiler-rt/lib/builtins/assembly.h Sun Mar 26 20:36:35 2017 (r316005) @@ -75,9 +75,6 @@ #define __ARM_FEATURE_CLZ #endif -#undef __ARM_ARCH_ISA_THUMB -#define __ARM_ARCH_ISA_THUMB 0 - #ifdef ARM_HAS_BX #define JMP(r) bx r #define JMPc(r, c) bx##c r @@ -95,20 +92,35 @@ JMP(ip) #endif -#if __ARM_ARCH_ISA_THUMB == 2 +/* + * Determine actual [ARM][THUMB[1][2]] ISA using compiler predefined macros: + * - for '-mthumb -march=armv6' compiler defines '__thumb__' + * - for '-mthumb -march=armv7' compiler defines '__thumb__' and '__thumb2__' + */ +#if defined(__thumb2__) +#define USE_THUMB_2 1 +#elif defined(__thumb__) +#define USE_THUMB_1 1 +#endif + +#if defined(USE_THUMB_1) && defined(USE_THUMB_2) +#error "USE_THUMB_1 and USE_THUMB_2 can't be defined together." +#endif + +#if defined(USE_THUMB_1) || defined(USE_THUMB_1) +#define USE_THUMB_PROLOGUE 1 +#endif + +#if defined(USE_THUMB_2) #define IT(cond) it cond #define ITT(cond) itt cond +#define WIDE(op) op.w #else #define IT(cond) #define ITT(cond) -#endif - -#if __ARM_ARCH_ISA_THUMB == 2 -#define WIDE(op) op.w -#else #define WIDE(op) op #endif -#endif +#endif /* defined(__arm__) */ #define GLUE2(a, b) a##b #define GLUE(a, b) GLUE2(a, b) From owner-svn-src-all@freebsd.org Sun Mar 26 21:00:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2045BD1FF34; Sun, 26 Mar 2017 21:00:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id F38901127; Sun, 26 Mar 2017 21:00:53 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id D9EF146C23; Sun, 26 Mar 2017 17:00:49 -0400 (EDT) Date: Sun, 26 Mar 2017 22:00:49 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Chagin Dmitry cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ger... In-Reply-To: <20170325201943.GA16107@mordor.heemeyer.club> Message-ID: References: <201703251332.v2PDWS6O004270@repo.freebsd.org> <71317296-9981-4B0B-8243-5E4403CE8C62@gmail.com> <20170325201943.GA16107@mordor.heemeyer.club> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 21:00:54 -0000 On Sat, 25 Mar 2017, Chagin Dmitry wrote: >>> Author: dchagin >>> Date: Sat Mar 25 13:32:28 2017 >>> New Revision: 315948 >>> URL: https://svnweb.freebsd.org/changeset/base/315948 >>> >>> Log: >>> Update to tcsh 6.20.00 >> >> Relnotes: yes >> > don't think it matters, > >> Should this be MFCed? >> > I did not plan It may be helpful to us if the out-of-bounds fix in tcsh could be merged to 11.x to appear in a future release. If it's not too much trouble, anyway..? Robert From owner-svn-src-all@freebsd.org Sun Mar 26 21:14:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C6BED1F4E1; Sun, 26 Mar 2017 21:14:51 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10DA41D2F; Sun, 26 Mar 2017 21:14:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2QLEog7088232; Sun, 26 Mar 2017 21:14:50 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2QLEnov088221; Sun, 26 Mar 2017 21:14:49 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703262114.v2QLEnov088221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 26 Mar 2017 21:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316006 - in head: contrib/openbsm contrib/openbsm/bin contrib/openbsm/bin/audit contrib/openbsm/bin/auditd contrib/openbsm/bin/auditdistd contrib/openbsm/bin/auditfilterd contrib/openb... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 21:14:51 -0000 Author: rwatson Date: Sun Mar 26 21:14:49 2017 New Revision: 316006 URL: https://svnweb.freebsd.org/changeset/base/316006 Log: Merge OpenBSM 1.2-alpha5 from vendor branch to FreeBSD -CURRENT: - Add a new "qsize" parameter in audit_control and the getacqsize(3) API to query it, allowing to set the kernel's maximum audit queue length. - Add support to push a mapping between audit event names and event numbers into the kernel (where supported) using new A_GETEVENT and A_SETEVENT auditon(2) operations. - Add audit event identifiers for a number of new (and not-so-new) FreeBSD system calls including those for asynchronous I/O, thread management, SCTP, jails, multi-FIB support, and misc. POSIX interfaces such as posix_fallocate(2) and posix_fadvise(2). - On operating systems supporting Capsicum, auditreduce(1) and praudit(1) now run sandboxed. - Empty "flags" and "naflags" fields are now permitted in audit_control(5). Many thanks to Christian Brueffer for producing the OpenBSM release and importing/tagging it in the vendor branch. This release will allow improved auditing of a range of new FreeBSD functionality, as well as non-traditional events (e.g., fine-grained I/O auditing) not required by the Orange Book or Common Criteria. Obtained from: TrustedBSD Project Sponsored by: DARPA, AFRL MFC after: 3 weeks Modified: head/contrib/openbsm/.travis.yml head/contrib/openbsm/CREDITS head/contrib/openbsm/INSTALL head/contrib/openbsm/LICENSE head/contrib/openbsm/Makefile.in head/contrib/openbsm/NEWS head/contrib/openbsm/README head/contrib/openbsm/VERSION head/contrib/openbsm/aclocal.m4 head/contrib/openbsm/bin/Makefile.in head/contrib/openbsm/bin/audit/Makefile.in head/contrib/openbsm/bin/auditd/Makefile.in head/contrib/openbsm/bin/auditd/auditd.c head/contrib/openbsm/bin/auditdistd/Makefile.am head/contrib/openbsm/bin/auditdistd/Makefile.in head/contrib/openbsm/bin/auditdistd/pjdlog.c head/contrib/openbsm/bin/auditfilterd/Makefile.in head/contrib/openbsm/bin/auditreduce/Makefile.in head/contrib/openbsm/bin/auditreduce/auditreduce.c head/contrib/openbsm/bin/praudit/Makefile.in head/contrib/openbsm/bin/praudit/praudit.c head/contrib/openbsm/bsm/Makefile.in head/contrib/openbsm/bsm/auditd_lib.h head/contrib/openbsm/bsm/libbsm.h head/contrib/openbsm/config/config.h head/contrib/openbsm/config/config.h.in head/contrib/openbsm/config/depcomp head/contrib/openbsm/config/ltmain.sh head/contrib/openbsm/config/missing head/contrib/openbsm/configure head/contrib/openbsm/configure.ac head/contrib/openbsm/etc/audit_event head/contrib/openbsm/libauditd/Makefile.in head/contrib/openbsm/libauditd/auditd_lib.c head/contrib/openbsm/libbsm/Makefile.am head/contrib/openbsm/libbsm/Makefile.in head/contrib/openbsm/libbsm/au_control.3 head/contrib/openbsm/libbsm/au_token.3 head/contrib/openbsm/libbsm/bsm_control.c head/contrib/openbsm/libbsm/bsm_wrappers.c head/contrib/openbsm/m4/libtool.m4 head/contrib/openbsm/m4/ltoptions.m4 head/contrib/openbsm/m4/ltsugar.m4 head/contrib/openbsm/m4/ltversion.m4 head/contrib/openbsm/man/Makefile.in head/contrib/openbsm/man/audit_control.5 head/contrib/openbsm/man/auditon.2 head/contrib/openbsm/modules/Makefile.in head/contrib/openbsm/modules/auditfilter_noop/Makefile.in head/contrib/openbsm/sys/Makefile.in head/contrib/openbsm/sys/bsm/Makefile.in head/contrib/openbsm/sys/bsm/audit.h head/contrib/openbsm/sys/bsm/audit_kevents.h head/contrib/openbsm/sys/bsm/audit_record.h head/contrib/openbsm/test/Makefile.in head/contrib/openbsm/test/bsm/Makefile.in head/contrib/openbsm/tools/Makefile.in head/contrib/openbsm/tools/audump.c head/lib/libbsm/Makefile head/sys/bsm/audit.h head/sys/bsm/audit_kevents.h head/usr.sbin/praudit/Makefile Directory Properties: head/contrib/openbsm/ (props changed) Modified: head/contrib/openbsm/.travis.yml ============================================================================== --- head/contrib/openbsm/.travis.yml Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/.travis.yml Sun Mar 26 21:14:49 2017 (r316006) @@ -14,5 +14,7 @@ before_install: sudo apt-get -qq install byacc flex; elif [ $TRAVIS_OS_NAME == "osx" ]; then brew update; - brew install byacc flex; + brew install byacc flex openssl; + export CFLAGS="-I/usr/local/opt/openssl/include $CFLAGS"; + export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS"; fi Modified: head/contrib/openbsm/CREDITS ============================================================================== --- head/contrib/openbsm/CREDITS Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/CREDITS Sun Mar 26 21:14:49 2017 (r316006) @@ -35,6 +35,7 @@ the development of OpenBSM: Joel Dahl Ryan Steinmetz The FreeBSD Foundation + Brooks Davis In addition, Coverity, Inc.'s Prevent(tm) static analysis tool and Gimpel Software's FlexeLint tool were used to identify a number of bugs in the Modified: head/contrib/openbsm/INSTALL ============================================================================== --- head/contrib/openbsm/INSTALL Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/INSTALL Sun Mar 26 21:14:49 2017 (r316006) @@ -8,18 +8,23 @@ support is found. Typical builds will b ./configure make -If doing development work on OpenBSM with gcc, the following invocation of -configure is preferred in order to generate full compiler warnings and force -the compile to fail if a warning is found: - - CFLAGS="-Wall -Werror" ./configure - On Linux systems, OpenSSL headers may have to be installed to support encryption of on-the-wire audit streams using auditdistd; the following appears to work on Ubuntu: sudo apt-get install libssl-dev +Similarly, Mac OS X systems will require OpenSSL support: + + brew install openssl + +Mac OS X systems will similarly require setting CFLAGS and LDFLAGS to notify +configure of the location of the OpenSSL headers and library: + + CFLAGS=-I/usr/local/opt/openssl/include \ + LDFLAGS=-L/usr/local/opt/openssl/lib \ + configure + To install the library, binaries, and man pages, use: make install Modified: head/contrib/openbsm/LICENSE ============================================================================== --- head/contrib/openbsm/LICENSE Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/LICENSE Sun Mar 26 21:14:49 2017 (r316006) @@ -1,13 +1,13 @@ OpenBSM Copyrights and Licensing -OpenBSM is covered by a number of copyrights, with licenses being either two -or three clause BSD licenses. Individual file headers should be consulted +OpenBSM is covered by a number of copyrights, with licenses being either two- +or three-clause BSD licenses. Individual file headers should be consulted for copyrights on specific elements of the distribution. The following copyright and license are asserted over the OpenBSM distribution as a whole: - Copyright (c) 2005-2012 Robert N.M. Watson + Copyright (c) 2005-2016 Robert N.M. Watson All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/contrib/openbsm/Makefile.in ============================================================================== --- head/contrib/openbsm/Makefile.in Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/Makefile.in Sun Mar 26 21:14:49 2017 (r316006) @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.12.2 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2012 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,23 +14,61 @@ @SET_MAKE@ VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ esac; \ - test $$am__dry = yes; \ - } + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -53,34 +91,43 @@ host_triplet = @host@ @HAVE_AUDIT_SYSCALLS_TRUE@ libauditd subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/config/config.guess \ - $(top_srcdir)/config/config.h.in \ - $(top_srcdir)/config/config.sub \ - $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ - $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ - NEWS TODO config/compile config/config.guess config/config.sub \ - config/depcomp config/install-sh config/ltmain.sh \ - config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -88,13 +135,42 @@ am__can_run_installinfo = \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = bsm libauditd libbsm bin man modules sys +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/compile \ + $(top_srcdir)/config/config.guess \ + $(top_srcdir)/config/config.h.in \ + $(top_srcdir)/config/config.sub \ + $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ + $(top_srcdir)/config/missing INSTALL NEWS README TODO \ + config/compile config/config.guess config/config.sub \ + config/install-sh config/ltmain.sh config/missing \ + config/ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -139,6 +215,7 @@ am__distuninstallcheck_listfiles = $(dis distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -178,6 +255,7 @@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -284,7 +362,6 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -305,8 +382,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $( $(am__aclocal_m4_deps): config/config.h: config/stamp-h1 - @if test ! -f $@; then rm -f config/stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1; else :; fi + @test -f $@ || rm -f config/stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) config/stamp-h1 config/stamp-h1: $(top_srcdir)/config/config.h.in $(top_builddir)/config.status @rm -f config/stamp-h1 @@ -334,14 +411,13 @@ distclean-libtool: # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. -$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ @@ -362,31 +438,13 @@ $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_T if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done -cscopelist-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ - done -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -402,12 +460,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -419,15 +472,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCE $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -436,18 +485,16 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" - cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) - clean-cscope: -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive -cscope.files: clean-cscope cscopelist-recursive cscopelist - -cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ @@ -545,10 +592,16 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -581,18 +634,19 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod u+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -750,26 +804,26 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ - cscopelist-recursive ctags-recursive install-am install-strip \ - tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-cscope \ - clean-generic clean-libtool cscope cscopelist \ - cscopelist-recursive ctags ctags-recursive dist dist-all \ - dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-generic distclean-hdr \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-recursive uninstall uninstall-am +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-libtool distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. Modified: head/contrib/openbsm/NEWS ============================================================================== --- head/contrib/openbsm/NEWS Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/NEWS Sun Mar 26 21:14:49 2017 (r316006) @@ -1,5 +1,20 @@ OpenBSM Version History +OpenBSM 1.2 alpha 5 + +- Add a new "qsize" parameter in audit_control and the getacqsize(3) API to + query it, allowing to set the kernel's maximum audit queue length. +- Add support to push a mapping between audit event names and event numbers + into the kernel (where supported) using new A_GETEVENT and A_SETEVENT + auditon(2) operations. +- Add audit event identifiers for a number of new (and not-so-new) FreeBSD + system calls including those for asynchronous I/O, thread management, SCTP, + jails, multi-FIB support, and misc. POSIX interfaces such as + posix_fallocate(2) and posix_fadvise(2). +- On operating systems supporting Capsicum, auditreduce(1) and praudit(1) now + run sandboxed. +- Empty "flags" and "naflags" fields are now permitted in audit_control(5). + OpenBSM 1.2 alpha 4 - Fix praudit to emit correct XML. Modified: head/contrib/openbsm/README ============================================================================== --- head/contrib/openbsm/README Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/README Sun Mar 26 21:14:49 2017 (r316006) @@ -2,15 +2,16 @@ OpenBSM Introduction -OpenBSM is an open source implementation of Sun's BSM event auditing file +OpenBSM is an open-source implementation of Sun's BSM event auditing file format and API. Originally created for Apple Computer by McAfee Research, -OpenBSM is now maintained by volunteers and through the generous contribution +OpenBSM is now maintained by volunteers and through the generous contributions of several organizations. OpenBSM includes several command line tools, including auditreduce(8) and praudit(8) for reducing and printing audit trails, as well as the libbsm(3) library to manage configuration files, generate audit records, and parse and -print audit trails. +print audit trails. It also includes the auditd(8) audit configuration +daemon, and the auditdistd(8) audit-trail distribution daemon. Coupled with a kernel audit implementation, OpenBSM can be used to maintain system audit streams, and is a foundation for a full audit-enabled system. @@ -22,15 +23,15 @@ and Mac OS X kernels. OpenBSM consists of several directories: - bin/ Audit-related command line tools - bsm/ Library include files for BSM + bin/ Audit-related command line tools and daemons + bsm/ Library header files for BSM compat/ Compatibility code to build on various operating systems etc/ Sample /etc/security configuration files - libauditd Common audit management functions for auditd and launchd + libauditd/ Common audit management functions for auditd and launchd libbsm/ Implementation of BSM library interfaces and man pages man/ System call and configuration file man pages modules/ Directory for auditfilterd module source - sys/ System include files for BSM + sys/ System header files for BSM test/ Test token sets and geneneration program tools/ Tool directory, including audump to dump databases @@ -51,9 +52,9 @@ Please see the file INSTALL for build an Contributions The TrustedBSD Project would appreciate the contribution of bug fixes, -enhancements, etc, under identically or substantially similar licenses to -those present on the remainder of the OpenBSM source code. Please see the -file CREDITS to learn more about who has contributed to the project. +enhancements, etc, under the same license found in the top-level LICENSE file. +Please see the file CREDITS to learn more about who has contributed to the +project. Location Modified: head/contrib/openbsm/VERSION ============================================================================== --- head/contrib/openbsm/VERSION Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/VERSION Sun Mar 26 21:14:49 2017 (r316006) @@ -1 +1 @@ -OPENBSM_1_2_alpha4 +OPENBSM_1_2_alpha5 Modified: head/contrib/openbsm/aclocal.m4 ============================================================================== --- head/contrib/openbsm/aclocal.m4 Sun Mar 26 20:36:35 2017 (r316005) +++ head/contrib/openbsm/aclocal.m4 Sun Mar 26 21:14:49 2017 (r316006) @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.12.2 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2012 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, @@ -19,8611 +20,22 @@ You have another version of autoconf. I If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Mar 26 23:08:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B7A5D1EB0C; Sun, 26 Mar 2017 23:08:11 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x22c.google.com (mail-oi0-x22c.google.com [IPv6:2607:f8b0:4003:c06::22c]) (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 F1C221F3F; Sun, 26 Mar 2017 23:08:10 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-oi0-x22c.google.com with SMTP id f193so15511802oib.2; Sun, 26 Mar 2017 16:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yibztL7ixMPLfWqyy6hCaR8ZGj54PMmEHc6M7n1A/PM=; b=o6km7aUIAAEUUBVckmMdkNsZCxZe/rrIwPfZJhFP9e9HWo9NsCUc76h6Gn613JmTq6 3AwsBQ3hfLleryaarAQNVFE2dKGCzyCs9srMidYiUp+GCwSgPfIlzukNvFSOfWi+F9cD tKmqaPoLJWZF2t/khMAl7/OY5yyePrbprwTV0byCQuHQwnYuIerJ/bCsVF7CfnFIEpyJ WUHwp1p8RDh3wlN6+fjIdXGKKTHVaG0XRn4hOvB5L7yzMEZftdZ/gRHITx803Cih85BI dzZkWCDf/S+CYGIl8lVvLXxh0iFeiQw1oenxfhu3dKGGA/gYoHeNtu7rRZ+PoTcg56Ad LoqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=yibztL7ixMPLfWqyy6hCaR8ZGj54PMmEHc6M7n1A/PM=; b=dPw/Rpr++CkIOb7Ldow8mxbPvRitcKQ1t1WC7BkUyrCSKJrJhAIV0SyqRkL3z22qoi 9GNT3iKdXnEMFYpLmHkuKuHQIQohkW5McTL3yECj8wiUQMoe3u+GAoUrsF2cWlG1lHxr 3w1/+yiK10vpV4hFt75NeUns+2m5nizvlX0pEkDmNe1O7t//8XUk9XYKsCBxT3WYk/9J GQt5zxu/wiFX8olUw0/TMo8UVoG62oDbTNaUObJhKFwzT2Hu096z0qnUMo+kCdIpX/MI 2QfNZrwQ6gHeg4JGBgE5pU2zM58YDQNZf4rQByKKYMZoEbNdaUoTHn3SXwDYxM+jb73t 9GSQ== X-Gm-Message-State: AFeK/H1kkfkhf8MlX3EAfHQipRK2l/9U4Vo4WU0piDPJ6cqlF9z5YkMnF/8cZ1mp2dTDxg== X-Received: by 10.202.76.137 with SMTP id z131mr4260854oia.42.1490569690059; Sun, 26 Mar 2017 16:08:10 -0700 (PDT) Received: from [33.164.203.249] ([172.58.46.192]) by smtp.gmail.com with ESMTPSA id l187sm4308571oih.22.2017.03.26.16.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Mar 2017 16:08:09 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ger... From: Ngie Cooper X-Mailer: iPhone Mail (14D27) In-Reply-To: <20170325201943.GA16107@mordor.heemeyer.club> Date: Sun, 26 Mar 2017 16:07:57 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201703251332.v2PDWS6O004270@repo.freebsd.org> <71317296-9981-4B0B-8243-5E4403CE8C62@gmail.com> <20170325201943.GA16107@mordor.heemeyer.club> To: Chagin Dmitry X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Mar 2017 23:08:11 -0000 > On Mar 25, 2017, at 13:19, Chagin Dmitry wrote: >=20 >> On Sat, Mar 25, 2017 at 10:45:30AM -0700, Ngie Cooper wrote: >>=20 >>> On Mar 25, 2017, at 06:32, Dmitry Chagin wrote: >>>=20 >>> Author: dchagin >>> Date: Sat Mar 25 13:32:28 2017 >>> New Revision: 315948 >>> URL: https://svnweb.freebsd.org/changeset/base/315948 >>>=20 >>> Log: >>> Update to tcsh 6.20.00 >>=20 >> Relnotes: yes >>=20 > don't think it matters, >=20 >> Should this be MFCed? >>=20 > I did not plan Hi Dmitry, That's unfortunate :(.. - Release notes help various groups determining/mitigating risk when upgradi= ng FreeBSD. In particular, if you're a consumer of tcsh, a new version could= break existing scripts, or alternatively, make them work better(/with less h= acks). - MFCing changes like this would be incredibly helpful. In theory, new versi= ons should result in a combination of bugfixes to existing features and enha= ncements. - It makes it easier to deal with toolchain upgrades. - In theory, if the version of the newer forked/tip branch is equivalent to t= he older forked branch, it's easier to assume that the behavior on the two b= ranches is equivalent. Personally, I don't care too much about *csh, but I know people that do,= and I work for a company that kind of does, because it affects users loggin= g into our appliances. Thanks! -Ngie= From owner-svn-src-all@freebsd.org Mon Mar 27 01:06:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 03:11:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66362D1E60A; Mon, 27 Mar 2017 03:11:52 +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 304DC1E65; Mon, 27 Mar 2017 03:11:52 +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 v2R3BptZ040029; Mon, 27 Mar 2017 03:11:51 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R3Bp6h040028; Mon, 27 Mar 2017 03:11:51 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703270311.v2R3Bp6h040028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 27 Mar 2017 03:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316008 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 03:11:52 -0000 Author: np Date: Mon Mar 27 03:11:51 2017 New Revision: 316008 URL: https://svnweb.freebsd.org/changeset/base/316008 Log: cxgbe/iw_cxgbe: Remove unused code. MFC after: 3 days Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 27 01:06:25 2017 (r316007) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 27 03:11:51 2017 (r316008) @@ -89,7 +89,6 @@ static enum c4iw_ep_state state_read(str 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); @@ -938,16 +937,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; From owner-svn-src-all@freebsd.org Mon Mar 27 04:11:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3D9D1F652; Mon, 27 Mar 2017 04:11:17 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE355167F; Mon, 27 Mar 2017 04:11:16 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MbPPQ-1cbvZl0G8K-00Io3e; Mon, 27 Mar 2017 06:11:13 +0200 Date: Mon, 27 Mar 2017 06:11:06 +0200 From: "O. Hartmann" To: Ngie Cooper Cc: Chagin Dmitry , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r315948 - in head: bin/csh contrib/tcsh contrib/tcsh/config contrib/tcsh/nls contrib/tcsh/nls/C contrib/tcsh/nls/et contrib/tcsh/nls/finnish contrib/tcsh/nls/french contrib/tcsh/nls/ger... Message-ID: <20170327061054.167171fb@freyja.zeit4.iv.bundesimmobilien.de> In-Reply-To: References: <201703251332.v2PDWS6O004270@repo.freebsd.org> <71317296-9981-4B0B-8243-5E4403CE8C62@gmail.com> <20170325201943.GA16107@mordor.heemeyer.club> Organization: Walstatt X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:562rRV+yPReFu15OUpECYBQBAT2oaoX1YlqiIDjH5nXijoWD5Kp iWAW4/jOMEJ+EKVjkSo7TKvEVr7WzhPovLzg9+1Y7blrmI+L3tHHdnnwryzgIOhQaFOqdFg HPdktk3p5HAWRiONg9Ow3+8km9OKZL+iNeopGcWj/mWbJ0c2+ym+mwr6g2fjke4mB+LUYt/ L0Iwjq+D1p+4jgdxllNeg== X-UI-Out-Filterresults: notjunk:1;V01:K0:iXuk9HFwicM=:MDs3vc0DqrDqj5FRz7OKmN z1aegoJ75AKF/jmI9ePTUy0TyeX/vR83uLM30saKRMzmkqg7vwO/+DMYyhAbvcjP7lCg7GhfW hYqaooOkHbCEaevKZs0ArHUFB77tDID+hYfivplMFS1Sf1GtmGTbrnh0hT4zd8o2hvCvGb7PI xbyp8DllZ2djtd+MuDAd4RBtK5tA0mah0D6GolGNTqYuxoNbeZq78WQk/h4I+Xyhmlyr3XCJS wj+Kp/z4+/NVQrNYXRTTYWbpvUec8U2MVusHMqCDbGT1bEt9zcHjPnPS7H3Wubm+qlNq/IYqx wHTG+9gRYC+HZmwmTXVCozqwsDhEXfe+G1l4bqBfrbLXDcnjkYWJf/kLFJ/Qs6vRmgHgV/P1w FE/SgBxY7eq7tjoTCYQ2WF37A7PoXPLAqBeSIlidLUVkyxIuRoliOtf0yJS61o34N0KgsklTG 6ZRapug4RuHhnb92UbeUswh2eO0i+uB7Be1t0L0K+7Wx2h5jQ52vLtAjG+rJFd2IGjsmr1Xvz Kux1XnoXyiCdSoXS4bBK0JePqpH8rJw+YLP+m7Iq7qXEBiriHs7fdTVvQWm2hcyWkKoIrlH3u CrLKs6PgwufDosx9uvTM0C1h/hKjfb9ZLcltC8NNmJt40/u7xH3gp8t67CARPCnUsCB96WSC+ o+VChlOoKUa6EYJpb7sc3L+IH+0wO+S2N9pIrY9lmNjmEceZfOVCxkBUOUIp4PKYHdiLvw5x8 JEsbmjOIi6cxIzUl8JMXSg91rqUr4XFKyw5rb5Q70zas/EuTiiC158qr8GFqUGKoHaX40JaRU 0Z8rZox X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 04:11:17 -0000 On Sun, 26 Mar 2017 16:07:57 -0700 Ngie Cooper wrote: > > On Mar 25, 2017, at 13:19, Chagin Dmitry wrote: > > > >> On Sat, Mar 25, 2017 at 10:45:30AM -0700, Ngie Cooper wrote: > >> > >>> On Mar 25, 2017, at 06:32, Dmitry Chagin wrote: > >>> > >>> Author: dchagin > >>> Date: Sat Mar 25 13:32:28 2017 > >>> New Revision: 315948 > >>> URL: https://svnweb.freebsd.org/changeset/base/315948 > >>> > >>> Log: > >>> Update to tcsh 6.20.00 > >> > >> Relnotes: yes > >> > > don't think it matters, > > > >> Should this be MFCed? > >> > > I did not plan > > Hi Dmitry, > > That's unfortunate :(.. > > - Release notes help various groups determining/mitigating risk when > upgrading FreeBSD. In particular, if you're a consumer of tcsh, a new version > could break existing scripts, or alternatively, make them work better(/with > less hacks). > - MFCing changes like this would be incredibly helpful. In theory, new > versions should result in a combination of bugfixes to existing features and > enhancements. > - It makes it easier to deal with toolchain upgrades. > - In theory, if the version of the newer forked/tip branch is equivalent to > the older forked branch, it's easier to assume that the behavior on the two > branches is equivalent. Personally, I don't care too much about *csh, but I > know people that do, and I work for a company that kind of does, because it > affects users logging into our appliances. Thanks! -Ngie > _______________________________________________ svn-src-head@freebsd.org > mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" +1 Kind regards, oh From owner-svn-src-all@freebsd.org Mon Mar 27 06:37:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C8B6D1F9C2; Mon, 27 Mar 2017 06:37:04 +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 4C5F61DA4; Mon, 27 Mar 2017 06:37:04 +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 v2R6b3wj023134; Mon, 27 Mar 2017 06:37:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R6b3mX023133; Mon, 27 Mar 2017 06:37:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703270637.v2R6b3mX023133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Mar 2017 06:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316009 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 06:37:04 -0000 Author: kib Date: Mon Mar 27 06:37:03 2017 New Revision: 316009 URL: https://svnweb.freebsd.org/changeset/base/316009 Log: Fix TUNABLE_UINT64() on 32bit architectures. The macro is not used in the tree. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/sys/kernel.h Modified: head/sys/sys/kernel.h ============================================================================== --- head/sys/sys/kernel.h Mon Mar 27 03:11:51 2017 (r316008) +++ head/sys/sys/kernel.h Mon Mar 27 06:37:03 2017 (r316009) @@ -352,7 +352,7 @@ struct tunable_uint64 { uint64_t *var; }; #define TUNABLE_UINT64(path, var) \ - static struct tunable_ulong __CONCAT(__tunable_uint64_, __LINE__) = { \ + static struct tunable_uint64 __CONCAT(__tunable_uint64_, __LINE__) = { \ (path), \ (var), \ }; \ From owner-svn-src-all@freebsd.org Mon Mar 27 07:02:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4366D1F0A4; Mon, 27 Mar 2017 07:02:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9789F1BA4; Mon, 27 Mar 2017 07:02:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2R72RP0035042; Mon, 27 Mar 2017 07:02:27 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R72ROX035041; Mon, 27 Mar 2017 07:02:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703270702.v2R72ROX035041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 27 Mar 2017 07:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316010 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 07:02:29 -0000 Author: avos Date: Mon Mar 27 07:02:27 2017 New Revision: 316010 URL: https://svnweb.freebsd.org/changeset/base/316010 Log: iwm: fix build without IWM_DEBUG. Reported by: O. Hartmann Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D10146 Modified: head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Mon Mar 27 06:37:03 2017 (r316009) +++ head/sys/dev/iwm/if_iwm_scan.c Mon Mar 27 07:02:27 2017 (r316010) @@ -201,6 +201,7 @@ iwm_mvm_scan_rate_n_flags(struct iwm_sof return htole32(IWM_RATE_6M_PLCP | tx_ant); } +#ifdef IWM_DEBUG static const char * iwm_mvm_ebs_status_str(enum iwm_scan_ebs_status status) { @@ -216,12 +217,18 @@ iwm_mvm_ebs_status_str(enum iwm_scan_ebs } } +static const char * +iwm_mvm_offload_status_str(enum iwm_scan_offload_complete_status status) +{ + return (status == IWM_SCAN_OFFLOAD_ABORTED) ? "aborted" : "completed"; +} +#endif + void iwm_mvm_rx_lmac_scan_complete_notif(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_periodic_scan_complete *scan_notif = (void *)pkt->data; - boolean_t aborted = (scan_notif->status == IWM_SCAN_OFFLOAD_ABORTED); /* If this happens, the firmware has mistakenly sent an LMAC * notification during UMAC scans -- warn and ignore it. @@ -234,7 +241,7 @@ iwm_mvm_rx_lmac_scan_complete_notif(stru } IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Regular scan %s, EBS status %s (FW)\n", - aborted ? "aborted" : "completed", + iwm_mvm_offload_status_str(scan_notif->status), iwm_mvm_ebs_status_str(scan_notif->ebs_status)); sc->last_ebs_successful = @@ -248,13 +255,11 @@ iwm_mvm_rx_umac_scan_complete_notif(stru struct iwm_rx_packet *pkt) { struct iwm_umac_scan_complete *notif = (void *)pkt->data; - uint32_t uid = le32toh(notif->uid); - boolean_t aborted = (notif->status == IWM_SCAN_OFFLOAD_ABORTED); IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Scan completed, uid %u, status %s, EBS status %s\n", - uid, - aborted ? "aborted" : "completed", + le32toh(notif->uid), + iwm_mvm_offload_status_str(notif->status), iwm_mvm_ebs_status_str(notif->ebs_status)); if (notif->ebs_status != IWM_SCAN_EBS_SUCCESS && From owner-svn-src-all@freebsd.org Mon Mar 27 07:04:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 533F9D1F1C7; Mon, 27 Mar 2017 07:04:53 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) (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 EA0CF1DB0; Mon, 27 Mar 2017 07:04:52 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-wr0-f170.google.com with SMTP id w43so29909635wrb.0; Mon, 27 Mar 2017 00:04:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=Ntm/ZadwFPdKP49oCG5gO252cWPJi5AXKr57YZkv0DE=; b=Ln6RokY7vPXXPzXifg5j39WpVbVVEZSCFaxnUoIJibSI7op/8BKx8ZPWMNv7nOspcf /nZQ2KPjMZt7FgEMINvjHh+Lb0WgzhG19oJjBDOF/GYcVJXOAlEAkG71dITTBwDoTdf0 onLex91EdfwigCmMiwjuwv7kRtK1IfRnRKWpqFyDH5NzdAVBOgSHzEExGjLgRK4eSbdl jp6JeLLL7pFwkn1PWM61CuOUzLNj5yWIwQG1+ZEoUBRuqnwoRWhtmtg0RCL3lH21jxdv AWS1A+CLRfnoPN75aNjLO4S1t+VWtDEn3g6lh2yS82ubUG9wyecOEp2Mc2Mrd11dM3np g3Rg== X-Gm-Message-State: AFeK/H3lNYjFOVZz8zTj9N1cm6EBbCMOS50GuIca6BMkPq0khcyeOULCPzZzGydctVuqfQ== X-Received: by 10.28.156.69 with SMTP id f66mr7878714wme.56.1490598284821; Mon, 27 Mar 2017 00:04:44 -0700 (PDT) Received: from thinkpad-x220 (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id b91sm13600061wrd.29.2017.03.27.00.04.44 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 27 Mar 2017 00:04:44 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Hartmann, O." Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315981 - head/sys/dev/iwn References: <201703260910.v2Q9A26Z081833@repo.freebsd.org> <20170326164309.759fc5b9@hermann> Date: Mon, 27 Mar 2017 10:04:39 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <20170326164309.759fc5b9@hermann> User-Agent: Opera Mail/12.15 (FreeBSD) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 07:04:53 -0000 Sun, 26 Mar 2017 17:43:18 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Hartmann, O. = : > On Sun, 26 Mar 2017 09:10:02 +0000 (UTC) > Andriy Voskoboinyk wrote: > >> Author: avos >> Date: Sun Mar 26 09:10:01 2017 >> New Revision: 315981 >> URL: https://svnweb.freebsd.org/changeset/base/315981 >> >> Log: >> iwn: omit unneeded bus_dmamap_sync() calls when compiled without >> 'options IWN_DEBUG' >> >> Modified: >> head/sys/dev/iwn/if_iwn.c >> >> Modified: head/sys/dev/iwn/if_iwn.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D >> --- head/sys/dev/iwn/if_iwn.c Sun Mar 26 08:54:08 2017 >> (r315980) +++ head/sys/dev/iwn/if_iwn.c Sun Mar 26 09:10:01 >> 2017 (r315981) @@ -3944,6 +3944,7 @@ iwn_notif_intr(struct >> iwn_softc *sc) sc->errptr =3D le32toh(uc->errptr); >> break; >> } >> +#ifdef IWN_DEBUG >> case IWN_STATE_CHANGED: >> { >> /* >> @@ -3953,27 +3954,26 @@ iwn_notif_intr(struct iwn_softc *sc) >> */ >> bus_dmamap_sync(sc->rxq.data_dmat, data->map, >> BUS_DMASYNC_POSTREAD); >> -#ifdef IWN_DEBUG >> + >> uint32_t *status =3D (uint32_t *)(desc + 1); >> DPRINTF(sc, IWN_DEBUG_INTR | IWN_DEBUG_STATE, >> "state changed to %x\n", >> le32toh(*status)); >> -#endif >> break; >> } >> case IWN_START_SCAN: >> { >> bus_dmamap_sync(sc->rxq.data_dmat, data->map, >> BUS_DMASYNC_POSTREAD); >> -#ifdef IWN_DEBUG >> + >> struct iwn_start_scan *scan =3D >> (struct iwn_start_scan *)(desc + 1); >> DPRINTF(sc, IWN_DEBUG_ANY, >> "%s: scanning channel %d status %x\n", >> __func__, scan->chan, >> le32toh(scan->status)); -#endif >> break; >> } >> +#endif >> case IWN_STOP_SCAN: >> { >> bus_dmamap_sync(sc->rxq.data_dmat, data->map, >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to >> "svn-src-head-unsubscribe@freebsd.org" > > It seems when iwm is configured in a kernel without debugging enabled,= > builkernel failsas shown below: > > > > > [...] > -------------------------------------------------------------- >>>> stage 3.1: building everything > -------------------------------------------------------------- > cd /usr/obj/usr/src/sys/HERMANN; COMPILER_VERSION=3D40000 > COMPILER_TYPE=3Dclang COMPILER_FREEBSD_VERSION=3D1200006 > MAKEOBJDIRPREFIX=3D/usr/obj MACHINE_ARCH=3Damd64 MACHINE=3Damd64 > CPUTYPE=3Dnative BUILD_TOOLS_META=3D.NOMETA_CMP > GROFF_BIN_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/bin > GROFF_FONT_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/groff_font > GROFF_TMAC_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/tmac CC=3D"cc > -target x86_64-unknown-freebsd12.0 --sysroot=3D/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin" CXX=3D"c++ -target > x86_64-unknown-freebsd12.0 --sysroot=3D/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin" CPP=3D"cpp -target > x86_64-unknown-freebsd12.0 --sysroot=3D/usr/obj/usr/src/tmp > -B/usr/obj/usr/src/tmp/usr/bin" AS=3D"as" AR=3D"ar" LD=3D"ld" LLVM_LI= NK=3D"" > NM=3Dnm OBJCOPY=3D"objcopy" RANLIB=3Dranlib STRINGS=3D SIZE=3D"size"= > INSTALL=3D"sh /usr/src/tools/install.sh" > PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legac= y/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:= /usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin > make -m /usr/src/share/mk KERNEL=3Dkernel all -DNO_MODULES_OBJ > Building /usr/obj/usr/src/sys/HERMANN/if_iwm_scan.o = > /usr/src/sys/dev/iwm/if_iwm_scan.c:224:12: > error: unused variable 'aborted' [-Werror,-Wunused-variable] boolean_t= > aborted =3D (scan_notif->status =3D=3D IWM_SCAN_OFFLOAD_ABORTED); > ^ /usr/src/sys/dev/iwm/if_iwm_scan.c:251:11: error: unused variable > 'uid' [-Werror,-Wunused-variable] uint32_t uid =3D le32toh(notif->uid)= ; Fixed in r316010. From owner-svn-src-all@freebsd.org Mon Mar 27 07:06:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE96D1F280; Mon, 27 Mar 2017 07:06:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0EF01F6B; Mon, 27 Mar 2017 07:06:46 +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 v2R76jJg035240; Mon, 27 Mar 2017 07:06:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R76jSk035236; Mon, 27 Mar 2017 07:06:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703270706.v2R76jSk035236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 27 Mar 2017 07:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316011 - head/sys/x86/iommu X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 07:06:47 -0000 Author: kib Date: Mon Mar 27 07:06:45 2017 New Revision: 316011 URL: https://svnweb.freebsd.org/changeset/base/316011 Log: Timeout DMAR commands. Implement timeouts for register-based DMAR commands. Tunable/sysctl hw.dmar.timeout specifies the timeout in nanoseconds, set it to zero to allow infinite wait. Default is 1ms. Runtime modification of the sysctl is not safe, it is allowed for debugging. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_qi.c head/sys/x86/iommu/intel_utils.c Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Mon Mar 27 07:02:27 2017 (r316010) +++ head/sys/x86/iommu/intel_dmar.h Mon Mar 27 07:06:45 2017 (r316011) @@ -290,6 +290,8 @@ int dmar_enable_ir(struct dmar_unit *uni int dmar_disable_ir(struct dmar_unit *unit); bool dmar_barrier_enter(struct dmar_unit *dmar, u_int barrier_id); void dmar_barrier_exit(struct dmar_unit *dmar, u_int barrier_id); +uint64_t dmar_get_timeout(void); +void dmar_update_timeout(uint64_t newval); int dmar_fault_intr(void *arg); void dmar_enable_fault_intr(struct dmar_unit *unit); @@ -507,6 +509,36 @@ dmar_test_boundary(dmar_gaddr_t start, d return (start + size <= ((start + boundary) & ~(boundary - 1))); } +extern struct timespec dmar_hw_timeout; + +#define DMAR_WAIT_UNTIL(cond) \ +{ \ + struct timespec last, curr; \ + bool forever; \ + \ + if (dmar_hw_timeout.tv_sec == 0 && \ + dmar_hw_timeout.tv_nsec == 0) { \ + forever = true; \ + } else { \ + forever = false; \ + nanouptime(&curr); \ + last = curr; \ + timespecadd(&last, &dmar_hw_timeout); \ + } \ + for (;;) { \ + if (cond) { \ + error = 0; \ + break; \ + } \ + nanouptime(&curr); \ + if (!forever && timespeccmp(&last, &curr, <)) { \ + error = ETIMEDOUT; \ + break; \ + } \ + cpu_spinwait(); \ + } \ +} + #ifdef INVARIANTS #define TD_PREP_PINNED_ASSERT \ int old_td_pinned; \ Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Mon Mar 27 07:02:27 2017 (r316010) +++ head/sys/x86/iommu/intel_drv.c Mon Mar 27 07:06:45 2017 (r316011) @@ -402,6 +402,7 @@ dmar_attach(device_t dev) { struct dmar_unit *unit; ACPI_DMAR_HARDWARE_UNIT *dmaru; + uint64_t timeout; int i, error; unit = device_get_softc(dev); @@ -426,6 +427,10 @@ dmar_attach(device_t dev) dmar_print_caps(dev, unit, dmaru); dmar_quirks_post_ident(unit); + timeout = dmar_get_timeout(); + TUNABLE_UINT64_FETCH("hw.dmar.timeout", &timeout); + dmar_update_timeout(timeout); + for (i = 0; i < DMAR_INTR_TOTAL; i++) unit->intrs[i].irq = -1; Modified: head/sys/x86/iommu/intel_qi.c ============================================================================== --- head/sys/x86/iommu/intel_qi.c Mon Mar 27 07:02:27 2017 (r316010) +++ head/sys/x86/iommu/intel_qi.c Mon Mar 27 07:06:45 2017 (r316011) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,27 +71,27 @@ dmar_qi_seq_processed(const struct dmar_ static int dmar_enable_qi(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); unit->hw_gcmd |= DMAR_GCMD_QIE; dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_QIES) == 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_QIES) + != 0)); + return (error); } static int dmar_disable_qi(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); unit->hw_gcmd &= ~DMAR_GCMD_QIE; dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_QIES) != 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_QIES) + == 0)); + return (error); } static void Modified: head/sys/x86/iommu/intel_utils.c ============================================================================== --- head/sys/x86/iommu/intel_utils.c Mon Mar 27 07:02:27 2017 (r316010) +++ head/sys/x86/iommu/intel_utils.c Mon Mar 27 07:06:45 2017 (r316011) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -401,6 +402,7 @@ int dmar_load_root_entry_ptr(struct dmar_unit *unit) { vm_page_t root_entry; + int error; /* * Access to the GCMD register must be serialized while the @@ -413,10 +415,9 @@ dmar_load_root_entry_ptr(struct dmar_uni VM_OBJECT_RUNLOCK(unit->ctx_obj); dmar_write8(unit, DMAR_RTADDR_REG, VM_PAGE_TO_PHYS(root_entry)); dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd | DMAR_GCMD_SRTP); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_RTPS) == 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_RTPS) + != 0)); + return (error); } /* @@ -426,6 +427,7 @@ dmar_load_root_entry_ptr(struct dmar_uni int dmar_inv_ctx_glob(struct dmar_unit *unit) { + int error; /* * Access to the CCMD register must be serialized while the @@ -441,10 +443,9 @@ dmar_inv_ctx_glob(struct dmar_unit *unit * writes the upper dword last. */ dmar_write8(unit, DMAR_CCMD_REG, DMAR_CCMD_ICC | DMAR_CCMD_CIRG_GLOB); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_CCMD_REG + 4) & DMAR_CCMD_ICC32) != 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_CCMD_REG + 4) & DMAR_CCMD_ICC32) + == 0)); + return (error); } /* @@ -453,7 +454,7 @@ dmar_inv_ctx_glob(struct dmar_unit *unit int dmar_inv_iotlb_glob(struct dmar_unit *unit) { - int reg; + int error, reg; DMAR_ASSERT_LOCKED(unit); KASSERT(!unit->qi_enabled, ("QI enabled")); @@ -462,11 +463,9 @@ dmar_inv_iotlb_glob(struct dmar_unit *un /* See a comment about DMAR_CCMD_ICC in dmar_inv_ctx_glob. */ dmar_write8(unit, reg + DMAR_IOTLB_REG_OFF, DMAR_IOTLB_IVT | DMAR_IOTLB_IIRG_GLB | DMAR_IOTLB_DR | DMAR_IOTLB_DW); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, reg + DMAR_IOTLB_REG_OFF + 4) & - DMAR_IOTLB_IVT32) != 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, reg + DMAR_IOTLB_REG_OFF + 4) & + DMAR_IOTLB_IVT32) == 0)); + return (error); } /* @@ -476,6 +475,7 @@ dmar_inv_iotlb_glob(struct dmar_unit *un int dmar_flush_write_bufs(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); @@ -486,42 +486,42 @@ dmar_flush_write_bufs(struct dmar_unit * ("dmar%d: no RWBF", unit->unit)); dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd | DMAR_GCMD_WBF); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_WBFS) == 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_WBFS) + != 0)); + return (error); } int dmar_enable_translation(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); unit->hw_gcmd |= DMAR_GCMD_TE; dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_TES) == 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_TES) + != 0)); + return (error); } int dmar_disable_translation(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); unit->hw_gcmd &= ~DMAR_GCMD_TE; dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_TES) != 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_TES) + == 0)); + return (error); } int dmar_load_irt_ptr(struct dmar_unit *unit) { uint64_t irta, s; + int error; DMAR_ASSERT_LOCKED(unit); irta = unit->irt_phys; @@ -534,37 +534,36 @@ dmar_load_irt_ptr(struct dmar_unit *unit irta |= s; dmar_write8(unit, DMAR_IRTA_REG, irta); dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd | DMAR_GCMD_SIRTP); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRTPS) == 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRTPS) + != 0)); + return (error); } int dmar_enable_ir(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); unit->hw_gcmd |= DMAR_GCMD_IRE; unit->hw_gcmd &= ~DMAR_GCMD_CFI; dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRES) == 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRES) + != 0)); + return (error); } int dmar_disable_ir(struct dmar_unit *unit) { + int error; DMAR_ASSERT_LOCKED(unit); unit->hw_gcmd &= ~DMAR_GCMD_IRE; dmar_write4(unit, DMAR_GCMD_REG, unit->hw_gcmd); - /* XXXKIB should have a timeout */ - while ((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRES) != 0) - cpu_spinwait(); - return (0); + DMAR_WAIT_UNTIL(((dmar_read4(unit, DMAR_GSTS_REG) & DMAR_GSTS_IRES) + == 0)); + return (error); } #define BARRIER_F \ @@ -619,6 +618,43 @@ dmar_barrier_exit(struct dmar_unit *dmar int dmar_match_verbose; int dmar_batch_coalesce = 100; +struct timespec dmar_hw_timeout = { + .tv_sec = 0, + .tv_nsec = 1000000 +}; + +static const uint64_t d = 1000000000; + +void +dmar_update_timeout(uint64_t newval) +{ + + /* XXXKIB not atomic */ + dmar_hw_timeout.tv_sec = newval / d; + dmar_hw_timeout.tv_nsec = newval % d; +} + +uint64_t +dmar_get_timeout(void) +{ + + return ((uint64_t)dmar_hw_timeout.tv_sec * d + + dmar_hw_timeout.tv_nsec); +} + +static int +dmar_timeout_sysctl(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int error; + + val = dmar_get_timeout(); + error = sysctl_handle_long(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + dmar_update_timeout(val); + return (error); +} static SYSCTL_NODE(_hw, OID_AUTO, dmar, CTLFLAG_RD, NULL, ""); SYSCTL_INT(_hw_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, @@ -630,6 +666,10 @@ SYSCTL_INT(_hw_dmar, OID_AUTO, match_ver SYSCTL_INT(_hw_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, &dmar_batch_coalesce, 0, "Number of qi batches between interrupt"); +SYSCTL_PROC(_hw_dmar, OID_AUTO, timeout, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, + dmar_timeout_sysctl, "QU", + "Timeout for command wait, in nanoseconds"); #ifdef INVARIANTS int dmar_check_free; SYSCTL_INT(_hw_dmar, OID_AUTO, check_free, CTLFLAG_RWTUN, From owner-svn-src-all@freebsd.org Mon Mar 27 07:56:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FDCCD1F172; Mon, 27 Mar 2017 07:56:42 +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 2F5A41BB2; Mon, 27 Mar 2017 07:56:42 +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 v2R7ufbM055413; Mon, 27 Mar 2017 07:56:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R7ufFv055412; Mon, 27 Mar 2017 07:56:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201703270756.v2R7ufFv055412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 27 Mar 2017 07:56:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316012 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 07:56:42 -0000 Author: ae Date: Mon Mar 27 07:56:41 2017 New Revision: 316012 URL: https://svnweb.freebsd.org/changeset/base/316012 Log: Declare module version. MFC after: 1 week Modified: head/sys/net/if_enc.c Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Mon Mar 27 07:06:45 2017 (r316011) +++ head/sys/net/if_enc.c Mon Mar 27 07:56:41 2017 (r316012) @@ -423,3 +423,4 @@ static moduledata_t enc_mod = { }; DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +MODULE_VERSION(if_enc, 1); From owner-svn-src-all@freebsd.org Mon Mar 27 08:18:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FAB8D1F95A; Mon, 27 Mar 2017 08:18:15 +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 EE92D16BE; Mon, 27 Mar 2017 08:18:14 +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 v2R8IE7N064419; Mon, 27 Mar 2017 08:18:14 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R8IDo5064417; Mon, 27 Mar 2017 08:18:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201703270818.v2R8IDo5064417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 27 Mar 2017 08:18:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316013 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 08:18:15 -0000 Author: ae Date: Mon Mar 27 08:18:13 2017 New Revision: 316013 URL: https://svnweb.freebsd.org/changeset/base/316013 Log: ake pfil's locking macros private. Obtained from: Yandex LLC MFC after: 1 week Modified: head/sys/net/pfil.c head/sys/net/pfil.h Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Mon Mar 27 07:56:41 2017 (r316012) +++ head/sys/net/pfil.c Mon Mar 27 08:18:13 2017 (r316013) @@ -63,6 +63,32 @@ VNET_DEFINE(struct pfilheadhead, pfil_he VNET_DEFINE(struct rmlock, pfil_lock); #define V_pfil_lock VNET(pfil_lock) +#define PFIL_LOCK_INIT_REAL(l, t) \ + rm_init_flags(l, "PFil " t " rmlock", RM_RECURSE) +#define PFIL_LOCK_DESTROY_REAL(l) \ + rm_destroy(l) +#define PFIL_LOCK_INIT(p) do { \ + if ((p)->flags & PFIL_FLAG_PRIVATE_LOCK) { \ + PFIL_LOCK_INIT_REAL(&(p)->ph_lock, "private"); \ + (p)->ph_plock = &(p)->ph_lock; \ + } else \ + (p)->ph_plock = &V_pfil_lock; \ +} while (0) +#define PFIL_LOCK_DESTROY(p) do { \ + if ((p)->flags & PFIL_FLAG_PRIVATE_LOCK) \ + PFIL_LOCK_DESTROY_REAL((p)->ph_plock); \ +} while (0) + +#define PFIL_TRY_RLOCK(p, t) rm_try_rlock((p)->ph_plock, (t)) +#define PFIL_RLOCK(p, t) rm_rlock((p)->ph_plock, (t)) +#define PFIL_WLOCK(p) rm_wlock((p)->ph_plock) +#define PFIL_RUNLOCK(p, t) rm_runlock((p)->ph_plock, (t)) +#define PFIL_WUNLOCK(p) rm_wunlock((p)->ph_plock) +#define PFIL_WOWNED(p) rm_wowned((p)->ph_plock) + +#define PFIL_HEADLIST_LOCK() mtx_lock(&pfil_global_lock) +#define PFIL_HEADLIST_UNLOCK() mtx_unlock(&pfil_global_lock) + /* * pfil_run_hooks() runs the specified packet filter hook chain. */ Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Mon Mar 27 07:56:41 2017 (r316012) +++ head/sys/net/pfil.h Mon Mar 27 08:18:13 2017 (r316013) @@ -109,7 +109,6 @@ int pfil_head_register(struct pfil_head int pfil_head_unregister(struct pfil_head *); /* Public pfil locking functions for self managed locks by packet filters. */ -struct rm_priotracker; /* Do not require including rmlock header */ int pfil_try_rlock(struct pfil_head *, struct rm_priotracker *); void pfil_rlock(struct pfil_head *, struct rm_priotracker *); void pfil_runlock(struct pfil_head *, struct rm_priotracker *); @@ -117,32 +116,4 @@ void pfil_wlock(struct pfil_head *); void pfil_wunlock(struct pfil_head *); int pfil_wowned(struct pfil_head *ph); -/* Internal pfil locking functions. */ -#define PFIL_LOCK_INIT_REAL(l, t) \ - rm_init_flags(l, "PFil " t " rmlock", RM_RECURSE) -#define PFIL_LOCK_DESTROY_REAL(l) \ - rm_destroy(l) -#define PFIL_LOCK_INIT(p) do { \ - if ((p)->flags & PFIL_FLAG_PRIVATE_LOCK) { \ - PFIL_LOCK_INIT_REAL(&(p)->ph_lock, "private"); \ - (p)->ph_plock = &(p)->ph_lock; \ - } else \ - (p)->ph_plock = &V_pfil_lock; \ -} while (0) -#define PFIL_LOCK_DESTROY(p) do { \ - if ((p)->flags & PFIL_FLAG_PRIVATE_LOCK) \ - PFIL_LOCK_DESTROY_REAL((p)->ph_plock); \ -} while (0) - -#define PFIL_TRY_RLOCK(p, t) rm_try_rlock((p)->ph_plock, (t)) -#define PFIL_RLOCK(p, t) rm_rlock((p)->ph_plock, (t)) -#define PFIL_WLOCK(p) rm_wlock((p)->ph_plock) -#define PFIL_RUNLOCK(p, t) rm_runlock((p)->ph_plock, (t)) -#define PFIL_WUNLOCK(p) rm_wunlock((p)->ph_plock) -#define PFIL_WOWNED(p) rm_wowned((p)->ph_plock) - -/* Internal locking macros for global/vnet pfil_head_list. */ -#define PFIL_HEADLIST_LOCK() mtx_lock(&pfil_global_lock) -#define PFIL_HEADLIST_UNLOCK() mtx_unlock(&pfil_global_lock) - #endif /* _NET_PFIL_H_ */ From owner-svn-src-all@freebsd.org Mon Mar 27 08:29:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 08:29:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32D1D1E007; Mon, 27 Mar 2017 08:29:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9FE51E9A; Mon, 27 Mar 2017 08:29:18 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2R8THFq068422; Mon, 27 Mar 2017 08:29:17 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R8THOH068421; Mon, 27 Mar 2017 08:29:17 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703270829.v2R8THOH068421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Mon, 27 Mar 2017 08:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316015 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 08:29:19 -0000 Author: rwatson Date: Mon Mar 27 08:29:17 2017 New Revision: 316015 URL: https://svnweb.freebsd.org/changeset/base/316015 Log: Extend comment describing path canonicalisation in audit. Sponsored by: DARPA, AFRL Obtained from: TrustedBSD Project MFC after: 3 days Modified: head/sys/security/audit/audit_arg.c Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Mon Mar 27 08:29:02 2017 (r316014) +++ head/sys/security/audit/audit_arg.c Mon Mar 27 08:29:17 2017 (r316015) @@ -708,7 +708,8 @@ audit_arg_file(struct proc *p, struct fi * Store a path as given by the user process for auditing into the audit * record stored on the user thread. This function will allocate the memory * to store the path info if not already available. This memory will be - * freed when the audit record is freed. + * freed when the audit record is freed. The path is canonlicalised with + * respect to the thread and directory descriptor passed. */ static void audit_arg_upath(struct thread *td, int dirfd, char *upath, char **pathp) From owner-svn-src-all@freebsd.org Mon Mar 27 08:29:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 08:31:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A98AD1E3A7; Mon, 27 Mar 2017 08:31:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D58B313A8; Mon, 27 Mar 2017 08:31:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id LAA13163; Mon, 27 Mar 2017 11:31:39 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1csQ3u-000GR4-Rz; Mon, 27 Mar 2017 11:31:38 +0300 Subject: Re: svn commit: r315959 - in head/sys: amd64/amd64 amd64/vmm amd64/vmm/amd i386/i386 x86/include x86/x86 x86/xen To: Chagin Dmitry References: <201703251845.v2PIj9k2029497@repo.freebsd.org> <20170326083021.GA1899@mordor.heemeyer.club> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: <1349a6c5-0fe3-b873-f372-4ec9046fa71f@FreeBSD.org> Date: Mon, 27 Mar 2017 11:30:42 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170326083021.GA1899@mordor.heemeyer.club> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 08:31:48 -0000 On 03/26/2017 11:30, Chagin Dmitry wrote: > On Sat, Mar 25, 2017 at 06:45:09PM +0000, Andriy Gapon wrote: >> Author: avg >> Date: Sat Mar 25 18:45:09 2017 >> New Revision: 315959 >> URL: https://svnweb.freebsd.org/changeset/base/315959 >> >> Log: >> specific end of interrupt implementation for AMD Local APIC >> >> The change is more intrusive than I would like because the feature >> requires that a vector number is written to a special register. >> Thus, now the vector number has to be provided to lapic_eoi(). >> It was readily available in the IO-APIC and MSI cases, but the IPI >> handlers required more work. >> Also, we now store the VMM IPI number in a global variable, so that it >> is available to the justreturn handler for the same reason. >> >> Reviewed by: kib >> MFC after: 6 weeks >> Differential Revision: https://reviews.freebsd.org/D9880 >> >> Modified: >> head/sys/amd64/amd64/apic_vector.S >> head/sys/amd64/amd64/genassym.c > > > > Hi, Andriy, u broke the build > > > /usr/local/bin/clang40 -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/home/git/head/sys -I/home/git/head/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.genassym.o -MTgenassym.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 /home/git/head/sys/amd64/amd64/genassym.c > In file included from /home/git/head/sys/amd64/amd64/genassym.c:47: > /home/git/head/sys/sys/bus.h:730:10: fatal error: 'device_if.h' file not found > #include "device_if.h" > ^~~~~~~~~~~~~ > 1 error generated. > *** Error code 1 I've got another report about this problem, but I can not reproduce it here with a clean kernel build of GENERIC. I am not sure what the problem is. Do you have anything unusual in make.conf, src.conf or your kernel configuration? -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Mar 27 09:45:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24210D1FEE2; Mon, 27 Mar 2017 09:45:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E81881AD9; Mon, 27 Mar 2017 09:45:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2R9jS1L001042; Mon, 27 Mar 2017 09:45:28 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2R9jSov001041; Mon, 27 Mar 2017 09:45:28 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703270945.v2R9jSov001041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Mar 2017 09:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316017 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 09:45:29 -0000 Author: avg Date: Mon Mar 27 09:45:27 2017 New Revision: 316017 URL: https://svnweb.freebsd.org/changeset/base/316017 Log: add SMT detection for newer AMD processors The change seems to be more in the nomenclature than in the way the topology is advertised by the hardware. Tested by: truckman (earlier version of the change) MFC after: 2 weeks Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Mar 27 08:29:46 2017 (r316016) +++ head/sys/x86/x86/mp_x86.c Mon Mar 27 09:45:27 2017 (r316017) @@ -255,6 +255,22 @@ topo_probe_amd(void) pkg_id_shift = mask_width((cpu_procinfo2 & AMDID_CMP_CORES) + 1); + /* + * Families prior to 16h define the following value as + * cores per compute unit and we don't really care about the AMD + * compute units at the moment. Perhaps we should treat them as + * cores and cores within the compute units as hardware threads, + * but that's up for debate. + * Later families define the value as threads per compute unit, + * so we are following AMD's nomenclature here. + */ + if ((amd_feature2 & AMDID2_TOPOLOGY) != 0 && + CPUID_TO_FAMILY(cpu_id) >= 0x16) { + cpuid_count(0x8000001e, 0, p); + share_count = ((p[1] >> 8) & 0xff) + 1; + core_id_shift = mask_width(share_count); + } + if ((amd_feature2 & AMDID2_TOPOLOGY) != 0) { for (i = 0; ; i++) { cpuid_count(0x8000001d, i, p); From owner-svn-src-all@freebsd.org Mon Mar 27 10:38:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B583BCA1165; Mon, 27 Mar 2017 10:38:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D658F6C; Mon, 27 Mar 2017 10:38:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RAcrVg021355; Mon, 27 Mar 2017 10:38:53 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RAcr6Q021351; Mon, 27 Mar 2017 10:38:53 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703271038.v2RAcr6Q021351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Mon, 27 Mar 2017 10:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316018 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 10:38:54 -0000 Author: rwatson Date: Mon Mar 27 10:38:53 2017 New Revision: 316018 URL: https://svnweb.freebsd.org/changeset/base/316018 Log: Introduce an audit event identifier -> audit event name mapping database in the kernel audit implementation, similar the exist class mapping database. This will be used by the DTrace audit provider to map audit event identifiers originating in the system-call table back into strings for the purposes of setting probe names. The database is initialised and maintained by auditd(8), which reads values in from the audit_events configuration file, and then manages them using the A_GETEVENT and A_SETEVENT auditon(2) operations. Obtained from: TrustedBSD Project Sponsored by: DARPA, AFRL MFC after: 3 weeks Modified: head/sys/security/audit/audit_bsm.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h head/sys/security/audit/audit_syscalls.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Mon Mar 27 09:45:27 2017 (r316017) +++ head/sys/security/audit/audit_bsm.c Mon Mar 27 10:38:53 2017 (r316018) @@ -1,7 +1,13 @@ /* * Copyright (c) 1999-2009 Apple Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -67,6 +73,7 @@ kau_init(void) { au_evclassmap_init(); + au_evnamemap_init(); } /* Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Mon Mar 27 09:45:27 2017 (r316017) +++ head/sys/security/audit/audit_bsm_klib.c Mon Mar 27 10:38:53 2017 (r316018) @@ -1,8 +1,13 @@ /* * Copyright (c) 1999-2009 Apple Inc. - * Copyright (c) 2005 Robert N. M. Watson + * Copyright (c) 2005, 2016 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -42,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -76,6 +82,30 @@ static struct evclass_list evclass_hash[ #define EVCLASS_WLOCK() rw_wlock(&evclass_lock) #define EVCLASS_WUNLOCK() rw_wunlock(&evclass_lock) +/* + * Hash table maintaining a mapping from audit event numbers to audit event + * names. For now, used only by DTrace, but present always so that userspace + * tools can register and inspect fields consistently even if DTrace is not + * present. + * + * struct evname_elem is defined in audit_private.h so that audit_dtrace.c can + * use the definition. + */ +#define EVNAMEMAP_HASH_TABLE_SIZE 251 +struct evname_list { + LIST_HEAD(, evname_elem) enl_head; +}; + +static MALLOC_DEFINE(M_AUDITEVNAME, "audit_evname", "Audit event name"); +static struct sx evnamemap_lock; +static struct evname_list evnamemap_hash[EVNAMEMAP_HASH_TABLE_SIZE]; + +#define EVNAMEMAP_LOCK_INIT() sx_init(&evnamemap_lock, "evnamemap_lock"); +#define EVNAMEMAP_RLOCK() sx_slock(&evnamemap_lock) +#define EVNAMEMAP_RUNLOCK() sx_sunlock(&evnamemap_lock) +#define EVNAMEMAP_WLOCK() sx_xlock(&evnamemap_lock) +#define EVNAMEMAP_WUNLOCK() sx_xunlock(&evnamemap_lock) + struct aue_open_event { int aoe_flags; au_event_t aoe_event; @@ -222,6 +252,117 @@ au_preselect(au_event_t event, au_class_ } /* + * Look up the name for an audit event in the event-to-name mapping table. + */ +int +au_event_name(au_event_t event, char *name) +{ + struct evname_list *enl; + struct evname_elem *ene; + int error; + + error = ENOENT; + EVNAMEMAP_RLOCK(); + enl = &evnamemap_hash[event % EVNAMEMAP_HASH_TABLE_SIZE]; + LIST_FOREACH(ene, &enl->enl_head, ene_entry) { + if (ene->ene_event == event) { + strlcpy(name, ene->ene_name, EVNAMEMAP_NAME_SIZE); + error = 0; + goto out; + } + } +out: + EVNAMEMAP_RUNLOCK(); + return (error); +} + +/* + * Insert a event-to-name mapping. If the event already exists in the + * mapping, then replace the mapping with the new one. + * + * XXX There is currently no constraints placed on the number of mappings. + * May want to either limit to a number, or in terms of memory usage. + * + * XXXRW: Accepts truncated name -- but perhaps should return failure instead? + * + * XXXRW: It could be we need a way to remove existing names...? + * + * XXXRW: We handle collisions between numbers, but I wonder if we also need a + * way to handle name collisions, for DTrace, where probe names must be + * unique? + */ +void +au_evnamemap_insert(au_event_t event, const char *name) +{ + struct evname_list *enl; + struct evname_elem *ene, *ene_new; + + /* + * Pessimistically, always allocate storage before acquiring lock. + * Free if there is already a mapping for this event. + */ + ene_new = malloc(sizeof(*ene_new), M_AUDITEVNAME, M_WAITOK | M_ZERO); + EVNAMEMAP_WLOCK(); + enl = &evnamemap_hash[event % EVNAMEMAP_HASH_TABLE_SIZE]; + LIST_FOREACH(ene, &enl->enl_head, ene_entry) { + if (ene->ene_event == event) { + EVNAME_LOCK(ene); + (void)strlcpy(ene->ene_name, name, + sizeof(ene->ene_name)); + EVNAME_UNLOCK(ene); + EVNAMEMAP_WUNLOCK(); + free(ene_new, M_AUDITEVNAME); + return; + } + } + ene = ene_new; + mtx_init(&ene->ene_lock, "au_evnamemap", NULL, MTX_DEF); + ene->ene_event = event; + (void)strlcpy(ene->ene_name, name, sizeof(ene->ene_name)); + LIST_INSERT_HEAD(&enl->enl_head, ene, ene_entry); + EVNAMEMAP_WUNLOCK(); +} + +void +au_evnamemap_init(void) +{ + int i; + + EVNAMEMAP_LOCK_INIT(); + for (i = 0; i < EVNAMEMAP_HASH_TABLE_SIZE; i++) + LIST_INIT(&evnamemap_hash[i].enl_head); + + /* + * XXXRW: Unlike the event-to-class mapping, we don't attempt to + * pre-populate the list. Perhaps we should...? But not sure we + * really want to duplicate /etc/security/audit_event in the kernel + * -- and we'd need a way to remove names? + */ +} + +/* + * The DTrace audit provider occasionally needs to walk the entries in the + * event-to-name mapping table, and uses this public interface to do so. A + * write lock is acquired so that the provider can safely update its fields in + * table entries. + */ +void +au_evnamemap_foreach(au_evnamemap_callback_t callback) +{ + struct evname_list *enl; + struct evname_elem *ene; + int i; + + EVNAMEMAP_WLOCK(); + for (i = 0; i < EVNAMEMAP_HASH_TABLE_SIZE; i++) { + enl = &evnamemap_hash[i]; + LIST_FOREACH(ene, &enl->enl_head, ene_entry) + callback(ene); + } + EVNAMEMAP_WUNLOCK(); +} + +/* * Convert sysctl names and present arguments to events. */ au_event_t Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Mon Mar 27 09:45:27 2017 (r316017) +++ head/sys/security/audit/audit_private.h Mon Mar 27 10:38:53 2017 (r316018) @@ -1,7 +1,13 @@ /*- * Copyright (c) 1999-2009 Apple Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -151,6 +157,7 @@ union auditon_udata { au_stat_t au_stat; au_fstat_t au_fstat; auditinfo_addr_t au_kau_info; + au_evname_map_t au_evname; }; struct posix_ipc_perm { @@ -368,6 +375,34 @@ extern int audit_in_failure; #define AUDIT_OPEN_FLAGS (FWRITE | O_APPEND) #define AUDIT_CLOSE_FLAGS (FWRITE | O_APPEND) +/* + * Audit event-to-name mapping structure, maintained in audit_bsm_klib.c. It + * appears in this header so that the DTrace audit provider can dereference + * instances passed back in the au_evname_foreach() callbacks. Safe access to + * its fields rquires holding ene_lock (after it is visible in the global + * table). + * + * Locking: + * (c) - Constant after inserted in the global table + * (l) - Protected by ene_lock + * (m) - Protected by evnamemap_lock (audit_bsm_klib.c) + * (M) - Writes protected by evnamemap_lock; reads unprotected. + */ +struct evname_elem { + au_event_t ene_event; /* (c) */ + char ene_name[EVNAMEMAP_NAME_SIZE]; /* (l) */ + LIST_ENTRY(evname_elem) ene_entry; /* (m) */ + struct mtx ene_lock; +}; + +#define EVNAME_LOCK(ene) mtx_lock(&(ene)->ene_lock) +#define EVNAME_UNLOCK(ene) mtx_unlock(&(ene)->ene_lock) + +/* + * Callback function typedef for the same. + */ +typedef void (*au_evnamemap_callback_t)(struct evname_elem *ene); + #include #include #include @@ -387,6 +422,10 @@ int au_preselect(au_event_t event, au_ void au_evclassmap_init(void); void au_evclassmap_insert(au_event_t event, au_class_t class); au_class_t au_event_class(au_event_t event); +void au_evnamemap_init(void); +void au_evnamemap_insert(au_event_t event, const char *name); +void au_evnamemap_foreach(au_evnamemap_callback_t callback); +int au_event_name(au_event_t event, char *name); au_event_t audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg); au_event_t audit_flags_and_error_to_openevent(int oflags, int error); au_event_t audit_flags_and_error_to_openatevent(int oflags, int error); Modified: head/sys/security/audit/audit_syscalls.c ============================================================================== --- head/sys/security/audit/audit_syscalls.c Mon Mar 27 09:45:27 2017 (r316017) +++ head/sys/security/audit/audit_syscalls.c Mon Mar 27 10:38:53 2017 (r316018) @@ -1,7 +1,13 @@ /*- * Copyright (c) 1999-2009 Apple Inc. + * Copyright (c) 2016 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -195,10 +201,12 @@ sys_auditon(struct thread *td, struct au case A_SETCOND: case A_OLDSETCOND: case A_SETCLASS: + case A_SETEVENT: case A_SETPMASK: case A_SETFSIZE: case A_SETKAUDIT: case A_GETCLASS: + case A_GETEVENT: case A_GETPINFO: case A_GETPINFO_ADDR: case A_SENDTRIGGER: @@ -404,6 +412,15 @@ sys_auditon(struct thread *td, struct au udata.au_evclass.ec_number); break; + case A_GETEVENT: + if (uap->length != sizeof(udata.au_evname)) + return (EINVAL); + error = au_event_name(udata.au_evname.en_number, + udata.au_evname.en_name); + if (error != 0) + return (error); + break; + case A_SETCLASS: if (uap->length != sizeof(udata.au_evclass)) return (EINVAL); @@ -411,6 +428,17 @@ sys_auditon(struct thread *td, struct au udata.au_evclass.ec_class); break; + case A_SETEVENT: + if (uap->length != sizeof(udata.au_evname)) + return (EINVAL); + + /* Ensure nul termination from userspace. */ + udata.au_evname.en_name[sizeof(udata.au_evname.en_name) - 1] + = 0; + au_evnamemap_insert(udata.au_evname.en_number, + udata.au_evname.en_name); + break; + case A_GETPINFO: if (uap->length != sizeof(udata.au_aupinfo)) return (EINVAL); From owner-svn-src-all@freebsd.org Mon Mar 27 10:48:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D0DCCA1738; Mon, 27 Mar 2017 10:48:30 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBCD89AD; Mon, 27 Mar 2017 10:48:29 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RAmTkP025598; Mon, 27 Mar 2017 10:48:29 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RAmS2u025596; Mon, 27 Mar 2017 10:48:28 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703271048.v2RAmS2u025596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 27 Mar 2017 10:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316019 - in head/sys: kern teken X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 10:48:30 -0000 Author: bde Date: Mon Mar 27 10:48:28 2017 New Revision: 316019 URL: https://svnweb.freebsd.org/changeset/base/316019 Log: Oops, my fix for bright colors broke bright black some more (in cases that used to work via the bold hack). Fix the table entry for bright black. Fix spelling of plain black in nearby table entries (use the macro for black everywhere everywhere). Fix the currently-unused non-bright color table to not have bright colors in entries 9-15. Improve nearby comments. Start converting to the xterm terminology and default rendering of "bright" instead of "light" for bright colors. Syscons wasn't affected by the bug since I optimized it a little by converting colors 0-15 directly. This also fixes the layering of the conversion for these colors. Apply the same optimization to vt (actually the layer above it). This also moves the conversion 1 closer to the correct layer for colors 0-15. The optimization of just avoiding 2 calls to a trivial function is worth about 10% for simple output to the virtual buffer with occasional rendering. The optimization is so large because the 2 calls are done on every character, so although there are too many other calls and other instructions per character, there are only about 10 times as many. Old versions of syscons were about 10 times faster for simple output, by using a fast path with about 12 instructions per character. Rendering to even slow hardware takes relatively little time provided it is rarely actually done. Modified: head/sys/kern/subr_terminal.c head/sys/teken/teken.c Modified: head/sys/kern/subr_terminal.c ============================================================================== --- head/sys/kern/subr_terminal.c Mon Mar 27 10:38:53 2017 (r316018) +++ head/sys/kern/subr_terminal.c Mon Mar 27 10:48:28 2017 (r316019) @@ -146,9 +146,18 @@ static const teken_attr_t default_messag TCOLOR_BG(_c & 7) | ((_c & 8) << 20); \ }) +#define TCOLOR_256TO16(color) __extension__ ({ \ + teken_color_t _c; \ + \ + _c = (color); \ + if (_c >= 16) \ + _c = teken_256to16(_c); \ + _c; \ +}) + #define TCHAR_CREATE(c, a) ((c) | TFORMAT((a)->ta_format) | \ - TCOLOR_FG_FUDGED(teken_256to16((a)->ta_fgcolor)) | \ - TCOLOR_BG_FUDGED(teken_256to16((a)->ta_bgcolor))) + TCOLOR_FG_FUDGED(TCOLOR_256TO16((a)->ta_fgcolor)) | \ + TCOLOR_BG_FUDGED(TCOLOR_256TO16((a)->ta_bgcolor))) static void terminal_init(struct terminal *tm) Modified: head/sys/teken/teken.c ============================================================================== --- head/sys/teken/teken.c Mon Mar 27 10:38:53 2017 (r316018) +++ head/sys/teken/teken.c Mon Mar 27 10:48:28 2017 (r316019) @@ -491,11 +491,11 @@ teken_state_numbers(teken_t *t, teken_ch * be twice as large as green in (0, 1, 2). */ static const teken_color_t teken_256to8tab[] = { - /* xterm-16+ 8 dark colors: */ - 0, r, g, y, b, m, c, w, + /* xterm normal colors: */ + k, r, g, y, b, m, c, w, - /* xterm-16+ 8 light colors: */ - 0, R, G, Y, B, M, C, W, + /* xterm bright colors: */ + k, r, g, y, b, m, c, w, /* Red0 submap. */ k, b, b, b, b, b, @@ -559,11 +559,11 @@ static const teken_color_t teken_256to8t * used for different fine tuning of the tables. */ static const teken_color_t teken_256to16tab[] = { - /* xterm-16+ 8 dark colors: */ - 0, r, g, y, b, m, c, w, + /* xterm normal colors: */ + k, r, g, y, b, m, c, w, - /* xterm-16+ 8 light colors: */ - 0, R, G, Y, B, M, C, W, + /* xterm bright colors: */ + K, R, G, Y, B, M, C, W, /* Red0 submap. */ k, b, b, b, b, b, From owner-svn-src-all@freebsd.org Mon Mar 27 11:04:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E14ECA1D47; Mon, 27 Mar 2017 11:04:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC2974D; Mon, 27 Mar 2017 11:04:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RB4vPv033665; Mon, 27 Mar 2017 11:04:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RB4vEi033664; Mon, 27 Mar 2017 11:04:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703271104.v2RB4vEi033664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Mar 2017 11:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316020 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 11:04:58 -0000 Author: avg Date: Mon Mar 27 11:04:57 2017 New Revision: 316020 URL: https://svnweb.freebsd.org/changeset/base/316020 Log: update comment describing topo_probe_amd() MFC after: 2 weeks MFC with: r316017 Modified: head/sys/x86/x86/mp_x86.c Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Mar 27 10:48:28 2017 (r316019) +++ head/sys/x86/x86/mp_x86.c Mon Mar 27 11:04:57 2017 (r316020) @@ -227,11 +227,10 @@ add_deterministic_cache(int type, int le * Determine topology of processing units and caches for AMD CPUs. * See: * - AMD CPUID Specification (Publication # 25481) - * - BKDG For AMD Family 10h Processors (Publication # 31116), section 2.15 * - BKDG for AMD NPT Family 0Fh Processors (Publication # 32559) - * XXX At the moment the code does not recognize grouping of AMD CMT threads, - * if supported, into cores, so each thread is treated as being in its own - * core. In other words, each logical CPU is considered to be a core. + * - BKDG For AMD Family 10h Processors (Publication # 31116) + * - BKDG For AMD Family 15h Models 00h-0Fh Processors (Publication # 42301) + * - BKDG For AMD Family 16h Models 00h-0Fh Processors (Publication # 48751) */ static void topo_probe_amd(void) From owner-svn-src-all@freebsd.org Mon Mar 27 11:05:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC373CA1E14; Mon, 27 Mar 2017 11:05:35 +0000 (UTC) (envelope-from dchagin@mordor.heemeyer.club) Received: from heemeyer.club (heemeyer.club [108.61.204.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "heemeyer.club", Issuer "heemeyer.club" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCC1989; Mon, 27 Mar 2017 11:05:34 +0000 (UTC) (envelope-from dchagin@mordor.heemeyer.club) Received: from mordor.heemeyer.club (dchagin.static.corbina.ru [78.107.232.239]) by heemeyer.club (8.15.2/8.15.1) with ESMTPS id v2RB5NFX087187 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Mar 2017 11:05:25 GMT (envelope-from dchagin@mordor.heemeyer.club) X-Authentication-Warning: heemeyer.club: Host dchagin.static.corbina.ru [78.107.232.239] claimed to be mordor.heemeyer.club Received: from mordor.heemeyer.club (localhost [127.0.0.1]) by mordor.heemeyer.club (8.15.2/8.15.1) with ESMTPS id v2RB5NLM010891 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 27 Mar 2017 14:05:23 +0300 (MSK) (envelope-from dchagin@mordor.heemeyer.club) Received: (from dchagin@localhost) by mordor.heemeyer.club (8.15.2/8.15.2/Submit) id v2RB5N7W010890; Mon, 27 Mar 2017 14:05:23 +0300 (MSK) (envelope-from dchagin) Date: Mon, 27 Mar 2017 14:05:23 +0300 From: Chagin Dmitry To: Andriy Gapon Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r315959 - in head/sys: amd64/amd64 amd64/vmm amd64/vmm/amd i386/i386 x86/include x86/x86 x86/xen Message-ID: <20170327110523.GA10879@mordor.heemeyer.club> References: <201703251845.v2PIj9k2029497@repo.freebsd.org> <20170326083021.GA1899@mordor.heemeyer.club> <1349a6c5-0fe3-b873-f372-4ec9046fa71f@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1349a6c5-0fe3-b873-f372-4ec9046fa71f@FreeBSD.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 11:05:35 -0000 On Mon, Mar 27, 2017 at 11:30:42AM +0300, Andriy Gapon wrote: > On 03/26/2017 11:30, Chagin Dmitry wrote: > > On Sat, Mar 25, 2017 at 06:45:09PM +0000, Andriy Gapon wrote: > >> Author: avg > >> Date: Sat Mar 25 18:45:09 2017 > >> New Revision: 315959 > >> URL: https://svnweb.freebsd.org/changeset/base/315959 > >> > >> Log: > >> specific end of interrupt implementation for AMD Local APIC > >> > >> The change is more intrusive than I would like because the feature > >> requires that a vector number is written to a special register. > >> Thus, now the vector number has to be provided to lapic_eoi(). > >> It was readily available in the IO-APIC and MSI cases, but the IPI > >> handlers required more work. > >> Also, we now store the VMM IPI number in a global variable, so that it > >> is available to the justreturn handler for the same reason. > >> > >> Reviewed by: kib > >> MFC after: 6 weeks > >> Differential Revision: https://reviews.freebsd.org/D9880 > >> > >> Modified: > >> head/sys/amd64/amd64/apic_vector.S > >> head/sys/amd64/amd64/genassym.c > > > > > > > > Hi, Andriy, u broke the build > > > > > > /usr/local/bin/clang40 -c -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/home/git/head/sys -I/home/git/head/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.genassym.o -MTgenassym.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 /home/git/head/sys/amd64/amd64/genassym.c > > In file included from /home/git/head/sys/amd64/amd64/genassym.c:47: > > /home/git/head/sys/sys/bus.h:730:10: fatal error: 'device_if.h' file not found > > #include "device_if.h" > > ^~~~~~~~~~~~~ > > 1 error generated. > > *** Error code 1 > > I've got another report about this problem, but I can not reproduce it here with > a clean kernel build of GENERIC. > I am not sure what the problem is. > Do you have anything unusual in make.conf, src.conf or your kernel configuration? > I believe it, but on my machine genassym.c is processed before device_if.m cat /etc/make.conf: SENDMAIL_CF_DIR= /usr/local/share/sendmail/cf DEFAULT_VERSIONS+=linux=c6_64 KERNCONF = YOY CFLAGS += -ferror-limit=1 DEBUG_FLAGS += -g MODULES_OVERRIDE+=usb/usb usb/xhci usb/ehci usb/ukbd usb/umass usb/uhid usb/ums MODULES_OVERRIDE+=vmm nmdm drm2/drm2 drm2/i915kms fdescfs MODULES_OVERRIDE+=linux linux64 linprocfs linsysfs procfs pseudofs linux_common acpi/acpi_ibm CC=/usr/local/bin/clang40 CXX=/usr/local/bin/clang++40 CPP=/usr/local/bin/clang-cpp40 cat /etc/src.conf: WITHOUT_GAMES=yes WITHOUT_HTML=yes WITHOUT_IPFILTER=yes WITHOUT_IPFW=yes WITHOUT_NDIS=yes WITHOUT_NIS=yes WITHOUT_SVNLITE=yes WITHOUT_SYSINSTALL=yes WITHOUT_TESTS=yes WITHOUT_CLANG_FULL=yes WITHOUT_CLANG_BOOTSTRAP=yes From owner-svn-src-all@freebsd.org Mon Mar 27 12:30:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8502DD20BDE; Mon, 27 Mar 2017 12:30:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB12784; Mon, 27 Mar 2017 12:30:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA13776; Mon, 27 Mar 2017 15:30:00 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1csTma-000Gdi-7T; Mon, 27 Mar 2017 15:30:00 +0300 Subject: Re: svn commit: r315959 - in head/sys: amd64/amd64 amd64/vmm amd64/vmm/amd i386/i386 x86/include x86/x86 x86/xen To: Chagin Dmitry References: <201703251845.v2PIj9k2029497@repo.freebsd.org> <20170326083021.GA1899@mordor.heemeyer.club> <1349a6c5-0fe3-b873-f372-4ec9046fa71f@FreeBSD.org> <20170327110523.GA10879@mordor.heemeyer.club> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Andriy Gapon Message-ID: Date: Mon, 27 Mar 2017 15:28:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170327110523.GA10879@mordor.heemeyer.club> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 12:30:03 -0000 On 27/03/2017 14:05, Chagin Dmitry wrote: > I believe it, but on my machine genassym.c is processed before device_if.m Yeah, looks like the order could be arbitrary because the dependency is not defined. Anyway, I am reverting the change. Thank you for the report and sorry for the trouble. -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Mar 27 12:34:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67B4CD20E2A; Mon, 27 Mar 2017 12:34:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 302A9C56; Mon, 27 Mar 2017 12:34:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RCYV4W072726; Mon, 27 Mar 2017 12:34:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RCYU0q072714; Mon, 27 Mar 2017 12:34:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201703271234.v2RCYU0q072714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 27 Mar 2017 12:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316021 - in head/sys: amd64/amd64 amd64/vmm amd64/vmm/amd i386/i386 x86/include x86/x86 x86/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 12:34:32 -0000 Author: avg Date: Mon Mar 27 12:34:29 2017 New Revision: 316021 URL: https://svnweb.freebsd.org/changeset/base/316021 Log: revert r315959 because it causes build problems The change introduced a dependency between genassym.c and header files generated from .m files, but that dependency is not specified in the make files. Also, the change could be not as useful as I thought it was. Reported by: dchagin, Manfred Antar , and many others Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/amd64/genassym.c head/sys/amd64/vmm/amd/svm.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_host.h head/sys/i386/i386/apic_vector.s head/sys/i386/i386/genassym.c head/sys/x86/include/apicvar.h head/sys/x86/x86/io_apic.c head/sys/x86/x86/local_apic.c head/sys/x86/x86/msi.c head/sys/x86/xen/xen_apic.c Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/amd64/amd64/apic_vector.S Mon Mar 27 12:34:29 2017 (r316021) @@ -50,6 +50,22 @@ #define LK #endif + .text + SUPERALIGN_TEXT + /* End Of Interrupt to APIC */ +as_lapic_eoi: + cmpl $0,x2apic_mode + jne 1f + movq lapic_map,%rax + movl $0,LA_EOI(%rax) + ret +1: + movl $MSR_APIC_EOI,%ecx + xorl %eax,%eax + xorl %edx,%edx + wrmsr + ret + /* * I/O Interrupt Entry Point. Rather than having one entry point for * each interrupt source, we use one entry point for each 32-bit word @@ -166,7 +182,7 @@ IDTVEC(xen_intr_upcall) SUPERALIGN_TEXT invltlb_ret: - call native_lapic_eoi + call as_lapic_eoi POP_FRAME jmp doreti_iret @@ -175,21 +191,18 @@ IDTVEC(invltlb) PUSH_FRAME call invltlb_handler - movl $IPI_INVLTLB, %edi jmp invltlb_ret IDTVEC(invltlb_pcid) PUSH_FRAME call invltlb_pcid_handler - movl $IPI_INVLTLB, %edi jmp invltlb_ret IDTVEC(invltlb_invpcid) PUSH_FRAME call invltlb_invpcid_handler - movl $IPI_INVLTLB, %edi jmp invltlb_ret /* @@ -202,7 +215,6 @@ IDTVEC(invlpg) PUSH_FRAME call invlpg_handler - movl $IPI_INVLPG, %edi jmp invltlb_ret /* @@ -214,7 +226,6 @@ IDTVEC(invlrng) PUSH_FRAME call invlrng_handler - movl $IPI_INVLRNG, %edi jmp invltlb_ret /* @@ -226,7 +237,6 @@ IDTVEC(invlcache) PUSH_FRAME call invlcache_handler - movl $IPI_INVLCACHE, %edi jmp invltlb_ret /* @@ -237,8 +247,7 @@ IDTVEC(invlcache) IDTVEC(ipi_intr_bitmap_handler) PUSH_FRAME - movl $IPI_BITMAP_VECTOR, %edi - call native_lapic_eoi + call as_lapic_eoi FAKE_MCOUNT(TF_RIP(%rsp)) @@ -254,8 +263,7 @@ IDTVEC(ipi_intr_bitmap_handler) IDTVEC(cpustop) PUSH_FRAME - movl $IPI_STOP, %edi - call native_lapic_eoi + call as_lapic_eoi call cpustop_handler jmp doreti @@ -269,8 +277,7 @@ IDTVEC(cpususpend) PUSH_FRAME call cpususpend_handler - movl $IPI_SUSPEND, %edi - call native_lapic_eoi + call as_lapic_eoi jmp doreti /* @@ -288,22 +295,37 @@ IDTVEC(rendezvous) incq (%rax) #endif call smp_rendezvous_action - movl $IPI_RENDEZVOUS, %edi - call native_lapic_eoi + call as_lapic_eoi jmp doreti /* * IPI handler whose purpose is to interrupt the CPU with minimum overhead. * This is used by bhyve to force a host cpu executing in guest context to * trap into the hypervisor. + * + * This handler is different from other IPI handlers in the following aspects: + * + * 1. It doesn't push a trapframe on the stack. + * + * This implies that a DDB backtrace involving 'justreturn' will skip the + * function that was interrupted by this handler. + * + * 2. It doesn't 'swapgs' when userspace is interrupted. + * + * The 'justreturn' handler does not access any pcpu data so it is not an + * issue. Moreover the 'justreturn' handler can only be interrupted by an NMI + * whose handler already doesn't trust GS.base when kernel code is interrupted. */ .text SUPERALIGN_TEXT IDTVEC(justreturn) - PUSH_FRAME - movl vmm_ipinum, %edi - call native_lapic_eoi - POP_FRAME + pushq %rax + pushq %rcx + pushq %rdx + call as_lapic_eoi + popq %rdx + popq %rcx + popq %rax jmp doreti_iret #endif /* SMP */ Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/amd64/amd64/genassym.c Mon Mar 27 12:34:29 2017 (r316021) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifdef HWPMC_HOOKS #include @@ -62,9 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include #include #include @@ -218,19 +215,10 @@ ASSYM(PC_LDT, offsetof(struct pcpu, pc_l ASSYM(PC_COMMONTSSP, offsetof(struct pcpu, pc_commontssp)); ASSYM(PC_TSS, offsetof(struct pcpu, pc_tss)); ASSYM(PC_PM_SAVE_CNT, offsetof(struct pcpu, pc_pm_save_cnt)); - + ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); -ASSYM(IPI_INVLTLB, IPI_INVLTLB); -ASSYM(IPI_INVLPG, IPI_INVLPG); -ASSYM(IPI_INVLRNG, IPI_INVLRNG); -ASSYM(IPI_INVLCACHE, IPI_INVLCACHE); -ASSYM(IPI_BITMAP_VECTOR, IPI_BITMAP_VECTOR); -ASSYM(IPI_STOP, IPI_STOP); -ASSYM(IPI_SUSPEND, IPI_SUSPEND); -ASSYM(IPI_RENDEZVOUS, IPI_RENDEZVOUS); - ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL)); ASSYM(KDSEL, GSEL(GDATA_SEL, SEL_KPL)); ASSYM(KUCSEL, GSEL(GUCODE_SEL, SEL_UPL)); Modified: head/sys/amd64/vmm/amd/svm.c ============================================================================== --- head/sys/amd64/vmm/amd/svm.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/amd64/vmm/amd/svm.c Mon Mar 27 12:34:29 2017 (r316021) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "vmm_host.h" #include "vmm_lapic.h" #include "vmm_stat.h" #include "vmm_ktr.h" @@ -1621,7 +1620,7 @@ svm_inj_interrupts(struct svm_softc *sc, * Although not explicitly specified in APMv2 the * relative priorities were verified empirically. */ - ipi_cpu(curcpu, vmm_ipinum); + ipi_cpu(curcpu, IPI_AST); /* XXX vmm_ipinum? */ } else { vm_nmi_clear(sc->vm, vcpu); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/amd64/vmm/vmm.c Mon Mar 27 12:34:29 2017 (r316021) @@ -215,6 +215,7 @@ SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detec &halt_detection_enabled, 0, "Halt VM if all vcpus execute HLT with interrupts disabled"); +static int vmm_ipinum; SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0, "IPI vector used for vcpu notifications"); Modified: head/sys/amd64/vmm/vmm_host.h ============================================================================== --- head/sys/amd64/vmm/vmm_host.h Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/amd64/vmm/vmm_host.h Mon Mar 27 12:34:29 2017 (r316021) @@ -33,8 +33,6 @@ #error "no user-serviceable parts inside" #endif -extern int vmm_ipinum; - struct xsave_limits { int xsave_enabled; uint64_t xcr0_allowed; Modified: head/sys/i386/i386/apic_vector.s ============================================================================== --- head/sys/i386/i386/apic_vector.s Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/i386/i386/apic_vector.s Mon Mar 27 12:34:29 2017 (r316021) @@ -44,6 +44,22 @@ #include "assym.s" + .text + SUPERALIGN_TEXT + /* End Of Interrupt to APIC */ +as_lapic_eoi: + cmpl $0,x2apic_mode + jne 1f + movl lapic_map,%eax + movl $0,LA_EOI(%eax) + ret +1: + movl $MSR_APIC_EOI,%ecx + xorl %eax,%eax + xorl %edx,%edx + wrmsr + ret + /* * I/O Interrupt Entry Point. Rather than having one entry point for * each interrupt source, we use one entry point for each 32-bit word @@ -172,8 +188,7 @@ IDTVEC(xen_intr_upcall) .text SUPERALIGN_TEXT invltlb_ret: - call native_lapic_eoi - add $4, %esp + call as_lapic_eoi POP_FRAME iret @@ -185,7 +200,6 @@ IDTVEC(invltlb) call invltlb_handler - pushl $IPI_INVLTLB jmp invltlb_ret /* @@ -200,7 +214,6 @@ IDTVEC(invlpg) call invlpg_handler - pushl $IPI_INVLPG jmp invltlb_ret /* @@ -215,7 +228,6 @@ IDTVEC(invlrng) call invlrng_handler - pushl $IPI_INVLRNG jmp invltlb_ret /* @@ -230,7 +242,6 @@ IDTVEC(invlcache) call invlcache_handler - pushl $IPI_INVLCACHE jmp invltlb_ret /* @@ -243,10 +254,8 @@ IDTVEC(ipi_intr_bitmap_handler) SET_KERNEL_SREGS cld - pushl $IPI_BITMAP_VECTOR - call native_lapic_eoi - add $4, %esp - + call as_lapic_eoi + FAKE_MCOUNT(TF_EIP(%esp)) call ipi_bitmap_handler @@ -263,9 +272,7 @@ IDTVEC(cpustop) SET_KERNEL_SREGS cld - pushl $IPI_STOP - call native_lapic_eoi - add $4, %esp + call as_lapic_eoi call cpustop_handler POP_FRAME @@ -281,9 +288,7 @@ IDTVEC(cpususpend) SET_KERNEL_SREGS cld - pushl $IPI_SUSPEND - call native_lapic_eoi - add $4, %esp + call as_lapic_eoi call cpususpend_handler POP_FRAME @@ -308,9 +313,7 @@ IDTVEC(rendezvous) #endif call smp_rendezvous_action - pushl $IPI_RENDEZVOUS - call native_lapic_eoi - add $4, %esp + call as_lapic_eoi POP_FRAME iret Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/i386/i386/genassym.c Mon Mar 27 12:34:29 2017 (r316021) @@ -70,10 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef DEV_APIC -#include -#include #include -#include #endif #include #include @@ -222,15 +219,6 @@ ASSYM(PC_PRIVATE_TSS, offsetof(struct pc #ifdef DEV_APIC ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); - -ASSYM(IPI_INVLTLB, IPI_INVLTLB); -ASSYM(IPI_INVLPG, IPI_INVLPG); -ASSYM(IPI_INVLRNG, IPI_INVLRNG); -ASSYM(IPI_INVLCACHE, IPI_INVLCACHE); -ASSYM(IPI_BITMAP_VECTOR, IPI_BITMAP_VECTOR); -ASSYM(IPI_STOP, IPI_STOP); -ASSYM(IPI_SUSPEND, IPI_SUSPEND); -ASSYM(IPI_RENDEZVOUS, IPI_RENDEZVOUS); #endif ASSYM(KCSEL, GSEL(GCODE_SEL, SEL_KPL)); Modified: head/sys/x86/include/apicvar.h ============================================================================== --- head/sys/x86/include/apicvar.h Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/x86/include/apicvar.h Mon Mar 27 12:34:29 2017 (r316021) @@ -210,7 +210,7 @@ struct apic_ops { void (*setup)(int); void (*dump)(const char *); void (*disable)(void); - void (*eoi)(u_int vector); + void (*eoi)(void); int (*id)(void); int (*intr_pending)(u_int); void (*set_logical_id)(u_int, u_int, u_int); @@ -301,10 +301,10 @@ lapic_disable(void) } static inline void -lapic_eoi(u_int vector) +lapic_eoi(void) { - apic_ops.eoi(vector); + apic_ops.eoi(); } static inline int @@ -469,7 +469,6 @@ lapic_set_lvt_triggermode(u_int apic_id, return (apic_ops.set_lvt_triggermode(apic_id, lvt, trigger)); } -void native_lapic_eoi(u_int vector); void lapic_handle_cmc(void); void lapic_handle_error(void); void lapic_handle_intr(int vector, struct trapframe *frame); Modified: head/sys/x86/x86/io_apic.c ============================================================================== --- head/sys/x86/x86/io_apic.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/x86/x86/io_apic.c Mon Mar 27 12:34:29 2017 (r316021) @@ -151,10 +151,10 @@ _ioapic_eoi_source(struct intsrc *isrc, volatile uint32_t *apic_eoi; uint32_t low1; - src = (struct ioapic_intsrc *)isrc; - lapic_eoi(src->io_vector); + lapic_eoi(); if (!lapic_eoi_suppression) return; + src = (struct ioapic_intsrc *)isrc; if (src->io_edgetrigger) return; io = (struct ioapic *)isrc->is_pic; Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/x86/x86/local_apic.c Mon Mar 27 12:34:29 2017 (r316021) @@ -83,9 +83,6 @@ __FBSDID("$FreeBSD$"); #define GSEL_APIC GSEL(GCODE_SEL, SEL_KPL) #endif -#define INTEL_SEOI 1 -#define AMD_SEOI 2 - /* Sanity checks on IDT vectors. */ CTASSERT(APIC_IO_INTS + APIC_NUM_IOINTS == APIC_TIMER_INT); CTASSERT(APIC_TIMER_INT < APIC_LOCAL_INTS); @@ -187,10 +184,6 @@ static struct eventtimer lapic_et; #ifdef SMP static uint64_t lapic_ipi_wait_mult; #endif -#ifdef __amd64__ -/* IPI vector used for VMM VCPU notifications. */ -int vmm_ipinum; -#endif SYSCTL_NODE(_hw, OID_AUTO, apic, CTLFLAG_RD, 0, "APIC options"); SYSCTL_INT(_hw_apic, OID_AUTO, x2apic_mode, CTLFLAG_RD, &x2apic_mode, 0, ""); @@ -319,6 +312,7 @@ static void native_lapic_xapic_mode(void static void native_lapic_setup(int boot); static void native_lapic_dump(const char *str); static void native_lapic_disable(void); +static void native_lapic_eoi(void); static int native_lapic_id(void); static int native_lapic_intr_pending(u_int vector); static u_int native_apic_cpuid(u_int apic_id); @@ -453,31 +447,6 @@ elvt_mode(struct lapic *la, u_int idx, u return (lvt_mode_impl(la, elvt, idx, value)); } -static inline uint32_t -amd_read_ext_features(void) -{ - uint32_t version; - - if (cpu_vendor_id != CPU_VENDOR_AMD) - return (0); - version = lapic_read32(LAPIC_VERSION); - if ((version & APIC_VER_AMD_EXT_SPACE) != 0) - return (lapic_read32(LAPIC_EXT_FEATURES)); - return (0); -} - -static inline uint32_t -amd_read_elvt_count(void) -{ - uint32_t extf; - uint32_t count; - - extf = amd_read_ext_features(); - count = (extf & APIC_EXTF_ELVT_MASK) >> APIC_EXTF_ELVT_SHIFT; - count = min(count, APIC_ELVT_MAX + 1); - return (count); -} - /* * Map the local APIC and setup necessary interrupt vectors. */ @@ -487,9 +456,9 @@ native_lapic_init(vm_paddr_t addr) #ifdef SMP uint64_t r, r1, r2, rx; #endif - uint32_t extf, ver; + uint32_t ver; u_int regs[4]; - int i, arat, seoi_enable; + int i, arat; /* * Enable x2APIC mode if possible. Map the local APIC @@ -577,27 +546,16 @@ native_lapic_init(vm_paddr_t addr) */ ver = lapic_read32(LAPIC_VERSION); if ((ver & APIC_VER_EOI_SUPPRESSION) != 0) { - lapic_eoi_suppression = INTEL_SEOI; - } else { - extf = amd_read_ext_features(); - if ((extf & APIC_EXTF_SEIO_CAP) != 0) - lapic_eoi_suppression = AMD_SEOI; - } - if (lapic_eoi_suppression != 0) { - seoi_enable = 1; + lapic_eoi_suppression = 1; if (vm_guest == VM_GUEST_KVM) { if (bootverbose) printf( "KVM -- disabling lapic eoi suppression\n"); - seoi_enable = 0; + lapic_eoi_suppression = 0; } TUNABLE_INT_FETCH("hw.lapic_eoi_suppression", - &seoi_enable); - if (seoi_enable == 0) - lapic_eoi_suppression = 0; + &lapic_eoi_suppression); } - if (lapic_eoi_suppression != 0) - printf("LAPIC specific EOI enabled\n"); #ifdef SMP #define LOOPS 100000 @@ -684,6 +642,32 @@ native_lapic_create(u_int apic_id, int b #endif } +static inline uint32_t +amd_read_ext_features(void) +{ + uint32_t version; + + if (cpu_vendor_id != CPU_VENDOR_AMD) + return (0); + version = lapic_read32(LAPIC_VERSION); + if ((version & APIC_VER_AMD_EXT_SPACE) != 0) + return (lapic_read32(LAPIC_EXT_FEATURES)); + else + return (0); +} + +static inline uint32_t +amd_read_elvt_count(void) +{ + uint32_t extf; + uint32_t count; + + extf = amd_read_ext_features(); + count = (extf & APIC_EXTF_ELVT_MASK) >> APIC_EXTF_ELVT_SHIFT; + count = min(count, APIC_ELVT_MAX + 1); + return (count); +} + /* * Dump contents of local APIC registers */ @@ -718,11 +702,9 @@ native_lapic_dump(const char* str) extf = amd_read_ext_features(); if (extf != 0) { printf(" AMD ext features: 0x%08x\n", extf); - extf = lapic_read32(LAPIC_EXT_CTRL); - printf(" AMD ext control: 0x%08x\n", extf); elvt_count = amd_read_elvt_count(); for (i = 0; i < elvt_count; i++) - printf(" AMD elvt%d: 0x%08x\n", i, + printf(" AMD elvt%d: 0x%08x\n", i, lapic_read32(LAPIC_EXT_LVT0 + i)); } } @@ -1040,15 +1022,9 @@ lapic_enable(void) value = lapic_read32(LAPIC_SVR); value &= ~(APIC_SVR_VECTOR | APIC_SVR_FOCUS); value |= APIC_SVR_FEN | APIC_SVR_SWEN | APIC_SPURIOUS_INT; - if (lapic_eoi_suppression == INTEL_SEOI) + if (lapic_eoi_suppression) value |= APIC_SVR_EOI_SUPPRESSION; lapic_write32(LAPIC_SVR, value); - - if (lapic_eoi_suppression == AMD_SEOI) { - value = lapic_read32(LAPIC_EXT_CTRL); - value |= APIC_EXTF_SEIO_CAP; - lapic_write32(LAPIC_EXT_CTRL, value); - } } /* Reset the local APIC on the BSP during resume. */ @@ -1251,14 +1227,11 @@ lapic_set_tpr(u_int vector) #endif } -void -native_lapic_eoi(u_int vector) +static void +native_lapic_eoi(void) { - if (lapic_eoi_suppression == AMD_SEOI) - lapic_write32(LAPIC_EXT_SEOI, vector); - else - lapic_write32_nofence(LAPIC_EOI, 0); + lapic_write32_nofence(LAPIC_EOI, 0); } void @@ -1279,7 +1252,7 @@ lapic_handle_timer(struct trapframe *fra struct thread *td; /* Send EOI first thing. */ - lapic_eoi(APIC_TIMER_INT); + lapic_eoi(); #if defined(SMP) && !defined(SCHED_ULE) /* @@ -1400,7 +1373,7 @@ void lapic_handle_cmc(void) { - lapic_eoi(APIC_CMC_INT); + lapic_eoi(); cmc_intr(); } @@ -1474,7 +1447,7 @@ lapic_handle_error(void) esr = lapic_read32(LAPIC_ESR); printf("CPU%d: local APIC error 0x%x\n", PCPU_GET(cpuid), esr); - lapic_eoi(APIC_ERROR_INT); + lapic_eoi(); } static u_int Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/x86/x86/msi.c Mon Mar 27 12:34:29 2017 (r316021) @@ -177,18 +177,16 @@ msi_enable_source(struct intsrc *isrc) static void msi_disable_source(struct intsrc *isrc, int eoi) { - struct msi_intsrc *msi = (struct msi_intsrc *)isrc; if (eoi == PIC_EOI) - lapic_eoi(msi->msi_vector); + lapic_eoi(); } static void msi_eoi_source(struct intsrc *isrc) { - struct msi_intsrc *msi = (struct msi_intsrc *)isrc; - lapic_eoi(msi->msi_vector); + lapic_eoi(); } static void Modified: head/sys/x86/xen/xen_apic.c ============================================================================== --- head/sys/x86/xen/xen_apic.c Mon Mar 27 11:04:57 2017 (r316020) +++ head/sys/x86/xen/xen_apic.c Mon Mar 27 12:34:29 2017 (r316021) @@ -147,7 +147,7 @@ xen_pv_lapic_is_x2apic(void) } static void -xen_pv_lapic_eoi(u_int vector) +xen_pv_lapic_eoi(void) { XEN_APIC_UNSUPPORTED; From owner-svn-src-all@freebsd.org Mon Mar 27 13:27:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B78D1F058; Mon, 27 Mar 2017 13:27:40 +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 9774572; Mon, 27 Mar 2017 13:27:40 +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 v2RDRdQb093204; Mon, 27 Mar 2017 13:27:39 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RDRdcp093203; Mon, 27 Mar 2017 13:27:39 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201703271327.v2RDRdcp093203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 27 Mar 2017 13:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316022 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 13:27:40 -0000 Author: jamie Date: Mon Mar 27 13:27:39 2017 New Revision: 316022 URL: https://svnweb.freebsd.org/changeset/base/316022 Log: Fix hexadecimal escape codes in jail.conf(5). PR: 218154 Submitted by: Masahiro Konishi MFC after: 3 days Modified: head/usr.sbin/jail/jaillex.l Modified: head/usr.sbin/jail/jaillex.l ============================================================================== --- head/usr.sbin/jail/jaillex.l Mon Mar 27 12:34:29 2017 (r316021) +++ head/usr.sbin/jail/jaillex.l Mon Mar 27 13:27:39 2017 (r316022) @@ -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-all@freebsd.org Mon Mar 27 13:37:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35276D1F538; Mon, 27 Mar 2017 13:37:42 +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 04C7E962; Mon, 27 Mar 2017 13:37:41 +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 v2RDbfpR097372; Mon, 27 Mar 2017 13:37:41 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RDbfSh097371; Mon, 27 Mar 2017 13:37:41 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201703271337.v2RDbfSh097371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 27 Mar 2017 13:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316023 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 13:37:42 -0000 Author: jamie Date: Mon Mar 27 13:37:40 2017 New Revision: 316023 URL: https://svnweb.freebsd.org/changeset/base/316023 Log: Same as r316022 (Fix hexadecimal escape codes in jail.conf(5)), but do it right this time. Reported by: Kyle Evans MFC after: 3 days Modified: head/usr.sbin/jail/jaillex.l Modified: head/usr.sbin/jail/jaillex.l ============================================================================== --- head/usr.sbin/jail/jaillex.l Mon Mar 27 13:27:39 2017 (r316022) +++ head/usr.sbin/jail/jaillex.l Mon Mar 27 13:37:40 2017 (r316023) @@ -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] <= 'F') + else if (s[1] >= 'a' && s[1] <= 'f') *d = *++s + (0xa - 'a'); else break; From owner-svn-src-all@freebsd.org Mon Mar 27 14:32:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F134D20869; Mon, 27 Mar 2017 14:32:35 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA34E07; Mon, 27 Mar 2017 14:32:35 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2REWYlJ021940; Mon, 27 Mar 2017 14:32:34 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2REWYDV021939; Mon, 27 Mar 2017 14:32:34 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201703271432.v2REWYDV021939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Mon, 27 Mar 2017 14:32:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316024 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 14:32:35 -0000 Author: pluknet Date: Mon Mar 27 14:32:34 2017 New Revision: 316024 URL: https://svnweb.freebsd.org/changeset/base/316024 Log: Fix pfil_add_hook() and pfil_remove_hook() type. Modified: head/share/man/man9/pfil.9 Modified: head/share/man/man9/pfil.9 ============================================================================== --- head/share/man/man9/pfil.9 Mon Mar 27 13:37:40 2017 (r316023) +++ head/share/man/man9/pfil.9 Mon Mar 27 14:32:34 2017 (r316024) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2013 +.Dd March 27, 2017 .Dt PFIL 9 .Os .Sh NAME @@ -57,9 +57,9 @@ typedef int (*pfil_func_t)(void *arg, st .Fn pfil_head_unregister "struct pfil_head *head" .Ft "struct pfil_head *" .Fn pfil_head_get "int af" "u_long dlt" -.Ft void +.Ft int .Fn pfil_add_hook "pfil_func_t" "void *arg" "int flags" "struct pfil_head *" -.Ft void +.Ft int .Fn pfil_remove_hook "pfil_func_t" "void *arg" "int flags" "struct pfil_head *" .Ft int .Fn pfil_run_hooks "struct pfil_head *head" "struct mbuf **mp" "struct ifnet *" "int dir" "struct inpcb *" From owner-svn-src-all@freebsd.org Mon Mar 27 14:37:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF702D209AE; Mon, 27 Mar 2017 14:37:36 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF154167; Mon, 27 Mar 2017 14:37:36 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2REbZPg022180; Mon, 27 Mar 2017 14:37:35 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2REbZP4022179; Mon, 27 Mar 2017 14:37:35 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201703271437.v2REbZP4022179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Mon, 27 Mar 2017 14:37:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316025 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 14:37:37 -0000 Author: pluknet Date: Mon Mar 27 14:37:35 2017 New Revision: 316025 URL: https://svnweb.freebsd.org/changeset/base/316025 Log: macOS 10.12 release date added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Mar 27 14:32:34 2017 (r316024) +++ head/share/misc/bsd-family-tree Mon Mar 27 14:37:35 2017 (r316025) @@ -705,6 +705,7 @@ FreeBSD 10.3 2016-04-04 [FBD] NetBSD 7.0.1 2016-05-22 [NBD] DragonFly 4.6.0 2016-08-02 [DFB] OpenBSD 6.0 2016-09-01 [OBD] +macOS 10.12 2016-09-20 [APL] FreeBSD 11.0 2016-10-10 [FBD] NetBSD 7.1 2017-03-11 [NBD] From owner-svn-src-all@freebsd.org Mon Mar 27 14:55:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31BC6D20FDA; Mon, 27 Mar 2017 14:55:25 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFAEDE40; Mon, 27 Mar 2017 14:55:24 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2REtOG6030148; Mon, 27 Mar 2017 14:55:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2REtOxW030147; Mon, 27 Mar 2017 14:55:24 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201703271455.v2REtOxW030147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 27 Mar 2017 14:55:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316026 - head/sys/dev/bnxt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 14:55:25 -0000 Author: sbruno Date: Mon Mar 27 14:55:23 2017 New Revision: 316026 URL: https://svnweb.freebsd.org/changeset/base/316026 Log: Change the default rss_type to M_HASHTYPE_OPAQUE_HASH. Submitted by: Venkat Duvvuru MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9905 Modified: head/sys/dev/bnxt/bnxt_txrx.c Modified: head/sys/dev/bnxt/bnxt_txrx.c ============================================================================== --- head/sys/dev/bnxt/bnxt_txrx.c Mon Mar 27 14:37:35 2017 (r316025) +++ head/sys/dev/bnxt/bnxt_txrx.c Mon Mar 27 14:55:23 2017 (r316026) @@ -452,7 +452,7 @@ bnxt_set_rsstype(if_rxd_info_t ri, uint8 ri->iri_rsstype = M_HASHTYPE_RSS_IPV6; break; default: - ri->iri_rsstype = M_HASHTYPE_OPAQUE; + ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH; break; } } From owner-svn-src-all@freebsd.org Mon Mar 27 15:08:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89508D20279; Mon, 27 Mar 2017 15:08:03 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5645781A; Mon, 27 Mar 2017 15:08:03 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RF82Go034546; Mon, 27 Mar 2017 15:08:02 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RF82Lk034545; Mon, 27 Mar 2017 15:08:02 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201703271508.v2RF82Lk034545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 27 Mar 2017 15:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316027 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 15:08:03 -0000 Author: sbruno Date: Mon Mar 27 15:08:02 2017 New Revision: 316027 URL: https://svnweb.freebsd.org/changeset/base/316027 Log: Access *correct* ifp data structure when debug sysctl is invoked. Submitted by: Kevin Bowling Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D10126 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Mar 27 14:55:23 2017 (r316026) +++ head/sys/dev/e1000/if_em.c Mon Mar 27 15:08:02 2017 (r316027) @@ -4341,16 +4341,17 @@ em_if_debug(if_ctx_t ctx) static void em_print_debug_info(struct adapter *adapter) { - device_t dev = adapter->dev; + device_t dev = iflib_get_dev(adapter->ctx); + struct ifnet *ifp = iflib_get_ifp(adapter->ctx); struct tx_ring *txr = &adapter->tx_queues->txr; struct rx_ring *rxr = &adapter->rx_queues->rxr; - if (if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING) + if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) printf("Interface is RUNNING "); else printf("Interface is NOT RUNNING\n"); - if (if_getdrvflags(adapter->ifp) & IFF_DRV_OACTIVE) + if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE) printf("and INACTIVE\n"); else printf("and ACTIVE\n"); From owner-svn-src-all@freebsd.org Mon Mar 27 15:20:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95DAD206D2; Mon, 27 Mar 2017 15:20:32 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 767BBFE6; Mon, 27 Mar 2017 15:20:32 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RFKVCI038848; Mon, 27 Mar 2017 15:20:31 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RFKVst038847; Mon, 27 Mar 2017 15:20:31 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201703271520.v2RFKVst038847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 27 Mar 2017 15:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316028 - head/usr.sbin/makefs/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 15:20:32 -0000 Author: brd (doc,ports committer) Date: Mon Mar 27 15:20:31 2017 New Revision: 316028 URL: https://svnweb.freebsd.org/changeset/base/316028 Log: Check to see if the kernel has cd9660 before running tests that require it Approved by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10096 Modified: head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Modified: head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh ============================================================================== --- head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Mar 27 15:08:02 2017 (r316027) +++ head/usr.sbin/makefs/tests/makefs_cd9660_tests.sh Mon Mar 27 15:20:31 2017 (r316028) @@ -61,6 +61,11 @@ check_base_iso9660_image_contents() atf_check -e empty -o empty -s exit:0 test -f $TEST_MOUNT_DIR/c } +check_cd9660_support() { + kldstat -m cd9660 || \ + atf_skip "Requires cd9660 filesystem support to be present in the kernel" +} + atf_test_case D_flag cleanup D_flag_body() { @@ -91,6 +96,8 @@ D_flag_cleanup() atf_test_case F_flag cleanup F_flag_body() { + check_cd9660_support + create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ @@ -110,6 +117,8 @@ F_flag_cleanup() atf_test_case from_mtree_spec_file cleanup from_mtree_spec_file_body() { + check_cd9660_support + create_test_inputs atf_check -e empty -o save:$TEST_SPEC_FILE -s exit:0 \ @@ -130,6 +139,8 @@ from_mtree_spec_file_cleanup() atf_test_case from_multiple_dirs cleanup from_multiple_dirs_body() { + check_cd9660_support + test_inputs_dir2=$TMPDIR/inputs2 create_test_inputs @@ -152,6 +163,8 @@ from_multiple_dirs_cleanup() atf_test_case from_single_dir cleanup from_single_dir_body() { + check_cd9660_support + create_test_inputs atf_check -e empty -o empty -s exit:0 \ From owner-svn-src-all@freebsd.org Mon Mar 27 15:37:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D211ED20E9C; Mon, 27 Mar 2017 15:37:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B39BAE94; Mon, 27 Mar 2017 15:37:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 068B73C39; Mon, 27 Mar 2017 15:37:54 +0000 (UTC) Date: Mon, 27 Mar 2017 15:37:54 +0000 From: Alexey Dokuchaev To: Sean Bruno Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316026 - head/sys/dev/bnxt Message-ID: <20170327153753.GA93974@FreeBSD.org> References: <201703271455.v2REtOxW030147@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703271455.v2REtOxW030147@repo.freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 15:37:54 -0000 On Mon, Mar 27, 2017 at 02:55:24PM +0000, Sean Bruno wrote: > New Revision: 316026 > URL: https://svnweb.freebsd.org/changeset/base/316026 > > Log: > Change the default rss_type to M_HASHTYPE_OPAQUE_HASH. > > Submitted by: Venkat Duvvuru > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D9905 Commit message should explain the changes, not just describe what's being obvious from the diff itself. (DR gives slightly more information, but still not enough.) ./danfe From owner-svn-src-all@freebsd.org Mon Mar 27 16:01:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 234B5D205F2; Mon, 27 Mar 2017 16:01:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5B9EE77; Mon, 27 Mar 2017 16:01:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RG1Gjr057278; Mon, 27 Mar 2017 16:01:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RG1GeY057276; Mon, 27 Mar 2017 16:01:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703271601.v2RG1GeY057276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 27 Mar 2017 16:01:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316029 - head/contrib/llvm/tools/lld/ELF X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 16:01:18 -0000 Author: emaste Date: Mon Mar 27 16:01:16 2017 New Revision: 316029 URL: https://svnweb.freebsd.org/changeset/base/316029 Log: lld: hack version and help output for compatibility with libtool GNU libtool checks the output from invoking the linker with --version and --help, in order to determine the linker "flavour" and the command- ine arguments to use for various link operations (e.g. generating shared libraries). To detect GNU ld it looks for the strings "GNU" and "supported targets:.*elf". Since LLD is compatible with GNU ld we include those same strings to fool libtool. Quoting from a comment in the change: This is somewhat ugly hack, but in reality, we had no choice other than doing this. Considering the very long release cycle of Libtool, it is not easy to improve it to recognize LLD as a GNU compatible linker in a timely manner. Even if we can make it, there are still a lot of "configure" scripts out there that are generated by old version of Libtool. We cannot convince every software developer to migrate to the latest version and re-generate scripts. So we have this hack. Upstream LLVM revisions r298532, r298568, r298591 Obtained from: LLVM MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp head/contrib/llvm/tools/lld/ELF/DriverUtils.cpp Modified: head/contrib/llvm/tools/lld/ELF/Driver.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Driver.cpp Mon Mar 27 15:20:31 2017 (r316028) +++ head/contrib/llvm/tools/lld/ELF/Driver.cpp Mon Mar 27 16:01:16 2017 (r316029) @@ -281,11 +281,27 @@ void LinkerDriver::main(ArrayRef Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB0B1D20649; Mon, 27 Mar 2017 16:01:45 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A70EE; Mon, 27 Mar 2017 16:01:45 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RG1ia5057346; Mon, 27 Mar 2017 16:01:44 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RG1iIr057345; Mon, 27 Mar 2017 16:01:44 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201703271601.v2RG1iIr057345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Mon, 27 Mar 2017 16:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316030 - head/usr.bin/sed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 16:01:45 -0000 Author: brd (doc,ports committer) Date: Mon Mar 27 16:01:44 2017 New Revision: 316030 URL: https://svnweb.freebsd.org/changeset/base/316030 Log: Add some useful examples to the sed man page. Reviewed by: wblock, bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9958 Modified: head/usr.bin/sed/sed.1 Modified: head/usr.bin/sed/sed.1 ============================================================================== --- head/usr.bin/sed/sed.1 Mon Mar 27 16:01:16 2017 (r316029) +++ head/usr.bin/sed/sed.1 Mon Mar 27 16:01:44 2017 (r316030) @@ -31,7 +31,7 @@ .\" @(#)sed.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd May 10, 2016 +.Dd March 27, 2017 .Dt SED 1 .Os .Sh NAME @@ -586,6 +586,36 @@ as described in .Xr environ 7 . .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Replace +.Ql bar +with +.Ql baz +when piped from another command: +.Bd -literal -offset indent +echo "An alternate word, like bar, is sometimes used in examples." | sed 's/bar/baz/' +.Ed +.Pp +Using backlashes can sometimes be hard to read and follow: +.Bd -literal -offset indent +echo "/home/example" | sed 's/\\/home\\/example/\\/usr\\/local\\/example/' +.Ed +.Pp +Using a different separator can be handy when working with paths: +.Bd -literal -offset indent +echo "/home/example" | sed 's#/home/example#/usr/local/example#' +.Ed +.Pp +Replace all occurances of +.Ql foo +with +.Ql bar +in the file +.Pa test.txt , +without creating a backup of the file: +.Bd -literal -offset indent +sed -i '' -e 's/foo/bar/' test.txt +.Ed .Sh SEE ALSO .Xr awk 1 , .Xr ed 1 , From owner-svn-src-all@freebsd.org Mon Mar 27 16:18:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27FDDD20C7F; Mon, 27 Mar 2017 16:18:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EBC1697; Mon, 27 Mar 2017 16:18:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RGIK6n063580; Mon, 27 Mar 2017 16:18:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RGIKtl063579; Mon, 27 Mar 2017 16:18:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201703271618.v2RGIKtl063579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Mar 2017 16:18:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316031 - head/sys/i386/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 16:18:21 -0000 Author: markj Date: Mon Mar 27 16:18:19 2017 New Revision: 316031 URL: https://svnweb.freebsd.org/changeset/base/316031 Log: Adjust the constraint for "src" in atomic_(f)cmpset_8. "r" is not sufficient to prevent the use of invalid byte-width registers with at least gcc. Reported and reviewed by: bde X-MFC-With: r315718 Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Mon Mar 27 16:01:44 2017 (r316030) +++ head/sys/i386/include/atomic.h Mon Mar 27 16:18:19 2017 (r316031) @@ -182,7 +182,7 @@ struct __hack * * Returns 0 on failure, non-zero on success. */ -#define ATOMIC_CMPSET(TYPE) \ +#define ATOMIC_CMPSET(TYPE, CONS) \ static __inline int \ atomic_cmpset_##TYPE(volatile u_##TYPE *dst, u_##TYPE expect, u_##TYPE src) \ { \ @@ -196,7 +196,7 @@ atomic_cmpset_##TYPE(volatile u_##TYPE * : "=q" (res), /* 0 */ \ "+m" (*dst), /* 1 */ \ "+a" (expect) /* 2 */ \ - : "r" (src) /* 3 */ \ + : CONS (src) /* 3 */ \ : "memory", "cc"); \ return (res); \ } \ @@ -214,14 +214,14 @@ atomic_fcmpset_##TYPE(volatile u_##TYPE : "=q" (res), /* 0 */ \ "+m" (*dst), /* 1 */ \ "+a" (*expect) /* 2 */ \ - : "r" (src) /* 3 */ \ + : CONS (src) /* 3 */ \ : "memory", "cc"); \ return (res); \ } -ATOMIC_CMPSET(char); -ATOMIC_CMPSET(short); -ATOMIC_CMPSET(int); +ATOMIC_CMPSET(char, "q"); +ATOMIC_CMPSET(short, "r"); +ATOMIC_CMPSET(int, "r"); /* * Atomically add the value of v to the integer pointed to by p and return From owner-svn-src-all@freebsd.org Mon Mar 27 16:25:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910BAD20FB8; Mon, 27 Mar 2017 16:25:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 606779D4; Mon, 27 Mar 2017 16:25:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RGPwrb067406; Mon, 27 Mar 2017 16:25:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RGPwB1067405; Mon, 27 Mar 2017 16:25:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201703271625.v2RGPwB1067405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Mar 2017 16:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316032 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 16:25:59 -0000 Author: markj Date: Mon Mar 27 16:25:58 2017 New Revision: 316032 URL: https://svnweb.freebsd.org/changeset/base/316032 Log: Refine r301173 a bit. - Don't execute any of g_mirror_shutdown_post_sync() when panicking. We cannot safely idle the mirror or stop synchronization in that state, and the current attempts to do so complicate debugging of gmirror itself. - Check for a non-NULL panicstr instead of using SCHEDULER_STOPPED(). The latter was added for use in the locking primitives. Reviewed by: mav, pjd MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Mon Mar 27 16:18:19 2017 (r316031) +++ head/sys/geom/mirror/g_mirror.c Mon Mar 27 16:25:58 2017 (r316032) @@ -3040,7 +3040,7 @@ g_mirror_destroy(struct g_mirror_softc * g_topology_assert_not(); sx_assert(&sc->sc_lock, SX_XLOCKED); - if (sc->sc_provider_open != 0 || SCHEDULER_STOPPED()) { + if (sc->sc_provider_open != 0) { switch (how) { case G_MIRROR_DESTROY_SOFT: G_MIRROR_DEBUG(1, @@ -3374,6 +3374,9 @@ g_mirror_shutdown_post_sync(void *arg, i struct g_mirror_softc *sc; int error; + if (panicstr != NULL) + return; + mp = arg; g_topology_lock(); g_mirror_shutdown = 1; From owner-svn-src-all@freebsd.org Mon Mar 27 17:04:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E12D20DB4; Mon, 27 Mar 2017 17:04:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 097338A7; Mon, 27 Mar 2017 17:04:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RH4CnT084247; Mon, 27 Mar 2017 17:04:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RH4BBl084239; Mon, 27 Mar 2017 17:04:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201703271704.v2RH4BBl084239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Mar 2017 17:04:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316033 - in head/sys/compat/linuxkpi/common: include/asm include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:04:13 -0000 Author: hselasky Date: Mon Mar 27 17:04:11 2017 New Revision: 316033 URL: https://svnweb.freebsd.org/changeset/base/316033 Log: Implement a series of physical page management related functions in the LinuxKPI for accessing user-space memory in the kernel. Add functions to hold and wire physical page(s) based on a given range of user-space virtual addresses. Add functions to get and put a reference on, wire, hold, mark accessed, copy and dirty a physical page. Add new VM related structures and defines as a preparation step for advancing the memory map capabilities of the LinuxKPI. Add function to figure out if a virtual address was allocated using malloc(). Add function to convert a virtual kernel address into its physical page pointer. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/compat/linuxkpi/common/include/linux/pfn.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/pfn_t.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/preempt.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/include/asm/pgtable.h head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/include/linux/page.h head/sys/compat/linuxkpi/common/include/linux/types.h head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/include/asm/pgtable.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/asm/pgtable.h Mon Mar 27 16:25:58 2017 (r316032) +++ head/sys/compat/linuxkpi/common/include/asm/pgtable.h Mon Mar 27 17:04:11 2017 (r316033) @@ -33,4 +33,11 @@ #include +typedef unsigned long pteval_t; +typedef unsigned long pmdval_t; +typedef unsigned long pudval_t; +typedef unsigned long pgdval_t; +typedef unsigned long pgprotval_t; +typedef struct page *pgtable_t; + #endif /* _ASM_PGTABLE_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Mon Mar 27 16:25:58 2017 (r316032) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Mon Mar 27 17:04:11 2017 (r316033) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. * Copyright (c) 2015 François Tigeot * Copyright (c) 2015 Matthew Dillon * All rights reserved. @@ -37,9 +37,57 @@ #include #include #include +#include + +#include #define PAGE_ALIGN(x) ALIGN(x, PAGE_SIZE) +/* + * Make sure our LinuxKPI defined virtual memory flags don't conflict + * with the ones defined by FreeBSD: + */ +CTASSERT((VM_PROT_ALL & -(1 << 8)) == 0); + +#define VM_PFNINTERNAL (1 << 8) /* FreeBSD private flag to vm_insert_pfn() */ +#define VM_MIXEDMAP (1 << 9) +#define VM_NORESERVE (1 << 10) +#define VM_PFNMAP (1 << 11) +#define VM_IO (1 << 12) +#define VM_MAYWRITE (1 << 13) +#define VM_DONTCOPY (1 << 14) +#define VM_DONTEXPAND (1 << 15) +#define VM_DONTDUMP (1 << 16) + +#define VMA_MAX_PREFAULT_RECORD 1 + +#define FOLL_WRITE (1 << 0) +#define FOLL_FORCE (1 << 1) + +#define VM_FAULT_OOM (1 << 0) +#define VM_FAULT_SIGBUS (1 << 1) +#define VM_FAULT_MAJOR (1 << 2) +#define VM_FAULT_WRITE (1 << 3) +#define VM_FAULT_HWPOISON (1 << 4) +#define VM_FAULT_HWPOISON_LARGE (1 << 5) +#define VM_FAULT_SIGSEGV (1 << 6) +#define VM_FAULT_NOPAGE (1 << 7) +#define VM_FAULT_LOCKED (1 << 8) +#define VM_FAULT_RETRY (1 << 9) +#define VM_FAULT_FALLBACK (1 << 10) + +#define FAULT_FLAG_WRITE (1 << 0) +#define FAULT_FLAG_MKWRITE (1 << 1) +#define FAULT_FLAG_ALLOW_RETRY (1 << 2) +#define FAULT_FLAG_RETRY_NOWAIT (1 << 3) +#define FAULT_FLAG_KILLABLE (1 << 4) +#define FAULT_FLAG_TRIED (1 << 5) +#define FAULT_FLAG_USER (1 << 6) +#define FAULT_FLAG_REMOTE (1 << 7) +#define FAULT_FLAG_INSTRUCTION (1 << 8) + +typedef int (*pte_fn_t)(pte_t *, pgtable_t, unsigned long addr, void *data); + struct vm_area_struct { vm_offset_t vm_start; vm_offset_t vm_end; @@ -49,6 +97,19 @@ struct vm_area_struct { vm_memattr_t vm_page_prot; }; +struct vm_fault { + unsigned int flags; + pgoff_t pgoff; + void *virtual_address; /* user-space address */ + struct page *page; +}; + +struct vm_operations_struct { + void (*open) (struct vm_area_struct *); + void (*close) (struct vm_area_struct *); + int (*fault) (struct vm_area_struct *, struct vm_fault *); +}; + /* * Compute log2 of the power of two rounded up count of pages * needed for size bytes. @@ -70,12 +131,11 @@ get_order(unsigned long size) static inline void * lowmem_page_address(struct page *page) { - - return page_address(page); + return (page_address(page)); } /* - * This only works via mmap ops. + * This only works via memory map operations. */ static inline int io_remap_pfn_range(struct vm_area_struct *vma, @@ -89,6 +149,27 @@ io_remap_pfn_range(struct vm_area_struct return (0); } +static inline int +apply_to_page_range(struct mm_struct *mm, unsigned long address, + unsigned long size, pte_fn_t fn, void *data) +{ + return (-ENOTSUP); +} + +static inline int +zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size) +{ + return (-ENOTSUP); +} + +static inline int +remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, + unsigned long pfn, unsigned long size, pgprot_t prot) +{ + return (-ENOTSUP); +} + static inline unsigned long vma_pages(struct vm_area_struct *vma) { @@ -104,9 +185,79 @@ set_page_dirty(struct vm_page *page) } static inline void +set_page_dirty_lock(struct vm_page *page) +{ + vm_page_lock(page); + vm_page_dirty(page); + vm_page_unlock(page); +} + +static inline void +mark_page_accessed(struct vm_page *page) +{ + vm_page_reference(page); +} + +static inline void get_page(struct vm_page *page) { + vm_page_lock(page); vm_page_hold(page); + vm_page_wire(page); + vm_page_unlock(page); +} + +extern long +get_user_pages(unsigned long start, unsigned long nr_pages, + int gup_flags, struct page **, + struct vm_area_struct **); + +extern int +__get_user_pages_fast(unsigned long start, int nr_pages, int write, + struct page **); + +extern long +get_user_pages_remote(struct task_struct *, struct mm_struct *, + unsigned long start, unsigned long nr_pages, + int gup_flags, struct page **, + struct vm_area_struct **); + +static inline void +put_page(struct vm_page *page) +{ + vm_page_lock(page); + vm_page_unwire(page, PQ_ACTIVE); + vm_page_unhold(page); + vm_page_unlock(page); +} + +#define copy_highpage(to, from) pmap_copy_page(from, to) + +static inline pgprot_t +vm_get_page_prot(unsigned long vm_flags) +{ + return (vm_flags & VM_PROT_ALL); +} + +extern int vm_insert_mixed(struct vm_area_struct *, unsigned long addr, pfn_t pfn); + +extern int +vm_insert_pfn(struct vm_area_struct *, unsigned long addr, + unsigned long pfn); + +extern int +vm_insert_pfn_prot(struct vm_area_struct *, unsigned long addr, + unsigned long pfn, pgprot_t pgprot); + +static inline vm_page_t +vmalloc_to_page(const void *addr) +{ + vm_paddr_t paddr; + + paddr = pmap_kextract((vm_offset_t)addr); + return (PHYS_TO_VM_PAGE(paddr)); } -#endif /* _LINUX_MM_H_ */ +extern int is_vmalloc_addr(const void *addr); + +#endif /* _LINUX_MM_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/page.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/page.h Mon Mar 27 16:25:58 2017 (r316032) +++ head/sys/compat/linuxkpi/common/include/linux/page.h Mon Mar 27 17:04:11 2017 (r316033) @@ -40,6 +40,9 @@ #include #include +typedef unsigned long pte_t; +typedef unsigned long pmd_t; +typedef unsigned long pgd_t; typedef unsigned long pgprot_t; #define page vm_page Added: head/sys/compat/linuxkpi/common/include/linux/pfn.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/pfn.h Mon Mar 27 17:04:11 2017 (r316033) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2017 Mellanox Technologies, Ltd. + * 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 unmodified, 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_PFN_H_ +#define _LINUX_PFN_H_ + +#include + +typedef struct { + u64 val; +} pfn_t; + +#define PFN_ALIGN(x) (((unsigned long)(x) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) +#define PFN_UP(x) (((x) + PAGE_SIZE - 1) >> PAGE_SHIFT) +#define PFN_DOWN(x) ((x) >> PAGE_SHIFT) +#define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) +#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT)) + +#endif /* _LINUX_PFN_H_ */ Added: head/sys/compat/linuxkpi/common/include/linux/pfn_t.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/pfn_t.h Mon Mar 27 17:04:11 2017 (r316033) @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2017 Mellanox Technologies, Ltd. + * 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 unmodified, 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_PFN_T_H_ +#define _LINUX_PFN_T_H_ + +#include + +CTASSERT(PAGE_SHIFT > 4); + +#define PFN_FLAGS_MASK (((u64)(PAGE_SIZE - 1)) << (64 - PAGE_SHIFT)) +#define PFN_SG_CHAIN (1ULL << (64 - 1)) +#define PFN_SG_LAST (1ULL << (64 - 2)) +#define PFN_DEV (1ULL << (64 - 3)) +#define PFN_MAP (1ULL << (64 - 4)) + +static inline pfn_t +__pfn_to_pfn_t(unsigned long pfn, u64 flags) +{ + pfn_t pfn_t = { pfn | (flags & PFN_FLAGS_MASK) }; + + return (pfn_t); +} + +static inline pfn_t +pfn_to_pfn_t(unsigned long pfn) +{ + return (__pfn_to_pfn_t (pfn, 0)); +} + +#endif /* _LINUX_PFN_T_H_ */ Added: head/sys/compat/linuxkpi/common/include/linux/preempt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/preempt.h Mon Mar 27 17:04:11 2017 (r316033) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2017 Mellanox Technologies, Ltd. + * 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 unmodified, 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_PREEMPT_H_ +#define _LINUX_PREEMPT_H_ + +#include + +#define in_interrupt() \ + (curthread->td_intr_nesting_level || curthread->td_critnest) + +#endif /* _LINUX_PREEMPT_H_ */ Modified: head/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/types.h Mon Mar 27 16:25:58 2017 (r316032) +++ head/sys/compat/linuxkpi/common/include/linux/types.h Mon Mar 27 17:04:11 2017 (r316033) @@ -58,6 +58,7 @@ typedef unsigned gfp_t; typedef uint64_t loff_t; typedef vm_paddr_t resource_size_t; typedef uint16_t __bitwise__ __sum16; +typedef unsigned long pgoff_t; typedef u64 phys_addr_t; Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Mon Mar 27 16:25:58 2017 (r316032) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Mon Mar 27 17:04:11 2017 (r316033) @@ -42,11 +42,26 @@ __FBSDID("$FreeBSD$"); #include -#include - #include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include void * linux_page_address(struct page *page) @@ -165,3 +180,105 @@ linux_free_kmem(vm_offset_t addr, unsign kmem_free(kmem_arena, addr, size); } + +static int +linux_get_user_pages_internal(vm_map_t map, unsigned long start, int nr_pages, + int write, struct page **pages) +{ + vm_prot_t prot; + size_t len; + int count; + int i; + + prot = write ? (VM_PROT_READ | VM_PROT_WRITE) : VM_PROT_READ; + len = ((size_t)nr_pages) << PAGE_SHIFT; + count = vm_fault_quick_hold_pages(map, start, len, prot, pages, nr_pages); + if (count == -1) + return (-EFAULT); + + for (i = 0; i != nr_pages; i++) { + struct page *pg = pages[i]; + + vm_page_lock(pg); + vm_page_wire(pg); + vm_page_unlock(pg); + } + return (nr_pages); +} + +int +__get_user_pages_fast(unsigned long start, int nr_pages, int write, + struct page **pages) +{ + vm_map_t map; + vm_page_t *mp; + vm_offset_t va; + vm_offset_t end; + vm_prot_t prot; + int count; + + if (nr_pages == 0 || in_interrupt()) + return (0); + + MPASS(pages != NULL); + va = start; + map = &curthread->td_proc->p_vmspace->vm_map; + end = start + (((size_t)nr_pages) << PAGE_SHIFT); + if (start < vm_map_min(map) || end > vm_map_max(map)) + return (-EINVAL); + prot = write ? (VM_PROT_READ | VM_PROT_WRITE) : VM_PROT_READ; + for (count = 0, mp = pages, va = start; va < end; + mp++, va += PAGE_SIZE, count++) { + *mp = pmap_extract_and_hold(map->pmap, va, prot); + if (*mp == NULL) + break; + + vm_page_lock(*mp); + vm_page_wire(*mp); + vm_page_unlock(*mp); + + if ((prot & VM_PROT_WRITE) != 0 && + (*mp)->dirty != VM_PAGE_BITS_ALL) { + /* + * Explicitly dirty the physical page. Otherwise, the + * caller's changes may go unnoticed because they are + * performed through an unmanaged mapping or by a DMA + * operation. + * + * The object lock is not held here. + * See vm_page_clear_dirty_mask(). + */ + vm_page_dirty(*mp); + } + } + return (count); +} + +long +get_user_pages_remote(struct task_struct *task, struct mm_struct *mm, + unsigned long start, unsigned long nr_pages, int gup_flags, + struct page **pages, struct vm_area_struct **vmas) +{ + vm_map_t map; + + map = &mm->vmspace->vm_map; + return (linux_get_user_pages_internal(map, start, nr_pages, + !!(gup_flags & FOLL_WRITE), pages)); +} + +long +get_user_pages(unsigned long start, unsigned long nr_pages, int gup_flags, + struct page **pages, struct vm_area_struct **vmas) +{ + vm_map_t map; + + map = &curthread->td_proc->p_vmspace->vm_map; + return (linux_get_user_pages_internal(map, start, nr_pages, + !!(gup_flags & FOLL_WRITE), pages)); +} + +int +is_vmalloc_addr(const void *addr) +{ + return (vtoslab((vm_offset_t)addr & ~UMA_SLAB_MASK) != NULL); +} From owner-svn-src-all@freebsd.org Mon Mar 27 17:09:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF406D20E6A; Mon, 27 Mar 2017 17:09:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABD82A4D; Mon, 27 Mar 2017 17:09:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RH9BIC084489; Mon, 27 Mar 2017 17:09:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RH9Bb9084488; Mon, 27 Mar 2017 17:09:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201703271709.v2RH9Bb9084488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Mar 2017 17:09:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316034 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:09:13 -0000 Author: hselasky Date: Mon Mar 27 17:09:11 2017 New Revision: 316034 URL: https://svnweb.freebsd.org/changeset/base/316034 Log: Add more platforms supporting the direct map feature in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_page.c Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Mon Mar 27 17:04:11 2017 (r316033) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Mon Mar 27 17:09:11 2017 (r316034) @@ -63,10 +63,16 @@ __FBSDID("$FreeBSD$"); #include #include +#if defined(__amd64__) || defined(__aarch64__) || defined(__riscv__) +#define LINUXKPI_HAVE_DMAP +#else +#undef LINUXKPI_HAVE_DMAP +#endif + void * linux_page_address(struct page *page) { -#ifdef __amd64__ +#ifdef LINUXKPI_HAVE_DMAP return ((void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(page))); #else if (page->object != kmem_object && page->object != kernel_object) @@ -79,7 +85,7 @@ linux_page_address(struct page *page) vm_page_t linux_alloc_pages(gfp_t flags, unsigned int order) { -#ifdef __amd64__ +#ifdef LINUXKPI_HAVE_DMAP unsigned long npages = 1UL << order; int req = (flags & M_ZERO) ? (VM_ALLOC_ZERO | VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL) : (VM_ALLOC_NOOBJ | VM_ALLOC_NORMAL); @@ -137,7 +143,7 @@ retry: void linux_free_pages(vm_page_t page, unsigned int order) { -#ifdef __amd64__ +#ifdef LINUXKPI_HAVE_DMAP unsigned long npages = 1UL << order; unsigned long x; From owner-svn-src-all@freebsd.org Mon Mar 27 17:18:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD8ED20089; Mon, 27 Mar 2017 17:18:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C395EC0; Mon, 27 Mar 2017 17:18:05 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RHI4Xj088350; Mon, 27 Mar 2017 17:18:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RHI41a088349; Mon, 27 Mar 2017 17:18:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201703271718.v2RHI41a088349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 27 Mar 2017 17:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316035 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:18:05 -0000 Author: hselasky Date: Mon Mar 27 17:18:04 2017 New Revision: 316035 URL: https://svnweb.freebsd.org/changeset/base/316035 Log: Implement vmalloc_32() in the LinuxKPI. Obtained from: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Mon Mar 27 17:09:11 2017 (r316034) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Mon Mar 27 17:18:04 2017 (r316035) @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -106,6 +107,12 @@ __vmalloc(size_t size, gfp_t flags, int } static inline void * +vmalloc_32(size_t size) +{ + return (contigmalloc(size, M_KMALLOC, M_WAITOK, 0, UINT_MAX, 1, 1)); +} + +static inline void * kmalloc_array(size_t n, size_t size, gfp_t flags) { if (size != 0 && n > (SIZE_MAX / size)) From owner-svn-src-all@freebsd.org Mon Mar 27 17:24:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C5A7D20403; Mon, 27 Mar 2017 17:24:16 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E06C7764; Mon, 27 Mar 2017 17:24:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 888A410A7B9; Mon, 27 Mar 2017 13:24:14 -0400 (EDT) From: John Baldwin To: Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315974 - in head: lib/libthread_db/arch/arm sys/arm/arm sys/arm/include Date: Mon, 27 Mar 2017 10:07:57 -0700 Message-ID: <1579704.6DjZ3RBGJe@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201703260836.v2Q8auoU069005@repo.freebsd.org> References: <201703260836.v2Q8auoU069005@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 27 Mar 2017 13:24:14 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:24:16 -0000 On Sunday, March 26, 2017 08:36:56 AM Michal Meloun wrote: > Author: mmel > Date: Sun Mar 26 08:36:56 2017 > New Revision: 315974 > URL: https://svnweb.freebsd.org/changeset/base/315974 > > Log: > Preserve VFP state across signal delivery. > > We don't have enouch space to store full VFP context within mcontext > stucture. Due to this: > - follow i386/amd64 way and store VFP state outside of the mcontext_t > but point to it. Use the size of VFP state structure as an 'magic' > indicator of the saved VFP state presence. > - teach set_mcontext() about this external storage. > - for signal delivery, store VFP state to expanded 'struct sigframe'. > > Submited by: Andrew Gierth (initial version) > PR: 217611 > MFC after: 2 weeks > > Modified: > head/lib/libthread_db/arch/arm/libpthread_md.c > head/sys/arm/arm/machdep.c > head/sys/arm/include/frame.h > head/sys/arm/include/ucontext.h > > Modified: head/lib/libthread_db/arch/arm/libpthread_md.c > ============================================================================== > --- head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:20 2017 (r315973) > +++ head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:56 2017 (r315974) > @@ -90,7 +90,9 @@ pt_fpreg_to_ucontext(const struct fpreg > mcontext_t *mc = &uc->uc_mcontext; > > /* XXX */ > - memset(&mc->mc_spare, 0, sizeof(mc->mc_spare)); > + mc->mc_vfp_size = 0; > + mc->mc_vfp_ptr = NULL; > + memset(mc->mc_spare, 0, sizeof(mc->mc_spare)); > } I suspect you don't need this bit? Has FreeBSD/arm ever supported VFP on a release that also shipped libkse? (i.e. not libthr but the other thread library) -- John Baldwin From owner-svn-src-all@freebsd.org Mon Mar 27 17:24:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82FE4D20468; Mon, 27 Mar 2017 17:24:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52A2F8AD; Mon, 27 Mar 2017 17:24:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RHOeIC092324; Mon, 27 Mar 2017 17:24:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RHOeuQ092323; Mon, 27 Mar 2017 17:24:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201703271724.v2RHOeuQ092323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 27 Mar 2017 17:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316036 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:24:41 -0000 Author: markj Date: Mon Mar 27 17:24:40 2017 New Revision: 316036 URL: https://svnweb.freebsd.org/changeset/base/316036 Log: Typo. MFC after: 1 week Modified: head/share/man/man4/rights.4 Modified: head/share/man/man4/rights.4 ============================================================================== --- head/share/man/man4/rights.4 Mon Mar 27 17:18:04 2017 (r316035) +++ head/share/man/man4/rights.4 Mon Mar 27 17:24:40 2017 (r316036) @@ -212,7 +212,7 @@ with the .Dv O_EXEC flag; .Dv CAP_READ -is also be required. +is also required. .It Dv CAP_FLOCK Permit .Xr flock 2 , From owner-svn-src-all@freebsd.org Mon Mar 27 17:27:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C2AED2066F; Mon, 27 Mar 2017 17:27:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EA70CC1; Mon, 27 Mar 2017 17:27:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RHRlnO092594; Mon, 27 Mar 2017 17:27:47 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RHRlYt092592; Mon, 27 Mar 2017 17:27:47 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201703271727.v2RHRlYt092592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Mon, 27 Mar 2017 17:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316037 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:27:48 -0000 Author: jpaetzel Date: Mon Mar 27 17:27:46 2017 New Revision: 316037 URL: https://svnweb.freebsd.org/changeset/base/316037 Log: MFV: 315989 7603 xuio_stat_wbuf_* should be declared (void) illumos/illumos-gate@99aa8b55058e512798eafbd71f72f916bdc10181 https://github.com/illumos/illumos-gate/commit/99aa8b55058e512798eafbd71f72f916bdc10181 https://www.illumos.org/issues/7603 The funcs are declared k&r style, where the args are not specified: void xuio_stat_wbuf_copied(); They should be declared to take no arguments: void xuio_stat_wbuf_copied(void); Need to change both .c and .h. Author: Prashanth Sreenivasa Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Robert Mustacchi Approved by: Richard Lowe Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Mar 27 17:24:40 2017 (r316036) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Mar 27 17:27:46 2017 (r316037) @@ -1124,13 +1124,13 @@ xuio_stat_fini(void) } void -xuio_stat_wbuf_copied() +xuio_stat_wbuf_copied(void) { XUIOSTAT_BUMP(xuiostat_wbuf_copied); } void -xuio_stat_wbuf_nocopy() +xuio_stat_wbuf_nocopy(void) { XUIOSTAT_BUMP(xuiostat_wbuf_nocopy); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Mar 27 17:24:40 2017 (r316036) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Mon Mar 27 17:27:46 2017 (r316037) @@ -762,8 +762,8 @@ int dmu_xuio_add(struct xuio *uio, struc int dmu_xuio_cnt(struct xuio *uio); struct arc_buf *dmu_xuio_arcbuf(struct xuio *uio, int i); void dmu_xuio_clear(struct xuio *uio, int i); -void xuio_stat_wbuf_copied(); -void xuio_stat_wbuf_nocopy(); +void xuio_stat_wbuf_copied(void); +void xuio_stat_wbuf_nocopy(void); extern boolean_t zfs_prefetch_disable; extern int zfs_max_recordsize; From owner-svn-src-all@freebsd.org Mon Mar 27 17:40:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D67D20A51 for ; Mon, 27 Mar 2017 17:40:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B07517E1 for ; Mon, 27 Mar 2017 17:40:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id e75so28536697itd.1 for ; Mon, 27 Mar 2017 10:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=iv71L95SuEQUl6NOly5QYv8Ja2wWSt7V6x6PEK0YZv4=; b=OPH8GvMe23TYINLsfwMzZjo9ApaouJnAo88c62EWCj6X1BgoVpzm3V6HjdnIN4mW2B XyoBJCx2BN6O6zkYZFfHNernUklkOR/mUxRyh+FkGoeFMMf8UXYrsz8R1qgIE5sctWwF XmKHiFimqCUHkuEoZ0O8lOP9ogN+9C6RAJeVWgjHhiQKm9d0zZeYWH6D+2lyp/clYSNW Jy2XuHKziRme1UJdp/+zFkeVHgqPyjEPHWI7Nv5XWv27SA3QqnVCNNliz1PCqKcYiFw0 B8K20fzcN8r4YzRI0cvvtxGC00zZqnpvcDnXMwu0NRCsPdN50HO4hFJjFMJuBt9iipPE 5/aQ== 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=iv71L95SuEQUl6NOly5QYv8Ja2wWSt7V6x6PEK0YZv4=; b=i64W/p+zxkR7IuIVKoz9mXURCthAj0vas93p57ktmRa8nLCJ9bqB0GyCSHLWh32rl0 7IkjP27bhr1iTEuf2MeNG1wmw9DaWqQizaRsHkaRjdvJA+1uowR8t5jT7rjpGALvM0qn IuQPBdE6BB8BK+Y+kBBxu0qCsqpbP2DTswh8AofU/MVNGzxHm0AVwQOrhNiQYAmSD5A2 ss+qO/xPoHQ7vwHW8d7a/x3HXdlFfpLE8USt+cEolOTPCuvsLZI3mTOPzsfW7aaN1x5n xP0EMFenlB6bGPXhE+BXnZNGL8lHWeL++p1oaOnEjWQbnVZIxij1gonJkKCFhzQsZ688 /E6A== X-Gm-Message-State: AFeK/H2n+3vCxPsrlWWcsz9O3Iq2tsuESqGQP++i+KV0q4NPdht8ItOSHebsRo83hMqd0SzTmU8INYqreoJgBA== X-Received: by 10.36.212.129 with SMTP id x123mr10484632itg.103.1490636403736; Mon, 27 Mar 2017 10:40:03 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Mon, 27 Mar 2017 10:40:03 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <1579704.6DjZ3RBGJe@ralph.baldwin.cx> References: <201703260836.v2Q8auoU069005@repo.freebsd.org> <1579704.6DjZ3RBGJe@ralph.baldwin.cx> From: Warner Losh Date: Mon, 27 Mar 2017 11:40:03 -0600 X-Google-Sender-Auth: 0ARsp_fpLSv7x7WrytZMRbcSVqE Message-ID: Subject: Re: svn commit: r315974 - in head: lib/libthread_db/arch/arm sys/arm/arm sys/arm/include To: John Baldwin Cc: Michal Meloun , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:40:06 -0000 On Mon, Mar 27, 2017 at 11:07 AM, John Baldwin wrote: > On Sunday, March 26, 2017 08:36:56 AM Michal Meloun wrote: >> Author: mmel >> Date: Sun Mar 26 08:36:56 2017 >> New Revision: 315974 >> URL: https://svnweb.freebsd.org/changeset/base/315974 >> >> Log: >> Preserve VFP state across signal delivery. >> >> We don't have enouch space to store full VFP context within mcontext >> stucture. Due to this: >> - follow i386/amd64 way and store VFP state outside of the mcontext_t >> but point to it. Use the size of VFP state structure as an 'magic' >> indicator of the saved VFP state presence. >> - teach set_mcontext() about this external storage. >> - for signal delivery, store VFP state to expanded 'struct sigframe'. >> >> Submited by: Andrew Gierth (initial version) >> PR: 217611 >> MFC after: 2 weeks >> >> Modified: >> head/lib/libthread_db/arch/arm/libpthread_md.c >> head/sys/arm/arm/machdep.c >> head/sys/arm/include/frame.h >> head/sys/arm/include/ucontext.h >> >> Modified: head/lib/libthread_db/arch/arm/libpthread_md.c >> ============================================================================== >> --- head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:20 2017 (r315973) >> +++ head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:56 2017 (r315974) >> @@ -90,7 +90,9 @@ pt_fpreg_to_ucontext(const struct fpreg >> mcontext_t *mc = &uc->uc_mcontext; >> >> /* XXX */ >> - memset(&mc->mc_spare, 0, sizeof(mc->mc_spare)); >> + mc->mc_vfp_size = 0; >> + mc->mc_vfp_ptr = NULL; >> + memset(mc->mc_spare, 0, sizeof(mc->mc_spare)); >> } > > I suspect you don't need this bit? Has FreeBSD/arm ever supported VFP on a release > that also shipped libkse? (i.e. not libthr but the other thread library) No. And even if we had, we blew up binary compat when we went from OABI to EABI. Warner From owner-svn-src-all@freebsd.org Mon Mar 27 18:20:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED026D20B38; Mon, 27 Mar 2017 18:20:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A29618BF; Mon, 27 Mar 2017 18:20:33 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RIKWUx015220; Mon, 27 Mar 2017 18:20:32 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIKW9E014994; Mon, 27 Mar 2017 18:20:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201703271820.v2RIKW9E014994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 27 Mar 2017 18:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316038 - in head/sys/modules: . tcp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:20:34 -0000 Author: tuexen Date: Mon Mar 27 18:20:32 2017 New Revision: 316038 URL: https://svnweb.freebsd.org/changeset/base/316038 Log: Tweak the Makefiles a bit to allow using "tcp" in MODULES_OVERRIDE to build the tcp modules. Sponsored by: Netflix, Inc. Added: head/sys/modules/tcp/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Mar 27 17:27:46 2017 (r316037) +++ head/sys/modules/Makefile Mon Mar 27 18:20:32 2017 (r316038) @@ -355,9 +355,8 @@ SUBDIR= \ ${_sym} \ ${_syscons} \ sysvipc \ + tcp \ ${_ti} \ - ${_tcp_fastpath} \ - ${_tcpmd5} \ tests/framework \ tests/callout_test \ tl \ @@ -437,10 +436,6 @@ _random_other= random_other SUBDIR+= cuse .endif -.if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES) -_tcp_fastpath= tcp/fastpath -.endif - .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _carp= carp @@ -450,7 +445,6 @@ _if_gif= if_gif _if_gre= if_gre .if ${MK_IPSEC_SUPPORT} != "no" _ipsec= ipsec -_tcpmd5= tcp/tcpmd5 .endif .endif Added: head/sys/modules/tcp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tcp/Makefile Mon Mar 27 18:20:32 2017 (r316038) @@ -0,0 +1,23 @@ +# +# $FreeBSD$ +# + +SYSDIR?=${SRCTOP}/sys +.include "${SYSDIR}/conf/kern.opts.mk" + +SUBDIR= \ + ${_tcp_fastpath} \ + ${_tcpmd5} \ + +.if ${MK_EXTRA_TCP_STACKS} != "no" || defined(ALL_MODULES) +_tcp_fastpath= fastpath +.endif + +.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ + defined(ALL_MODULES) +.if ${MK_IPSEC_SUPPORT} != "no" +_tcpmd5= tcpmd5 +.endif +.endif + +.include From owner-svn-src-all@freebsd.org Mon Mar 27 18:22:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:23:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:24:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:24:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:26:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:26:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:28:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:28:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:29:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:31:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-all@freebsd.org Mon Mar 27 18:40:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ADCAD2098E; Mon, 27 Mar 2017 18:40: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 3AA07CD1; Mon, 27 Mar 2017 18:40: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 v2RIeKek023555; Mon, 27 Mar 2017 18:40:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIeKsM023554; Mon, 27 Mar 2017 18:40:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271840.v2RIeKsM023554@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:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316049 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:40:21 -0000 Author: ngie Date: Mon Mar 27 18:40:20 2017 New Revision: 316049 URL: https://svnweb.freebsd.org/changeset/base/316049 Log: Allow WARNS to be overridden by the end-user MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/ctld/Makefile Modified: head/usr.sbin/ctld/Makefile ============================================================================== --- head/usr.sbin/ctld/Makefile Mon Mar 27 18:31:00 2017 (r316048) +++ head/usr.sbin/ctld/Makefile Mon Mar 27 18:40:20 2017 (r316049) @@ -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-all@freebsd.org Mon Mar 27 18:59:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C47D203E9; Mon, 27 Mar 2017 18:59: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 65F97CB0; Mon, 27 Mar 2017 18:59: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 v2RIxnhL031511; Mon, 27 Mar 2017 18:59:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RIxn1G031510; Mon, 27 Mar 2017 18:59:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271859.v2RIxn1G031510@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:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316050 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 18:59:50 -0000 Author: ngie Date: Mon Mar 27 18:59:49 2017 New Revision: 316050 URL: https://svnweb.freebsd.org/changeset/base/316050 Log: ctld: sort #includes per style(9) - Only include sys/types.h or sys/param.h, not both. - Sort alphabetically. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Mon Mar 27 18:40:20 2017 (r316049) +++ head/usr.sbin/ctld/kernel.c Mon Mar 27 18:59:49 2017 (r316050) @@ -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-all@freebsd.org Mon Mar 27 19:01:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFB7ED2067A; Mon, 27 Mar 2017 19:01: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 AF7B5F52; Mon, 27 Mar 2017 19:01: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 v2RJ1Y6r032311; Mon, 27 Mar 2017 19:01:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RJ1Ycu032310; Mon, 27 Mar 2017 19:01:34 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271901.v2RJ1Ycu032310@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 19:01:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316051 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 19:01:36 -0000 Author: ngie Date: Mon Mar 27 19:01:34 2017 New Revision: 316051 URL: https://svnweb.freebsd.org/changeset/base/316051 Log: ctldadm: sort #includes per style(9) - Only include sys/types.h or sys/param.h, not both. - Sort alphabetically. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/ctladm/ctladm.c Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Mon Mar 27 18:59:49 2017 (r316050) +++ head/usr.sbin/ctladm/ctladm.c Mon Mar 27 19:01:34 2017 (r316051) @@ -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 From owner-svn-src-all@freebsd.org Mon Mar 27 19:06:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60ADCD20852; Mon, 27 Mar 2017 19:06:30 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD36617; Mon, 27 Mar 2017 19:06:30 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RJ6TPP035334; Mon, 27 Mar 2017 19:06:29 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RJ6Ttd035333; Mon, 27 Mar 2017 19:06:29 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201703271906.v2RJ6Ttd035333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Mon, 27 Mar 2017 19:06:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316052 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 19:06:30 -0000 Author: mizhka Date: Mon Mar 27 19:06:29 2017 New Revision: 316052 URL: https://svnweb.freebsd.org/changeset/base/316052 Log: [etherswitch] add support for Marvell 88E6065 ethernet switch incl. 802.1q This patch brings 802.1q support for Marvell 88E606x ethernet switches. Test is done on 88E6065 chip (Aterm WR1200). Submitted by: Hiroki Mori Reviewed by: mizhka MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D10144 Modified: head/sys/dev/etherswitch/e6000sw/e6060sw.c Modified: head/sys/dev/etherswitch/e6000sw/e6060sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6060sw.c Mon Mar 27 19:01:34 2017 (r316051) +++ head/sys/dev/etherswitch/e6000sw/e6060sw.c Mon Mar 27 19:06:29 2017 (r316052) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Hiroki Mori + * Copyright (c) 2016-2017 Hiroki Mori * Copyright (c) 2013 Luiz Otavio O Souza. * Copyright (c) 2011-2012 Stefan Bethke. * Copyright (c) 2012 Adrian Chadd. @@ -32,8 +32,9 @@ /* * This code is Marvell 88E6060 ethernet switch support code on etherswitch * framework. - * Current code is only support port base vlan. Not support ingress/egress - * trailer. This switch chip can't work vlan(4) support. + * 88E6060 support is only port vlan support. Not support ingress/egress + * trailer. + * 88E6065 support is port and dot1q vlan. Also group base tag support. */ #include @@ -66,11 +67,43 @@ #include "miibus_if.h" #include "etherswitch_if.h" -#define SMI_OFFSET 0x10 -#define CORE_REGISTER (SMI_OFFSET + 8) - +#define CORE_REGISTER 0x8 #define SWITCH_ID 3 + +#define PORT_CONTROL 4 +#define ENGRESSFSHIFT 2 +#define ENGRESSFMASK 3 +#define ENGRESSTAGSHIFT 12 +#define ENGRESSTAGMASK 3 + #define PORT_VLAN_MAP 6 +#define FORCEMAPSHIFT 8 +#define FORCEMAPMASK 1 + +#define PORT_DEFVLAN 7 +#define DEFVIDMASK 0xfff +#define DEFPRIMASK 7 + +#define PORT_CONTROL2 8 +#define DOT1QMODESHIFT 10 +#define DOT1QMODEMASK 3 +#define DOT1QNONE 0 +#define DOT1QFALLBACK 1 +#define DOT1QCHECK 2 +#define DOT1QSECURE 3 + +#define GLOBAL_REGISTER 0xf + +#define VTU_OPERATION 5 +#define VTU_VID_REG 6 +#define VTU_DATA1_REG 7 +#define VTU_DATA2_REG 8 +#define VTU_DATA3_REG 9 +#define VTU_BUSY 0x8000 +#define VTU_FLASH 1 +#define VTU_LOAD_PURGE 3 +#define VTU_GET_NEXT 4 +#define VTU_VIOLATION 7 MALLOC_DECLARE(M_E6060SW); MALLOC_DEFINE(M_E6060SW, "e6060sw", "e6060sw data structures"); @@ -90,8 +123,16 @@ struct e6060sw_softc { struct ifnet **ifp; struct callout callout_tick; etherswitch_info_t info; + int smi_offset; + int sw_model; }; +/* Switch Identifier DeviceID */ + +#define E6060 0x60 +#define E6063 0x63 +#define E6065 0x65 + #define E6060SW_LOCK(_sc) \ mtx_lock(&(_sc)->sc_mtx) #define E6060SW_UNLOCK(_sc) \ @@ -112,24 +153,50 @@ static void e6060sw_tick(void *); static int e6060sw_ifmedia_upd(struct ifnet *); static void e6060sw_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static void e6060sw_setup(device_t dev); +static int e6060sw_read_vtu(device_t dev, int num, int *data1, int *data2); +static void e6060sw_set_vtu(device_t dev, int num, int data1, int data2); + static int e6060sw_probe(device_t dev) { int data; struct e6060sw_softc *sc; + int devid, i; + char *devname; + char desc[80]; sc = device_get_softc(dev); bzero(sc, sizeof(*sc)); - data = MDIO_READREG(device_get_parent(dev), CORE_REGISTER, SWITCH_ID); - if (bootverbose) - device_printf(dev,"Switch Identifier Register %x\n", data); - - if ((data >> 4) != 0x060) { - return (ENXIO); + for (i = 0; i < 2; ++i) { + data = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + i * 0x10, SWITCH_ID); + if (bootverbose) + device_printf(dev,"Switch Identifier Register %x\n", + data); + + devid = data >> 4; + if (devid == E6060 || + devid == E6063 || devid == E6065) { + sc->sw_model = devid; + sc->smi_offset = i * 0x10; + break; + } } + if (i == 2) + return (ENXIO); + + if (devid == E6060) + devname = "88E6060"; + else if (devid == E6063) + devname = "88E6063"; + else if (devid == E6065) + devname = "88E6065"; + sprintf(desc, "Marvell %s MDIO switch driver at 0x%02x", + devname, sc->smi_offset); + device_set_desc_copy(dev, desc); - device_set_desc_copy(dev, "Marvell 88E6060 MDIO switch driver"); return (BUS_PROBE_DEFAULT); } @@ -157,7 +224,7 @@ e6060sw_attach_phys(struct e6060sw_softc M_WAITOK | M_ZERO); err = mii_attach(sc->sc_dev, sc->miibus[port], sc->ifp[port], e6060sw_ifmedia_upd, e6060sw_ifmedia_sts, \ - BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); + BMSR_DEFCAPMASK, phy + sc->smi_offset, MII_OFFSET_ANY, 0); DPRINTF(sc->sc_dev, "%s attached to pseudo interface %s\n", device_get_nameunit(*sc->miibus[port]), sc->ifp[port]->if_xname); @@ -194,9 +261,15 @@ e6060sw_attach(device_t dev) sizeof(sc->info.es_name)); /* XXX Defaults */ - sc->numports = 6; - sc->phymask = 0x1f; - sc->cpuport = 5; + if (sc->sw_model == E6063) { + sc->numports = 3; + sc->phymask = 0x07; + sc->cpuport = 2; + } else { + sc->numports = 6; + sc->phymask = 0x1f; + sc->cpuport = 5; + } sc->media = 100; (void) resource_int_value(device_get_name(dev), device_get_unit(dev), @@ -208,8 +281,16 @@ e6060sw_attach(device_t dev) (void) resource_int_value(device_get_name(dev), device_get_unit(dev), "media", &sc->media); - sc->info.es_nvlangroups = sc->numports; - sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT; + if (sc->sw_model == E6060) { + sc->info.es_nvlangroups = sc->numports; + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT; + } else { + sc->info.es_nvlangroups = 64; + sc->info.es_vlan_caps = ETHERSWITCH_VLAN_PORT | + ETHERSWITCH_VLAN_DOT1Q; + } + + e6060sw_setup(dev); sc->ifp = malloc(sizeof(struct ifnet *) * sc->numports, M_E6060SW, M_WAITOK | M_ZERO); @@ -388,7 +469,13 @@ e6060sw_getport(device_t dev, etherswitc if (p->es_port < 0 || p->es_port >= sc->numports) return (ENXIO); + p->es_pvid = 0; + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + p->es_pvid = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + p->es_port, + PORT_DEFVLAN) & 0xfff; + } phy = sc->portphy[p->es_port]; mii = e6060sw_miiforport(sc, p->es_port); @@ -423,14 +510,27 @@ e6060sw_setport(device_t dev, etherswitc struct mii_data *mii; struct ifnet *ifp; int err; + int data; sc = device_get_softc(dev); if (p->es_port < 0 || p->es_port >= sc->numports) return (ENXIO); + if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + data = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + p->es_port, + PORT_DEFVLAN); + data &= ~0xfff; + data |= p->es_pvid; + data |= 1 << 12; + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + p->es_port, + PORT_DEFVLAN, data); + } + if (sc->portphy[p->es_port] == sc->cpuport) - return (ENXIO); + return(0); mii = e6060sw_miiforport(sc, p->es_port); if (mii == NULL) @@ -447,17 +547,50 @@ static int e6060sw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg) { struct e6060sw_softc *sc; - int data; + int data1, data2; + int vid; + int i, tag; sc = device_get_softc(dev); if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { vg->es_vid = ETHERSWITCH_VID_VALID; vg->es_vid |= vg->es_vlangroup; - data = MDIO_READREG(device_get_parent(dev), CORE_REGISTER + vg->es_vlangroup, PORT_VLAN_MAP); - vg->es_member_ports = data & 0x3f; + data1 = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + vg->es_vlangroup, + PORT_VLAN_MAP); + vg->es_member_ports = data1 & 0x3f; vg->es_untagged_ports = vg->es_member_ports; vg->es_fid = 0; + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + if (vg->es_vlangroup == 0) + return (0); + vid = e6060sw_read_vtu(dev, vg->es_vlangroup, &data1, &data2); + if (vid > 0) { + vg->es_vid = ETHERSWITCH_VID_VALID; + vg->es_vid |= vid; + vg->es_member_ports = 0; + vg->es_untagged_ports = 0; + for (i = 0; i < 4; ++i) { + tag = data1 >> (i * 4) & 3; + if (tag == 0 || tag == 1) { + vg->es_member_ports |= 1 << i; + vg->es_untagged_ports |= 1 << i; + } else if (tag == 2) { + vg->es_member_ports |= 1 << i; + } + } + for (i = 0; i < 2; ++i) { + tag = data2 >> (i * 4) & 3; + if (tag == 0 || tag == 1) { + vg->es_member_ports |= 1 << (i + 4); + vg->es_untagged_ports |= 1 << (i + 4); + } else if (tag == 2) { + vg->es_member_ports |= 1 << (i + 4); + } + } + + } } else { vg->es_vid = 0; } @@ -468,17 +601,49 @@ static int e6060sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg) { struct e6060sw_softc *sc; - int data; + int data1, data2; + int i; sc = device_get_softc(dev); if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { - data = MDIO_READREG(device_get_parent(dev), CORE_REGISTER + vg->es_vlangroup, PORT_VLAN_MAP); - data &= ~0x3f; - data |= vg->es_member_ports; - MDIO_WRITEREG(device_get_parent(dev), CORE_REGISTER + vg->es_vlangroup, PORT_VLAN_MAP, data); - } - + data1 = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + vg->es_vlangroup, + PORT_VLAN_MAP); + data1 &= ~0x3f; + data1 |= vg->es_member_ports; + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + vg->es_vlangroup, + PORT_VLAN_MAP, data1); + } else if (sc->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + if (vg->es_vlangroup == 0) + return (0); + data1 = 0; + data2 = 0; + for (i = 0; i < 6; ++i) { + if (vg->es_member_ports & + vg->es_untagged_ports & (1 << i)) { + if (i < 4) { + data1 |= (0xd << i * 4); + } else { + data2 |= (0xd << (i - 4) * 4); + } + } else if (vg->es_member_ports & (1 << i)) { + if (i < 4) { + data1 |= (0xe << i * 4); + } else { + data2 |= (0xe << (i - 4) * 4); + } + } else { + if (i < 4) { + data1 |= (0x3 << i * 4); + } else { + data2 |= (0x3 << (i - 4) * 4); + } + } + } + e6060sw_set_vtu(dev, vg->es_vlangroup, data1, data2); + } return (0); } @@ -497,11 +662,70 @@ e6060sw_reset_vlans(device_t dev) ports &= ~(1 << i); if (sc->vlan_mode == ETHERSWITCH_VLAN_PORT) { data = i << 12; + } else if (sc->vlan_mode == 0) { + data = 1 << 8; } else { data = 0; } data |= ports; - MDIO_WRITEREG(device_get_parent(dev), CORE_REGISTER + i, PORT_VLAN_MAP, data); + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, PORT_VLAN_MAP, data); + } +} + +static void +e6060sw_setup(device_t dev) +{ + struct e6060sw_softc *sc; + int i; + int data; + + sc = device_get_softc(dev); + + for (i = 0; i <= sc->numports; i++) { + if (sc->sw_model == E6063 || sc->sw_model == E6065) { + data = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, PORT_VLAN_MAP); + data &= ~(FORCEMAPMASK << FORCEMAPSHIFT); + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, + PORT_VLAN_MAP, data); + + data = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, PORT_CONTROL); + data |= 3 << ENGRESSFSHIFT; + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, + PORT_CONTROL, data); + } + } +} + +static void +e6060sw_dot1q_mode(device_t dev, int mode) +{ + struct e6060sw_softc *sc; + int i; + int data; + + sc = device_get_softc(dev); + + for (i = 0; i <= sc->numports; i++) { + data = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, PORT_CONTROL2); + data &= ~(DOT1QMODEMASK << DOT1QMODESHIFT); + data |= mode << DOT1QMODESHIFT; + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, PORT_CONTROL2, data); + + data = MDIO_READREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, + PORT_DEFVLAN); + data &= ~0xfff; + data |= 1; + MDIO_WRITEREG(device_get_parent(dev), + CORE_REGISTER + sc->smi_offset + i, + PORT_DEFVLAN, data); } } @@ -519,6 +743,101 @@ e6060sw_getconf(device_t dev, etherswitc return (0); } +static void +e6060sw_init_vtu(device_t dev) +{ + struct e6060sw_softc *sc; + int busy; + + sc = device_get_softc(dev); + + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_OPERATION, VTU_BUSY | (VTU_FLASH << 12)); + while (1) { + busy = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_OPERATION); + if ((busy & VTU_BUSY) == 0) + break; + } + + /* initial member set at vlan 1*/ + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_DATA1_REG, 0xcccc); + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_DATA2_REG, 0x00cc); + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_VID_REG, 0x1000 | 1); + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_OPERATION, VTU_BUSY | (VTU_LOAD_PURGE << 12) | 1); + while (1) { + busy = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_OPERATION); + if ((busy & VTU_BUSY) == 0) + break; + } +} + +static void +e6060sw_set_vtu(device_t dev, int num, int data1, int data2) +{ + struct e6060sw_softc *sc; + int busy; + + sc = device_get_softc(dev); + + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_DATA1_REG, data1); + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_DATA2_REG, data2); + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_VID_REG, 0x1000 | num); + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_OPERATION, VTU_BUSY | (VTU_LOAD_PURGE << 12) | num); + while (1) { + busy = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_OPERATION); + if ((busy & VTU_BUSY) == 0) + break; + } + +} + +static int +e6060sw_read_vtu(device_t dev, int num, int *data1, int *data2) +{ + struct e6060sw_softc *sc; + int busy; + + sc = device_get_softc(dev); + + num = num - 1; + + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_VID_REG, num & 0xfff); + /* Get Next */ + MDIO_WRITEREG(device_get_parent(dev), GLOBAL_REGISTER + sc->smi_offset, + VTU_OPERATION, VTU_BUSY | (VTU_GET_NEXT << 12)); + while (1) { + busy = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_OPERATION); + if ((busy & VTU_BUSY) == 0) + break; + } + + int vid = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_VID_REG); + if (vid & 0x1000) { + *data1 = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_DATA1_REG); + *data2 = MDIO_READREG(device_get_parent(dev), + GLOBAL_REGISTER + sc->smi_offset, VTU_DATA2_REG); + + return (vid & 0xfff); + } + + return (-1); +} + static int e6060sw_setconf(device_t dev, etherswitch_conf_t *conf) { @@ -530,12 +849,19 @@ e6060sw_setconf(device_t dev, etherswitc if (conf->cmd & ETHERSWITCH_CONF_VLAN_MODE) { if (conf->vlan_mode == ETHERSWITCH_VLAN_PORT) { sc->vlan_mode = ETHERSWITCH_VLAN_PORT; + e6060sw_dot1q_mode(dev, DOT1QNONE); + e6060sw_reset_vlans(dev); + } else if ((sc->sw_model == E6063 || sc->sw_model == E6065) && + conf->vlan_mode == ETHERSWITCH_VLAN_DOT1Q) { + sc->vlan_mode = ETHERSWITCH_VLAN_DOT1Q; + e6060sw_dot1q_mode(dev, DOT1QSECURE); + e6060sw_init_vtu(dev); } else { sc->vlan_mode = 0; + /* Reset VLANs. */ + e6060sw_dot1q_mode(dev, DOT1QNONE); + e6060sw_reset_vlans(dev); } - - /* Reset VLANs. */ - e6060sw_reset_vlans(dev); } return (0); @@ -588,8 +914,6 @@ e6060sw_readphy(device_t dev, int phy, i struct e6060sw_softc *sc; int data; - phy += SMI_OFFSET; - sc = device_get_softc(dev); E6060SW_LOCK_ASSERT(sc, MA_NOTOWNED); @@ -611,8 +935,6 @@ e6060sw_writephy(device_t dev, int phy, struct e6060sw_softc *sc; int err; - phy += SMI_OFFSET; - sc = device_get_softc(dev); E6060SW_LOCK_ASSERT(sc, MA_NOTOWNED); @@ -635,10 +957,10 @@ e6060sw_readreg(device_t dev, int addr) { int devaddr, regaddr; - devaddr = (addr >> 5) & 0xf; + devaddr = (addr >> 5) & 0x1f; regaddr = addr & 0x1f; - return MDIO_READREG(device_get_parent(dev), devaddr+SMI_OFFSET, regaddr); + return MDIO_READREG(device_get_parent(dev), devaddr, regaddr); } /* addr is 5-8 bit is SMI Device Addres, 0-4 bit is SMI Register Address */ @@ -648,10 +970,10 @@ e6060sw_writereg(device_t dev, int addr, { int devaddr, regaddr; - devaddr = (addr >> 5) & 0xf; + devaddr = (addr >> 5) & 0x1f; regaddr = addr & 0x1f; - return (MDIO_WRITEREG(device_get_parent(dev), devaddr+SMI_OFFSET, regaddr, value)); + return (MDIO_WRITEREG(device_get_parent(dev), devaddr, regaddr, value)); } static device_method_t e6060sw_methods[] = { From owner-svn-src-all@freebsd.org Mon Mar 27 19:17:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CFBFD20C64; Mon, 27 Mar 2017 19:17: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 5C543270; Mon, 27 Mar 2017 19:17: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 v2RJHUvr040735; Mon, 27 Mar 2017 19:17:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RJHUaU040734; Mon, 27 Mar 2017 19:17:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703271917.v2RJHUaU040734@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 19:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316053 - head/share/man/man3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 19:17:31 -0000 Author: ngie Date: Mon Mar 27 19:17:30 2017 New Revision: 316053 URL: https://svnweb.freebsd.org/changeset/base/316053 Log: pthread_mutex_consistent: sort SEE ALSO by reference name MFC after: 3 days Reported by: make manlint Sponsored by: Dell EMC Isilon Modified: head/share/man/man3/pthread_mutex_consistent.3 Modified: head/share/man/man3/pthread_mutex_consistent.3 ============================================================================== --- head/share/man/man3/pthread_mutex_consistent.3 Mon Mar 27 19:06:29 2017 (r316052) +++ head/share/man/man3/pthread_mutex_consistent.3 Mon Mar 27 19:17:30 2017 (r316053) @@ -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-all@freebsd.org Mon Mar 27 19:26:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1972D20F8A; Mon, 27 Mar 2017 19:26:10 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F23A39; Mon, 27 Mar 2017 19:26:10 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RJQ9X4044675; Mon, 27 Mar 2017 19:26:09 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RJQ9Ef044673; Mon, 27 Mar 2017 19:26:09 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201703271926.v2RJQ9Ef044673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Mon, 27 Mar 2017 19:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316054 - in head/sys: conf mips/atheros/ar531x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 19:26:10 -0000 Author: mizhka Date: Mon Mar 27 19:26:09 2017 New Revision: 316054 URL: https://svnweb.freebsd.org/changeset/base/316054 Log: [etherswitch] simplify kernconf for recently added etherswitch drivers This simple patch adds e6060sw, adm6996fc and ksz8995ma into conf/files. Submitted by: Hiroki Mori Reviewed by: adrian, mizhka MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9255 Modified: head/sys/conf/files head/sys/mips/atheros/ar531x/files.ar5315 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Mar 27 19:17:30 2017 (r316053) +++ head/sys/conf/files Mon Mar 27 19:26:09 2017 (r316054) @@ -1605,6 +1605,9 @@ dev/etherswitch/ip17x/ip17x_vlans.c opti dev/etherswitch/miiproxy.c optional miiproxy dev/etherswitch/rtl8366/rtl8366rb.c optional rtl8366rb dev/etherswitch/e6000sw/e6000sw.c optional e6000sw +dev/etherswitch/e6000sw/e6060sw.c optional e6060sw +dev/etherswitch/infineon/adm6996fc.c optional adm6996fc +dev/etherswitch/micrel/ksz8995ma.c optional ksz8995ma dev/etherswitch/ukswitch/ukswitch.c optional ukswitch dev/evdev/cdev.c optional evdev dev/evdev/evdev.c optional evdev Modified: head/sys/mips/atheros/ar531x/files.ar5315 ============================================================================== --- head/sys/mips/atheros/ar531x/files.ar5315 Mon Mar 27 19:17:30 2017 (r316053) +++ head/sys/mips/atheros/ar531x/files.ar5315 Mon Mar 27 19:26:09 2017 (r316054) @@ -16,7 +16,5 @@ mips/atheros/ar531x/ar5312_chip.c stand mips/atheros/ar71xx_bus_space_reversed.c standard mips/mips/tick.c standard -dev/etherswitch/e6000sw/e6060sw.c optional etherswitch - # Non Intrng mips/mips/intr_machdep.c optional !intrng From owner-svn-src-all@freebsd.org Mon Mar 27 19:42:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 170DAD2051E; Mon, 27 Mar 2017 19:42:14 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1640628; Mon, 27 Mar 2017 19:42:13 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x229.google.com with SMTP id e75so32449166itd.1; Mon, 27 Mar 2017 12:42:13 -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; bh=hKQWBm8FCsqukqg6B1B5oQDlMO43Msp11W66S3ISCK8=; b=WoZDASmrkchF5BNQpWG9AGlFtFgi0dRkHD6YIe2KqX02Xz2qwDgq7rftlq25yUx1vI X0dU9KJXs8iuqCmXDt5H5rdrD94gDxnVthon59peheBXfPumSHAGjdaFEuuLW/pDY1tL Vzdm3T6IX+sqVlDhmpcZXjclANmyccr/quvNXtC6GRt6sOXzb/+BDo/vX7m4yHPn/tXO yg3FqEE4SNQM97drg1m7n97mJkQ52bwVYQwQXEAE4P2zihoIteGuAENc6V5XiguudKg9 KH36m8g8C5liksz1eXi3QqBmD+161j6kqD2jOUsTSHoGoBxJT0LLvQ6ZhrqYV+g7NURt 7h6A== 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; bh=hKQWBm8FCsqukqg6B1B5oQDlMO43Msp11W66S3ISCK8=; b=JO7TaRcac4fWu2i8/DO42KdoQy2UBypQlI+EDMS01bGkfzIwUhWgxVOBpwPF0hOK2X aKOmRTFu2ncr0h6zUMlj7djMowb+s/jIGSKKHJJTwGwQpYAucoZU/T/r+l5krCS3jDCl AuPNOKpI+oo5JqNMZHYk7y+INiZ3ADC3OI0zcavwtSobjMMg66SGZe/crv9ZZUirTxLW vxJ7J50c2IG0gOi2NnLRtBpHys0bUJWldHSidcxjSJZdPtq9bH5VyNBGAhuB0L7xTwCT 5ssynWnhwdNph3+UNq3+zTHhofGHP60iZ9Qx+y+Q9sUwK+x1kjQKP7dXfCoX2XvoaX86 4R9w== X-Gm-Message-State: AFeK/H2SyvsDP/qmhfS58zS60ZBXDbWClnef0iYGnfqVo0LjJKhQEHsd2IZ++tMq/LwRSj3/gknQ0nsRhNI3Sg== X-Received: by 10.36.80.213 with SMTP id m204mr11030389itb.105.1490643733012; Mon, 27 Mar 2017 12:42:13 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.209 with HTTP; Mon, 27 Mar 2017 12:41:52 -0700 (PDT) In-Reply-To: <201703271601.v2RG1GeY057276@repo.freebsd.org> References: <201703271601.v2RG1GeY057276@repo.freebsd.org> From: Ed Maste Date: Mon, 27 Mar 2017 15:41:52 -0400 X-Google-Sender-Auth: URe9bOjsWXD7aZpNqhNcckoAQcE Message-ID: Subject: Re: svn commit: r316029 - head/contrib/llvm/tools/lld/ELF To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 19:42:14 -0000 On 27 March 2017 at 12:01, Ed Maste wrote: > Author: emaste > Date: Mon Mar 27 16:01:16 2017 > New Revision: 316029 > URL: https://svnweb.freebsd.org/changeset/base/316029 > > Log: > lld: hack version and help output for compatibility with libtool For the record, I think this is a terrible hack and I wish we didn't need it. However, it was committed upstream and should be the most expedient way to get libtool-using third party software to link with lld. As Sean Silva wrote in https://reviews.llvm.org/D31199: Btw, I think this is one of the clearest proofs that LLD has crossed a big milestone and is now entering "production quality". You don't see this kind of hack in a non-production-quality program. I still hope libtool will gain native support for lld, and perhaps many years from now this can be removed. From owner-svn-src-all@freebsd.org Mon Mar 27 20:24:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C09D208BF; Mon, 27 Mar 2017 20:24:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BED546E4; Mon, 27 Mar 2017 20:24:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RKOI69070765; Mon, 27 Mar 2017 20:24:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RKOIE7070764; Mon, 27 Mar 2017 20:24:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703272024.v2RKOIE7070764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 27 Mar 2017 20:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316055 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 20:24:20 -0000 Author: emaste Date: Mon Mar 27 20:24:18 2017 New Revision: 316055 URL: https://svnweb.freebsd.org/changeset/base/316055 Log: makefs: sort roundup with the other off_t members in fsinfo_t MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/makefs.h Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Mon Mar 27 19:26:09 2017 (r316054) +++ head/usr.sbin/makefs/makefs.h Mon Mar 27 20:24:18 2017 (r316055) @@ -151,12 +151,12 @@ typedef struct makefs_fsinfo { off_t maxsize; /* maximum size image can be */ off_t freefiles; /* free file entries to leave */ off_t freeblocks; /* free blocks to leave */ + off_t roundup; /* round image size up to this value */ int freefilepc; /* free file % */ int freeblockpc; /* free block % */ int needswap; /* non-zero if byte swapping needed */ int sectorsize; /* sector size */ int sparse; /* sparse image, don't fill it with zeros */ - off_t roundup; /* round image size up to this value */ void *fs_specific; /* File system specific additions. */ option_t *fs_options; /* File system specific options */ From owner-svn-src-all@freebsd.org Mon Mar 27 20:28:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 168FDD20A6B; Mon, 27 Mar 2017 20:28:58 +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 DA1239E7; Mon, 27 Mar 2017 20:28:57 +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 v2RKSuWT070952; Mon, 27 Mar 2017 20:28:56 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RKSuQE070951; Mon, 27 Mar 2017 20:28:56 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201703272028.v2RKSuQE070951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 27 Mar 2017 20:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316056 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 20:28:58 -0000 Author: trasz Date: Mon Mar 27 20:28:56 2017 New Revision: 316056 URL: https://svnweb.freebsd.org/changeset/base/316056 Log: The cn_consume was removed in r296716. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man9/VOP_LOOKUP.9 Modified: head/share/man/man9/VOP_LOOKUP.9 ============================================================================== --- head/share/man/man9/VOP_LOOKUP.9 Mon Mar 27 20:24:18 2017 (r316055) +++ head/share/man/man9/VOP_LOOKUP.9 Mon Mar 27 20:28:56 2017 (r316056) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 1997 +.Dd March 27, 2017 .Dt VOP_LOOKUP 9 .Os .Sh NAME @@ -71,7 +71,6 @@ struct componentname { char *cn_nameptr; /* pointer to looked up name */ long cn_namelen; /* length of looked up component */ u_long cn_hash; /* hash value of looked up name */ - long cn_consume; /* chars to consume in lookup() */ }; .Ed .Pp From owner-svn-src-all@freebsd.org Mon Mar 27 20:32:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81505D20CC6; Mon, 27 Mar 2017 20:32:13 +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 5976EE82; Mon, 27 Mar 2017 20:32:13 +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 v2RKWCWl074086; Mon, 27 Mar 2017 20:32:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RKWCuR074083; Mon, 27 Mar 2017 20:32:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201703272032.v2RKWCuR074083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 27 Mar 2017 20:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316057 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 20:32:13 -0000 Author: trasz Date: Mon Mar 27 20:32:12 2017 New Revision: 316057 URL: https://svnweb.freebsd.org/changeset/base/316057 Log: Document EVENTHANDLER_DEFINE(9). MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man9/EVENTHANDLER.9 head/share/man/man9/Makefile Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Mon Mar 27 20:28:56 2017 (r316056) +++ head/share/man/man9/EVENTHANDLER.9 Mon Mar 27 20:32:12 2017 (r316057) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd April 19, 2014 +.Dd March 27, 2017 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -32,6 +32,7 @@ .Sh SYNOPSIS .In sys/eventhandler.h .Fn EVENTHANDLER_DECLARE name type +.Fn EVENTHANDLER_DEFINE name func arg priority .Fn EVENTHANDLER_INVOKE name ... .Ft eventhandler_tag .Fn EVENTHANDLER_REGISTER name func arg priority @@ -60,6 +61,20 @@ mechanism provides a way for kernel subs kernel events and have their callback functions invoked when these events occur. .Pp +Callback functions are invoked in order of priority. +The relative priority of each callback among other callbacks +associated with an event is given by argument +.Fa priority , +which is an integer ranging from +.Dv EVENTHANDLER_PRI_FIRST +(highest priority), to +.Dv EVENTHANDLER_PRI_LAST +(lowest priority). +The symbol +.Dv EVENTHANDLER_PRI_ANY +may be used if the handler does not have a specific priority +associated with it. +.Pp The normal way to use this subsystem is via the macro interface. The macros that can be used for working with event handlers and callback function lists are: @@ -69,6 +84,21 @@ This macro declares an event handler nam .Fa name with callback functions of type .Fa type . +.It Fn EVENTHANDLER_DEFINE +This macro uses +.Xr SYSINIT 9 +to register a callback function +.Fa func +with event handler +.Fa name . +When invoked, function +.Fa func +will be invoked with argument +.Fa arg +as its first parameter along with any additional parameters passed in +via macro +.Fn EVENTHANDLER_INVOKE +(see below). .It Fn EVENTHANDLER_REGISTER This macro registers a callback function .Fa func @@ -82,19 +112,6 @@ as its first parameter along with any ad via macro .Fn EVENTHANDLER_INVOKE (see below). -Callback functions are invoked in order of priority. -The relative priority of each callback among other callbacks -associated with an event is given by argument -.Fa priority , -which is an integer ranging from -.Dv EVENTHANDLER_PRI_FIRST -(highest priority), to -.Dv EVENTHANDLER_PRI_LAST -(lowest priority). -The symbol -.Dv EVENTHANDLER_PRI_ANY -may be used if the handler does not have a specific priority -associated with it. If registration is successful, .Fn EVENTHANDLER_REGISTER returns a cookie of type Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Mar 27 20:28:56 2017 (r316056) +++ head/share/man/man9/Makefile Mon Mar 27 20:32:12 2017 (r316057) @@ -797,6 +797,7 @@ MLINKS+=DRIVER_MODULE.9 DRIVER_MODULE_OR DRIVER_MODULE.9 EARLY_DRIVER_MODULE.9 \ DRIVER_MODULE.9 EARLY_DRIVER_MODULE_ORDERED.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ + EVENTHANDLER.9 EVENTHANDLER_DEFINE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ EVENTHANDLER.9 eventhandler_deregister.9 \ EVENTHANDLER.9 eventhandler_find_list.9 \ From owner-svn-src-all@freebsd.org Mon Mar 27 20:57:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30EC8D20376; Mon, 27 Mar 2017 20:57:14 +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 C97BBF95; Mon, 27 Mar 2017 20:57:13 +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 v2RKvDEP083630; Mon, 27 Mar 2017 20:57:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RKvC6w083622; Mon, 27 Mar 2017 20:57:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703272057.v2RKvC6w083622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Mar 2017 20:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316058 - vendor/tzdata/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 20:57:14 -0000 Author: bapt Date: Mon Mar 27 20:57:12 2017 New Revision: 316058 URL: https://svnweb.freebsd.org/changeset/base/316058 Log: Import tzdata 2017b Modified: vendor/tzdata/dist/Makefile vendor/tzdata/dist/NEWS vendor/tzdata/dist/Theory vendor/tzdata/dist/africa vendor/tzdata/dist/antarctica vendor/tzdata/dist/asia vendor/tzdata/dist/australasia vendor/tzdata/dist/backward vendor/tzdata/dist/backzone vendor/tzdata/dist/europe vendor/tzdata/dist/iso3166.tab vendor/tzdata/dist/leap-seconds.list vendor/tzdata/dist/leapseconds vendor/tzdata/dist/northamerica vendor/tzdata/dist/southamerica vendor/tzdata/dist/version vendor/tzdata/dist/zone.tab vendor/tzdata/dist/zone1970.tab Modified: vendor/tzdata/dist/Makefile ============================================================================== --- vendor/tzdata/dist/Makefile Mon Mar 27 20:32:12 2017 (r316057) +++ vendor/tzdata/dist/Makefile Mon Mar 27 20:57:12 2017 (r316058) @@ -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: vendor/tzdata/dist/NEWS ============================================================================== --- vendor/tzdata/dist/NEWS Mon Mar 27 20:32:12 2017 (r316057) +++ vendor/tzdata/dist/NEWS Mon Mar 27 20:57:12 2017 (r316058) @@ -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: vendor/tzdata/dist/Theory ============================================================================== --- vendor/tzdata/dist/Theory Mon Mar 27 20:32:12 2017 (r316057) +++ vendor/tzdata/dist/Theory Mon Mar 27 20:57:12 2017 (r316058) @@ -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: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Mon Mar 27 20:32:12 2017 (r316057) +++ vendor/tzdata/dist/africa Mon Mar 27 20:57:12 2017 (r316058) @@ -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: vendor/tzdata/dist/antarctica ============================================================================== --- vendor/tzdata/dist/antarctica Mon Mar 27 20:32:12 2017 (r316057) +++ vendor/tzdata/dist/antarctica Mon Mar 27 20:57:12 2017 (r316058) @@ -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: vendor/tzdata/dist/asia ============================================================================== --- vendor/tzdata/dist/asia Mon Mar 27 20:32:12 2017 (r316057) +++ vendor/tzdata/dist/asia Mon Mar 27 20:57:12 2017 (r316058) @@ -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-all@freebsd.org Mon Mar 27 20:57:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DADB4D203DD; Mon, 27 Mar 2017 20:57:45 +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 A3273119; Mon, 27 Mar 2017 20:57:45 +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 v2RKvinI083699; Mon, 27 Mar 2017 20:57:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RKvisV083695; Mon, 27 Mar 2017 20:57:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703272057.v2RKvisV083695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Mar 2017 20:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316059 - vendor/tzdata/tzdata2017b X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 20:57:46 -0000 Author: bapt Date: Mon Mar 27 20:57:44 2017 New Revision: 316059 URL: https://svnweb.freebsd.org/changeset/base/316059 Log: tag import of tzdata 2017b Added: vendor/tzdata/tzdata2017b/ - copied from r316057, vendor/tzdata/dist/ Replaced: vendor/tzdata/tzdata2017b/Makefile - copied unchanged from r316058, vendor/tzdata/dist/Makefile vendor/tzdata/tzdata2017b/NEWS - copied unchanged from r316058, vendor/tzdata/dist/NEWS vendor/tzdata/tzdata2017b/Theory - copied unchanged from r316058, vendor/tzdata/dist/Theory vendor/tzdata/tzdata2017b/africa - copied unchanged from r316058, vendor/tzdata/dist/africa vendor/tzdata/tzdata2017b/antarctica - copied unchanged from r316058, vendor/tzdata/dist/antarctica vendor/tzdata/tzdata2017b/asia - copied unchanged from r316058, vendor/tzdata/dist/asia vendor/tzdata/tzdata2017b/australasia - copied unchanged from r316058, vendor/tzdata/dist/australasia vendor/tzdata/tzdata2017b/backward - copied unchanged from r316058, vendor/tzdata/dist/backward vendor/tzdata/tzdata2017b/backzone - copied unchanged from r316058, vendor/tzdata/dist/backzone vendor/tzdata/tzdata2017b/europe - copied unchanged from r316058, vendor/tzdata/dist/europe vendor/tzdata/tzdata2017b/iso3166.tab - copied unchanged from r316058, vendor/tzdata/dist/iso3166.tab vendor/tzdata/tzdata2017b/leap-seconds.list - copied unchanged from r316058, vendor/tzdata/dist/leap-seconds.list vendor/tzdata/tzdata2017b/leapseconds - copied unchanged from r316058, vendor/tzdata/dist/leapseconds vendor/tzdata/tzdata2017b/northamerica - copied unchanged from r316058, vendor/tzdata/dist/northamerica vendor/tzdata/tzdata2017b/southamerica - copied unchanged from r316058, vendor/tzdata/dist/southamerica vendor/tzdata/tzdata2017b/version - copied unchanged from r316058, vendor/tzdata/dist/version vendor/tzdata/tzdata2017b/zone.tab - copied unchanged from r316058, vendor/tzdata/dist/zone.tab vendor/tzdata/tzdata2017b/zone1970.tab - copied unchanged from r316058, vendor/tzdata/dist/zone1970.tab Copied: vendor/tzdata/tzdata2017b/Makefile (from r316058, vendor/tzdata/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdata/tzdata2017b/Makefile Mon Mar 27 20:57:44 2017 (r316059, copy of r316058, vendor/tzdata/dist/Makefile) @@ -0,0 +1,797 @@ +# This file is in the public domain, so clarified as of +# 2009-05-17 by Arthur David Olson. + +# Package name for the code distribution. +PACKAGE= tzcode + +# Version number for the distribution, overridden in the 'tarballs' rule below. +VERSION= unknown + +# Email address for bug reports. +BUGEMAIL= tz@iana.org + +# Change the line below for your time zone (after finding the zone you want in +# the time zone files, or adding it to a time zone file). +# Alternately, if you discover you've got the wrong time zone, you can just +# zic -l rightzone +# to correct things. +# Use the command +# make zonenames +# to get a list of the values you can use for LOCALTIME. + +LOCALTIME= GMT + +# If you want something other than Eastern United States time as a template +# for handling POSIX-style time zone environment variables, +# change the line below (after finding the zone you want in the +# time zone files, or adding it to a time zone file). +# (When a POSIX-style environment variable is handled, the rules in the +# template file are used to determine "spring forward" and "fall back" days and +# times; the environment variable itself specifies UT offsets of standard and +# summer time.) +# Alternately, if you discover you've got the wrong time zone, you can just +# zic -p rightzone +# to correct things. +# Use the command +# make zonenames +# to get a list of the values you can use for POSIXRULES. +# If you want POSIX compatibility, use "America/New_York". + +POSIXRULES= America/New_York + +# Also see TZDEFRULESTRING below, which takes effect only +# if the time zone files cannot be accessed. + +# Everything gets put in subdirectories of. . . + +TOPDIR= /usr/local + +# "Compiled" time zone information is placed in the "TZDIR" directory +# (and subdirectories). +# Use an absolute path name for TZDIR unless you're just testing the software. + +TZDIR_BASENAME= zoneinfo +TZDIR= $(TOPDIR)/etc/$(TZDIR_BASENAME) + +# Types to try, as an alternative to time_t. int64_t should be first. +TIME_T_ALTERNATIVES= int64_t int32_t uint32_t uint64_t + +# The "tzselect", "zic", and "zdump" commands get installed in. . . + +ETCDIR= $(TOPDIR)/etc + +# If you "make INSTALL", the "date" command gets installed in. . . + +BINDIR= $(TOPDIR)/bin + +# Manual pages go in subdirectories of. . . + +MANDIR= $(TOPDIR)/man + +# Library functions are put in an archive in LIBDIR. + +LIBDIR= $(TOPDIR)/lib + +# 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 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 +# REDO= posix_right +# below. If you want both sets of data available, with leap seconds counted +# normally, use +# REDO= right_posix +# below. POSIX mandates that leap seconds not be counted; for compatibility +# 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 + +# If you want out-of-scope and often-wrong data from the file 'backzone', use +# PACKRATDATA= backzone +# To omit this data, use +# PACKRATDATA= + +PACKRATDATA= + +# Since "." may not be in PATH... + +YEARISTYPE= ./yearistype + +# Non-default libraries needed to link. +LDLIBS= + +# Add the following to the end of the "CFLAGS=" line as needed. +# -DBIG_BANG=-9999999LL if the Big Bang occurred at time -9999999 (see zic.c) +# -DHAVE_DECL_ASCTIME_R=0 if does not declare asctime_r +# -DHAVE_DIRECT_H if mkdir needs (MS-Windows) +# -DHAVE_DOS_FILE_NAMES if file names have drive specifiers etc. (MS-DOS) +# -DHAVE_GETTEXT=1 if 'gettext' works (e.g., GNU/Linux, FreeBSD, Solaris) +# -DHAVE_INCOMPATIBLE_CTIME_R=1 if your system's time.h declares +# ctime_r and asctime_r incompatibly with the POSIX standard +# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined). +# -DHAVE_INTTYPES_H=1 if you have a pre-C99 compiler with "inttypes.h" +# -DHAVE_LINK=0 if your system lacks a link function +# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function +# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz +# This defaults to 1 if a working localtime_rz seems to be available. +# localtime_rz can make zdump significantly faster, but is nonstandard. +# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare +# functions like 'link' or variables like 'tzname' required by POSIX +# -DHAVE_STDINT_H=1 if you have a pre-C99 compiler with "stdint.h" +# -DHAVE_STRFTIME_L=1 if declares locale_t and strftime_l +# This defaults to 0 if _POSIX_VERSION < 200809, 1 otherwise. +# -DHAVE_STRDUP=0 if your system lacks the strdup function +# -DHAVE_SYMLINK=0 if your system lacks the symlink function +# -DHAVE_SYS_STAT_H=0 if your compiler lacks a "sys/stat.h" +# -DHAVE_SYS_WAIT_H=0 if your compiler lacks a "sys/wait.h" +# -DHAVE_TZSET=0 if your system lacks a tzset function +# -DHAVE_UNISTD_H=0 if your compiler lacks a "unistd.h" (Microsoft C++ 7?) +# -DEPOCH_LOCAL=1 if the 'time' function returns local time not UT +# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater +# than what POSIX specifies, assuming local time is UT. +# For example, N is 252460800 on AmigaOS. +# -DNO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU=1 +# if you do not want run time warnings about formats that may cause +# year 2000 grief +# -Dssize_t=long on ancient hosts that lack ssize_t +# -DTHREAD_SAFE=1 to make localtime.c thread-safe, as POSIX requires; +# not needed by the main-program tz code, which is single-threaded. +# Append other compiler flags as needed, e.g., -pthread on GNU/Linux. +# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t +# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz" +# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory; +# the default is system-supplied, typically "/usr/lib/locale" +# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified +# DST transitions if the time zone files cannot be accessed +# -DUNINIT_TRAP=1 if reading uninitialized storage can cause problems +# other than simply getting garbage data +# -DUSE_LTZ=0 to build zdump with the system time zone library +# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_MAX_ABBR_LEN_WO_WARN=3 +# (or some other number) to set the maximum time zone abbreviation length +# that zic will accept without a warning (the default is 6) +# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking +GCC_DEBUG_FLAGS = -Dlint -g3 -O3 -fno-common -fstrict-aliasing \ + -Wall -Wextra \ + -Wbad-function-cast -Wcast-align -Wdate-time \ + -Wdeclaration-after-statement \ + -Wdouble-promotion \ + -Wformat=2 -Winit-self -Wjump-misses-init \ + -Wlogical-op -Wmissing-prototypes -Wnested-externs \ + -Wold-style-definition -Woverlength-strings -Wpointer-arith \ + -Wshadow -Wstrict-prototypes -Wsuggest-attribute=const \ + -Wsuggest-attribute=format -Wsuggest-attribute=noreturn \ + -Wsuggest-attribute=pure -Wtrampolines \ + -Wundef -Wunused -Wwrite-strings \ + -Wno-address -Wno-format-nonliteral -Wno-sign-compare \ + -Wno-type-limits -Wno-unused-parameter +# +# If you want to use System V compatibility code, add +# -DUSG_COMPAT +# to the end of the "CFLAGS=" line. This arrange for "timezone" and "daylight" +# variables to be kept up-to-date by the time conversion functions. Neither +# "timezone" nor "daylight" is described in X3J11's work. +# +# If your system has a "GMT offset" field in its "struct tm"s +# (or if you decide to add such a field in your system's "time.h" file), +# add the name to a define such as +# -DTM_GMTOFF=tm_gmtoff +# to the end of the "CFLAGS=" line. If not defined, the code attempts to +# guess TM_GMTOFF from other macros; define NO_TM_GMTOFF to suppress this. +# Similarly, if your system has a "zone abbreviation" field, define +# -DTM_ZONE=tm_zone +# and define NO_TM_ZONE to suppress any guessing. These two fields are not +# required by POSIX, but are widely available on GNU/Linux and BSD systems. +# +# If you want functions that were inspired by early versions of X3J11's work, +# add +# -DSTD_INSPIRED +# to the end of the "CFLAGS=" line. This arranges for the functions +# "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", +# "posix2time", and "time2posix" to be added to the time conversion library. +# "tzsetwall" is like "tzset" except that it arranges for local wall clock +# time (rather than the time specified in the TZ environment variable) +# to be used. +# "offtime" is like "gmtime" except that it accepts a second (long) argument +# that gives an offset to add to the time_t when converting it. +# "timelocal" is equivalent to "mktime". +# "timegm" is like "timelocal" except that it turns a struct tm into +# a time_t using UT (rather than local time as "timelocal" does). +# "timeoff" is like "timegm" except that it accepts a second (long) argument +# that gives an offset to use when converting to a time_t. +# "posix2time" and "time2posix" are described in an included manual page. +# X3J11's work does not describe any of these functions. +# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0. +# These functions may well disappear in future releases of the time +# conversion package. +# +# If you don't want functions that were inspired by NetBSD, add +# -DNETBSD_INSPIRED=0 +# to the end of the "CFLAGS=" line. Otherwise, the functions +# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the +# time library, and if STD_INSPIRED is also defined the functions +# "posix2time_z" and "time2posix_z" are added as well. +# The functions ending in "_z" (or "_rz") are like their unsuffixed +# (or suffixed-by-"_r") counterparts, except with an extra first +# argument of opaque type timezone_t that specifies the time zone. +# "tzalloc" allocates a timezone_t value, and "tzfree" frees it. +# +# If you want to allocate state structures in localtime, add +# -DALL_STATE +# to the end of the "CFLAGS=" line. Storage is obtained by calling malloc. +# +# If you want an "altzone" variable (a la System V Release 3.1), add +# -DALTZONE +# to the end of the "CFLAGS=" line. +# This variable is not described in X3J11's work. +# +# NIST-PCTS:151-2, Version 1.4, (1993-12-03) is a test suite put +# out by the National Institute of Standards and Technology +# which claims to test C and Posix conformance. If you want to pass PCTS, add +# -DPCTS +# to the end of the "CFLAGS=" line. +# +# If you want strict compliance with XPG4 as of 1994-04-09, add +# -DXPG4_1994_04_09 +# to the end of the "CFLAGS=" line. This causes "strftime" to always return +# 53 as a week number (rather than 52 or 53) for those days in January that +# before the first Monday in January when a "%V" format is used and January 1 +# falls on a Friday, Saturday, or Sunday. + +CFLAGS= + +# Linker flags. Default to $(LFLAGS) for backwards compatibility +# to release 2012h and earlier. + +LDFLAGS= $(LFLAGS) + +# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in +# submake command lines. The default is no leap seconds. + +LEAPSECONDS= + +# The zic command and its arguments. + +zic= ./zic +ZIC= $(zic) $(ZFLAGS) + +ZFLAGS= + +# How to use zic to install tz binary files. + +ZIC_INSTALL= $(ZIC) -y $(YEARISTYPE) -d $(DESTDIR)$(TZDIR) $(LEAPSECONDS) + +# The name of a Posix-compliant 'awk' on your system. +AWK= awk + +# The full path name of a Posix-compliant shell, preferably one that supports +# the Korn shell's 'select' statement as an extension. +# These days, Bash is the most popular. +# It should be OK to set this to /bin/sh, on platforms where /bin/sh +# lacks 'select' or doesn't completely conform to Posix, but /bin/bash +# is typically nicer if it works. +KSHELL= /bin/bash + +# The path where SGML DTDs are kept and the catalog file(s) to use when +# validating. The default should work on both Debian and Red Hat. +SGML_TOPDIR= /usr +SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd +SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 +SGML_CATALOG_FILES= \ + $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat + +# The name, arguments and environment of a program to validate your web pages. +# See for a validator, and +# for a validation library. +VALIDATE = nsgmls +VALIDATE_FLAGS = -s -B -wall -wno-unused-param +VALIDATE_ENV = \ + SGML_CATALOG_FILES=$(SGML_CATALOG_FILES) \ + SGML_SEARCH_PATH=$(SGML_SEARCH_PATH) \ + SP_CHARSET_FIXED=YES \ + SP_ENCODING=UTF-8 + +# This expensive test requires USE_LTZ. +# To suppress it, define this macro to be empty. +CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives + +# SAFE_CHAR is a regular expression that matches a safe character. +# Some parts of this distribution are limited to safe characters; +# others can use any UTF-8 character. +# For now, the safe characters are a safe subset of ASCII. +# The caller must set the shell variable 'sharp' to the character '#', +# since Makefile macros cannot contain '#'. +# TAB_CHAR is a single tab character, in single quotes. +TAB_CHAR= ' ' +SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@' +SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`' +SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~' +SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3) +SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]' + +# OK_CHAR matches any character allowed in the distributed files. +# This is the same as SAFE_CHAR, except that multibyte letters are +# also allowed so that commentary can contain people's names and quote +# non-English sources. For non-letters the sources are limited to +# ASCII renderings for the convenience of maintainers whose text editors +# mishandle UTF-8 by default (e.g., XEmacs 21.4.22). +OK_CHAR= '[][:alpha:]'$(SAFE_CHARSET)'-]' + +# SAFE_LINE matches a line of safe characters. +# SAFE_SHARP_LINE is similar, except any OK character can follow '#'; +# this is so that comments can contain non-ASCII characters. +# OK_LINE matches a line of OK characters. +SAFE_LINE= '^'$(SAFE_CHAR)'*$$' +SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$' +OK_LINE= '^'$(OK_CHAR)'*$$' + +# Flags to give 'tar' when making a distribution. +# Try to use flags appropriate for GNU tar. +GNUTARFLAGS= --numeric-owner --owner=0 --group=0 --mode=go+u,go-w --sort=name +TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \ + then echo $(GNUTARFLAGS); \ + else :; \ + fi` + +# Flags to give 'gzip' when making a distribution. +GZIPFLAGS= -9n + +############################################################################### + +#MAKE= make + +cc= cc +CC= $(cc) -DTZDIR=\"$(TZDIR)\" + +AR= ar + +# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib. +RANLIB= : + +TZCOBJS= zic.o +TZDOBJS= zdump.o localtime.o asctime.o +DATEOBJS= date.o localtime.o strftime.o asctime.o +LIBSRCS= localtime.c asctime.c difftime.c +LIBOBJS= localtime.o asctime.o difftime.o +HEADERS= tzfile.h private.h +NONLIBSRCS= zic.c zdump.c +NEWUCBSRCS= date.c strftime.c +SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ + tzselect.ksh workman.sh +MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ + tzfile.5 tzselect.8 zic.8 zdump.8 +MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \ + time2posix.3.txt \ + tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \ + date.1.txt +COMMON= CONTRIBUTING LICENSE Makefile NEWS README Theory version +WEB_PAGES= tz-art.htm tz-how-to.html tz-link.htm +DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) +PRIMARY_YDATA= africa antarctica asia australasia \ + europe northamerica southamerica +YDATA= $(PRIMARY_YDATA) pacificnew etcetera backward +NDATA= systemv factory +TDATA= $(YDATA) $(NDATA) +ZONETABLES= zone1970.tab zone.tab +TABDATA= iso3166.tab leapseconds $(ZONETABLES) +LEAP_DEPS= leapseconds.awk leap-seconds.list +DATA= $(YDATA) $(NDATA) backzone $(TABDATA) \ + leap-seconds.list yearistype.sh +AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk +MISC= $(AWK_SCRIPTS) zoneinfo2tdf.pl +TZS_YEAR= 2050 +TZS= to$(TZS_YEAR).tzs +TZS_NEW= to$(TZS_YEAR)new.tzs +TZS_DEPS= $(PRIMARY_YDATA) asctime.c localtime.c \ + private.h tzfile.h zdump.c zic.c +ENCHILADA= $(COMMON) $(DOCS) $(SOURCES) $(DATA) $(MISC) $(TZS) + +# Consult these files when deciding whether to rebuild the 'version' file. +# This list is not the same as the output of 'git ls-files', since +# .gitignore is not distributed. +VERSION_DEPS= \ + CONTRIBUTING LICENSE Makefile NEWS README Theory \ + africa antarctica asctime.c asia australasia \ + backward backzone \ + checklinks.awk checktab.awk \ + date.1 date.c difftime.c \ + etcetera europe factory iso3166.tab \ + leap-seconds.list leapseconds.awk localtime.c \ + newctime.3 newstrftime.3 newtzset.3 northamerica \ + pacificnew private.h \ + southamerica strftime.c systemv \ + time2posix.3 tz-art.htm tz-how-to.html tz-link.htm \ + tzfile.5 tzfile.h tzselect.8 tzselect.ksh \ + workman.sh yearistype.sh \ + zdump.8 zdump.c zic.8 zic.c \ + zone.tab zone1970.tab zoneinfo2tdf.pl + +# And for the benefit of csh users on systems that assume the user +# shell should be used to handle commands in Makefiles. . . + +SHELL= /bin/sh + +all: tzselect yearistype zic zdump libtz.a $(TABDATA) + +ALL: all date $(ENCHILADA) + +install: all $(DATA) $(REDO) $(MANS) + mkdir -p $(DESTDIR)$(ETCDIR) $(DESTDIR)$(TZDIR) \ + $(DESTDIR)$(LIBDIR) \ + $(DESTDIR)$(MANDIR)/man3 $(DESTDIR)$(MANDIR)/man5 \ + $(DESTDIR)$(MANDIR)/man8 + $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) + cp -f iso3166.tab $(ZONETABLES) $(DESTDIR)$(TZDIR)/. + cp tzselect zic zdump $(DESTDIR)$(ETCDIR)/. + cp libtz.a $(DESTDIR)$(LIBDIR)/. + $(RANLIB) $(DESTDIR)$(LIBDIR)/libtz.a + cp -f newctime.3 newtzset.3 $(DESTDIR)$(MANDIR)/man3/. + cp -f tzfile.5 $(DESTDIR)$(MANDIR)/man5/. + cp -f tzselect.8 zdump.8 zic.8 $(DESTDIR)$(MANDIR)/man8/. + +INSTALL: ALL install date.1 + mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 + cp date $(DESTDIR)$(BINDIR)/. + cp -f date.1 $(DESTDIR)$(MANDIR)/man1/. + +version: $(VERSION_DEPS) + { (type git) >/dev/null 2>&1 && \ + V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \ + --abbrev=7 --dirty` || \ + V=$(VERSION); } && \ + printf '%s\n' "$$V" >$@.out + mv $@.out $@ + +version.h: version + VERSION=`cat version` && printf '%s\n' \ + 'static char const PKGVERSION[]="($(PACKAGE)) ";' \ + "static char const TZVERSION[]=\"$$VERSION\";" \ + 'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \ + >$@.out + mv $@.out $@ + +zdump: $(TZDOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS) + +zic: $(TZCOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS) + +yearistype: yearistype.sh + cp yearistype.sh yearistype + chmod +x yearistype + +leapseconds: $(LEAP_DEPS) + $(AWK) -f leapseconds.awk leap-seconds.list >$@.out + mv $@.out $@ + +# Arguments to pass to submakes of install_data. +# They can be overridden by later submake arguments. +INSTALLARGS = \ + DESTDIR=$(DESTDIR) \ + LEAPSECONDS='$(LEAPSECONDS)' \ + PACKRATDATA='$(PACKRATDATA)' \ + TZDIR=$(TZDIR) \ + YEARISTYPE=$(YEARISTYPE) \ + ZIC='$(ZIC)' + +# 'make install_data' installs one set of tz binary files. +# It can be tailored by setting LEAPSECONDS, PACKRATDATA, etc. +install_data: zic leapseconds yearistype $(PACKRATDATA) $(TDATA) + $(ZIC_INSTALL) $(TDATA) + $(AWK) '/^Rule/' $(TDATA) | $(ZIC_INSTALL) - $(PACKRATDATA) + +posix_only: + $(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data + +right_only: + $(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \ + install_data + +# In earlier versions of this makefile, the other two directories were +# subdirectories of $(TZDIR). However, this led to configuration errors. +# For example, with posix_right under the earlier scheme, +# TZ='right/Australia/Adelaide' got you localtime with leap seconds, +# but gmtime without leap seconds, which led to problems with applications +# like sendmail that subtract gmtime from localtime. +# Therefore, the other two directories are now siblings of $(TZDIR). +# You must replace all of $(TZDIR) to switch from not using leap seconds +# to using them, or vice versa. +right_posix: right_only + rm -fr $(DESTDIR)$(TZDIR)-leaps + ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-leaps || \ + $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only + $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only + +posix_right: posix_only + rm -fr $(DESTDIR)$(TZDIR)-posix + ln -s $(TZDIR_BASENAME) $(DESTDIR)$(TZDIR)-posix || \ + $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-posix posix_only + $(MAKE) $(INSTALLARGS) TZDIR=$(TZDIR)-leaps right_only + +# This obsolescent rule is present for backwards compatibility with +# tz releases 2014g through 2015g. It should go away eventually. +posix_packrat: + $(MAKE) $(INSTALLARGS) PACKRATDATA=backzone posix_only + +zones: $(REDO) + +$(TZS_NEW): $(TDATA) zdump zic + mkdir -p tzs.dir + $(zic) -d tzs.dir $(TDATA) + $(AWK) '/^Link/{print $$1 "\t" $$2 "\t" $$3}' \ + $(TDATA) | LC_ALL=C sort >$@.out + wd=`pwd` && \ + zones=`$(AWK) -v wd="$$wd" \ + '/^Zone/{print wd "/tzs.dir/" $$2}' $(TDATA) \ + | LC_ALL=C sort` && \ + ./zdump -i -c $(TZS_YEAR) $$zones >>$@.out + sed 's,^TZ=".*tzs\.dir/,TZ=",' $@.out >$@.sed.out + rm -fr tzs.dir $@.out + mv $@.sed.out $@ + +# If $(TZS) does not already exist (e.g., old-format tarballs), create it. +# If it exists but 'make check_tzs' fails, a maintainer should inspect the +# failed output and fix the inconsistency, perhaps by running 'make force_tzs'. +$(TZS): + $(MAKE) force_tzs + +force_tzs: $(TZS_NEW) + cp $(TZS_NEW) $(TZS) + +libtz.a: $(LIBOBJS) + rm -f $@ + $(AR) -rc $@ $(LIBOBJS) + $(RANLIB) $@ + +date: $(DATEOBJS) + $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS) + +tzselect: tzselect.ksh version + VERSION=`cat version` && sed \ + -e 's|#!/bin/bash|#!$(KSHELL)|g' \ + -e 's|AWK=[^}]*|AWK=$(AWK)|g' \ + -e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \ + -e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \ + -e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \ + -e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \ + <$@.ksh >$@.out + chmod +x $@.out + mv $@.out $@ + +check: check_character_set check_white_space check_links check_sorted \ + check_tables check_tzs check_web + +check_character_set: $(ENCHILADA) + LC_ALL=en_US.utf8 && export LC_ALL && \ + sharp='#' && \ + ! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \ + $(MISC) $(SOURCES) $(WEB_PAGES) \ + CONTRIBUTING LICENSE Makefile README version && \ + ! grep -Env $(SAFE_SHARP_LINE) $(TDATA) backzone \ + leapseconds yearistype.sh zone.tab && \ + ! grep -Env $(OK_LINE) $(ENCHILADA) + +check_white_space: $(ENCHILADA) + patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \ + ! grep -En "$$pat" $(ENCHILADA) + ! grep -n '[[:space:]]$$' $(ENCHILADA) + +CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; } + +check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab + $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu + $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu + $(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu + $(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c + $(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \ + LC_ALL=C sort -c + $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ + LC_ALL=C sort -cu + +check_links: checklinks.awk $(TDATA) + $(AWK) -f checklinks.awk $(TDATA) + +check_tables: checktab.awk $(PRIMARY_YDATA) $(ZONETABLES) + for tab in $(ZONETABLES); do \ + $(AWK) -f checktab.awk -v zone_table=$$tab $(PRIMARY_YDATA) \ + || exit; \ + done + +check_tzs: $(TZS) $(TZS_NEW) + diff -u $(TZS) $(TZS_NEW) + +check_web: $(WEB_PAGES) + $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) $(WEB_PAGES) + +clean_misc: + rm -f core *.o *.out \ + date tzselect version.h zdump zic yearistype libtz.a +clean: clean_misc + rm -fr *.dir tzdb-*/ $(TZS_NEW) + +maintainer-clean: clean + @echo 'This command is intended for maintainers to use; it' + @echo 'deletes files that may need special tools to rebuild.' + rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.* + +names: + @echo $(ENCHILADA) + +public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \ + tarballs signatures + +date.1.txt: date.1 +newctime.3.txt: newctime.3 +newstrftime.3.txt: newstrftime.3 +newtzset.3.txt: newtzset.3 +time2posix.3.txt: time2posix.3 +tzfile.5.txt: tzfile.5 +tzselect.8.txt: tzselect.8 +zdump.8.txt: zdump.8 +zic.8.txt: zic.8 + +$(MANTXTS): workman.sh + LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out + mv $@.out $@ + +# Set the time stamps to those of the git repository, if available, +# and if the files have not changed since then. +# This uses GNU 'touch' syntax 'touch -d@N FILE', +# where N is the number of seconds since 1970. +# If git or GNU 'touch' is absent, don't bother to sync with git timestamps. +# Also, set the timestamp of each prebuilt file like 'leapseconds' +# to be the maximum of the files it depends on. +set-timestamps.out: $(ENCHILADA) + rm -f $@ + if (type git) >/dev/null 2>&1 && \ + files=`git ls-files $(ENCHILADA)` && \ + touch -md @1 test.out; then \ + rm -f test.out && \ + for file in $$files; do \ + if git diff --quiet $$file; then \ + time=`git log -1 --format='tformat:%ct' $$file` && \ + touch -cmd @$$time $$file; \ + else \ + echo >&2 "$$file: warning: does not match repository"; \ + fi || exit; \ + done; \ + fi + touch -cmr `ls -t $(LEAP_DEPS) | sed 1q` leapseconds + for file in `ls $(MANTXTS) | sed 's/\.txt$$//'`; do \ + touch -cmr `ls -t $$file workman.sh | sed 1q` $$file.txt || \ + exit; \ + done + touch -cmr `ls -t $(TZS_DEPS) | sed 1q` $(TZS) + touch -cmr `ls -t $(VERSION_DEPS) | sed 1q` version + touch $@ + +# The zics below ensure that each data file can stand on its own. +# We also do an all-files run to catch links to links. + +check_public: + $(MAKE) maintainer-clean + $(MAKE) "CFLAGS=$(GCC_DEBUG_FLAGS)" ALL + mkdir -p public.dir + for i in $(TDATA) ; do \ + $(zic) -v -d public.dir $$i 2>&1 || exit; \ + done + $(zic) -v -d public.dir $(TDATA) + rm -fr public.dir + +# Check that the code works under various alternative +# implementations of time_t. +check_time_t_alternatives: + if diff -q Makefile Makefile 2>/dev/null; then \ + quiet_option='-q'; \ + else \ + quiet_option=''; \ + fi && \ + wd=`pwd` && \ + zones=`$(AWK) '/^[^#]/ { print $$3 }' time_t.dir/int64_t.out && \ + time_t.dir/$$type/etc/zdump -V -t $$range $$zones \ + >time_t.dir/$$type.out && \ + diff -u time_t.dir/int64_t.out time_t.dir/$$type.out \ + || exit; \ + done + rm -fr time_t.dir + +tarballs traditional_tarballs signatures traditional_signatures: version + VERSION=`cat version` && \ + $(MAKE) VERSION="$$VERSION" $@_version + +tarballs_version: traditional_tarballs_version tzdb-$(VERSION).tar.lz +traditional_tarballs_version: \ + tzcode$(VERSION).tar.gz tzdata$(VERSION).tar.gz +signatures_version: traditional_signatures_version tzdb-$(VERSION).tar.lz.asc +traditional_signatures_version: \ + tzcode$(VERSION).tar.gz.asc tzdata$(VERSION).tar.gz.asc \ + +tzcode$(VERSION).tar.gz: set-timestamps.out + LC_ALL=C && export LC_ALL && \ + tar $(TARFLAGS) -cf - \ + $(COMMON) $(DOCS) $(SOURCES) | \ + gzip $(GZIPFLAGS) >$@.out + mv $@.out $@ + +tzdata$(VERSION).tar.gz: set-timestamps.out + LC_ALL=C && export LC_ALL && \ + tar $(TARFLAGS) -cf - $(COMMON) $(DATA) $(MISC) | \ + gzip $(GZIPFLAGS) >$@.out + mv $@.out $@ + +tzdb-$(VERSION).tar.lz: set-timestamps.out + rm -fr tzdb-$(VERSION) + mkdir tzdb-$(VERSION) + ln $(ENCHILADA) tzdb-$(VERSION) + touch -cmr `ls -t tzdb-$(VERSION)/* | sed 1q` tzdb-$(VERSION) + LC_ALL=C && export LC_ALL && \ + tar $(TARFLAGS) -cf - tzdb-$(VERSION) | lzip -9 >$@.out + mv $@.out $@ + +tzcode$(VERSION).tar.gz.asc: tzcode$(VERSION).tar.gz + gpg --armor --detach-sign $? + +tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz + gpg --armor --detach-sign $? + +tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz + gpg --armor --detach-sign $? + +typecheck: + $(MAKE) clean + for i in "long long" unsigned; \ + do \ + $(MAKE) CFLAGS="-DTYPECHECK -D__time_t_defined -D_TIME_T \"-Dtime_t=$$i\"" ; \ + ./zdump -v Europe/Rome ; \ + $(MAKE) clean ; \ + done + +zonenames: $(TDATA) + @$(AWK) '/^Zone/ { print $$2 } /^Link/ { print $$3 }' $(TDATA) + +asctime.o: private.h tzfile.h +date.o: private.h +difftime.o: private.h +localtime.o: private.h tzfile.h +strftime.o: private.h tzfile.h +zdump.o: version.h +zic.o: private.h tzfile.h version.h + +.KEEP_STATE: + +.PHONY: ALL INSTALL all +.PHONY: check check_character_set check_links +.PHONY: check_public check_sorted check_tables +.PHONY: check_time_t_alternatives check_tzs check_web check_white_space +.PHONY: clean clean_misc force_tzs +.PHONY: install install_data maintainer-clean names +.PHONY: posix_only posix_packrat posix_right +.PHONY: public right_only right_posix signatures signatures_version +.PHONY: tarballs tarballs_version typecheck +.PHONY: zonenames zones Copied: vendor/tzdata/tzdata2017b/NEWS (from r316058, vendor/tzdata/dist/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/tzdata/tzdata2017b/NEWS Mon Mar 27 20:57:44 2017 (r316059, copy of r316058, vendor/tzdata/dist/NEWS) @@ -0,0 +1,3947 @@ +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. + + Changes to future time stamps + + Saratov, Russia switches from +03 to +04 on 2016-12-04 at 02:00. + This hives off a new zone Europe/Saratov from Europe/Volgograd. + (Thanks to Yuri Konotopov and Stepan Golosunov.) + + Changes to past time stamps + + The new zone Asia/Atyrau for AtyraÅ« Region, Kazakhstan, is like + 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 + + Asia/Gaza and Asia/Hebron now use "EEST", not "EET", to denote + summer time before 1948. The old use of "EET" was a typo. + + Changes to code + + zic no longer mishandles file systems that lack hard links, fixing + bugs introduced in 2016g. (Problems reported by Tom Lane.) + Also, when the destination already contains symbolic links, zic + should now work better on systems where the 'link' system call + does not follow symbolic links. + + Changes to documentation and commentary + + tz-link.htm now documents the relationship between release version + numbers and development-repository commit tags. (Suggested by + Paul Koning.) + + The 'Theory' file now documents UT. + + iso3166.tab now accents "Curaçao", and commentary now mentions + the names "Cabo Verde" and "Czechia". (Thanks to Jiří BoháÄ.) + + +Release 2016i - 2016-11-01 23:19:52 -0700 + + Briefly: Cyprus split into two time zones on 2016-10-30, and Tonga + reintroduces DST on 2016-11-06. + + Changes to future time stamps + + Pacific/Tongatapu begins DST on 2016-11-06 at 02:00, ending on + 2017-01-15 at 03:00. Assume future observances in Tonga will be + from the first Sunday in November through the third Sunday in + January, like Fiji. (Thanks to Pulu Ê»Anau.) Switch to numeric + time zone abbreviations for this zone. + + Changes to past and future time stamps + + Northern Cyprus is now +03 year round, causing a split in Cyprus + time zones starting 2016-10-30 at 04:00. This creates a zone + Asia/Famagusta. (Thanks to Even Scharning and Matt Johnson.) + + Antarctica/Casey switched from +08 to +11 on 2016-10-22. + (Thanks to Steffen Thorsen.) + + Changes to past time stamps + + Several corrections were made for pre-1975 time stamps in Italy. + These affect Europe/Malta, Europe/Rome, Europe/San_Marino, and + Europe/Vatican. + + First, the 1893-11-01 00:00 transition in Italy used the new UT + offset (+01), not the old (+00:49:56). (Thanks to Michael *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Mar 27 21:00:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F15D204B4; Mon, 27 Mar 2017 21:00:51 +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 1FAED303; Mon, 27 Mar 2017 21:00:51 +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 v2RL0oTC083896; Mon, 27 Mar 2017 21:00:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RL0nuF083889; Mon, 27 Mar 2017 21:00:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703272100.v2RL0nuF083889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Mar 2017 21:00:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316060 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 21:00:51 -0000 Author: bapt Date: Mon Mar 27 21:00:49 2017 New Revision: 316060 URL: https://svnweb.freebsd.org/changeset/base/316060 Log: Import tzdata 2017b MFC after: 2 days Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/Theory head/contrib/tzdata/africa head/contrib/tzdata/antarctica head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/backward head/contrib/tzdata/backzone head/contrib/tzdata/europe head/contrib/tzdata/leap-seconds.list head/contrib/tzdata/leapseconds head/contrib/tzdata/northamerica head/contrib/tzdata/southamerica head/contrib/tzdata/version head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Mon Mar 27 20:57:44 2017 (r316059) +++ head/contrib/tzdata/Makefile Mon Mar 27 21:00:49 2017 (r316060) @@ -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: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Mon Mar 27 20:57:44 2017 (r316059) +++ head/contrib/tzdata/NEWS Mon Mar 27 21:00:49 2017 (r316060) @@ -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: head/contrib/tzdata/Theory ============================================================================== --- head/contrib/tzdata/Theory Mon Mar 27 20:57:44 2017 (r316059) +++ head/contrib/tzdata/Theory Mon Mar 27 21:00:49 2017 (r316060) @@ -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: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Mon Mar 27 20:57:44 2017 (r316059) +++ head/contrib/tzdata/africa Mon Mar 27 21:00:49 2017 (r316060) @@ -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: head/contrib/tzdata/antarctica ============================================================================== --- head/contrib/tzdata/antarctica Mon Mar 27 20:57:44 2017 (r316059) +++ head/contrib/tzdata/antarctica Mon Mar 27 21:00:49 2017 (r316060) @@ -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: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Mon Mar 27 20:57:44 2017 (r316059) +++ head/contrib/tzdata/asia Mon Mar 27 21:00:49 2017 (r316060) @@ -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-all@freebsd.org Mon Mar 27 21:02:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36268D206BE; Mon, 27 Mar 2017 21:02: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 E1258939; Mon, 27 Mar 2017 21:02: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 v2RL2MOW087696; Mon, 27 Mar 2017 21:02:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RL2Meg087695; Mon, 27 Mar 2017 21:02:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201703272102.v2RL2Meg087695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 27 Mar 2017 21:02:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316061 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 21:02:24 -0000 Author: bapt Date: Mon Mar 27 21:02:22 2017 New Revision: 316061 URL: https://svnweb.freebsd.org/changeset/base/316061 Log: Update pci_vendors to 2017-03-16 Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Mon Mar 27 21:00:49 2017 (r316060) +++ head/share/misc/pci_vendors Mon Mar 27 21:02:22 2017 (r316061) @@ -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-all@freebsd.org Mon Mar 27 22:00:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EC58D2087D; Mon, 27 Mar 2017 22:00:04 +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 4FA65B15; Mon, 27 Mar 2017 22:00:04 +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 v2RM038Y008038; Mon, 27 Mar 2017 22:00:03 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RM03cN008036; Mon, 27 Mar 2017 22:00:03 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703272200.v2RM03cN008036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 27 Mar 2017 22:00:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316062 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 22:00:04 -0000 Author: np Date: Mon Mar 27 22:00:03 2017 New Revision: 316062 URL: https://svnweb.freebsd.org/changeset/base/316062 Log: 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. Submitted by: KrishnamRaju ErapaRaju @ Chelsio (original version) MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 27 21:02:22 2017 (r316061) +++ head/sys/dev/cxgbe/iw_cxgbe/cm.c Mon Mar 27 22:00:03 2017 (r316062) @@ -76,15 +76,15 @@ 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); @@ -115,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", \ @@ -224,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; } @@ -247,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); } /* @@ -733,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) { @@ -2388,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) @@ -2430,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; @@ -2479,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); @@ -2494,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: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Mar 27 21:02:22 2017 (r316061) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Mon Mar 27 22:00:03 2017 (r316062) @@ -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; From owner-svn-src-all@freebsd.org Mon Mar 27 22:34:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD27D2050B; Mon, 27 Mar 2017 22:34:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C17863F; Mon, 27 Mar 2017 22:34:45 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RMYixO024085; Mon, 27 Mar 2017 22:34:44 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RMYiJA024082; Mon, 27 Mar 2017 22:34:44 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201703272234.v2RMYiJA024082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 27 Mar 2017 22:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316063 - in head: etc/mtree lib/libevent lib/libsqlite3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 22:34:45 -0000 Author: adrian Date: Mon Mar 27 22:34:43 2017 New Revision: 316063 URL: https://svnweb.freebsd.org/changeset/base/316063 Log: [private] add libevent1 and sqlite3 include files for our private libraries. This, like including ucl private headers, is useful for writing new base system tools. Yes, anyone using these libraries shouldn't assume ABI compatibility. Reviewed by: bdrewery, bapt Differential Revision: https://reviews.freebsd.org/D10123 Modified: head/etc/mtree/BSD.usr.dist head/lib/libevent/Makefile head/lib/libsqlite3/Makefile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Mon Mar 27 22:00:03 2017 (r316062) +++ head/etc/mtree/BSD.usr.dist Mon Mar 27 22:34:43 2017 (r316063) @@ -11,6 +11,10 @@ private bsdstat .. + event + .. + sqlite3 + .. ucl .. .. Modified: head/lib/libevent/Makefile ============================================================================== --- head/lib/libevent/Makefile Mon Mar 27 22:00:03 2017 (r316062) +++ head/lib/libevent/Makefile Mon Mar 27 22:34:43 2017 (r316063) @@ -10,7 +10,7 @@ SHLIB_MAJOR= 1 PRIVATELIB= SRCS= buffer.c evbuffer.c event.c kqueue.c log.c poll.c select.c signal.c -HDRS= event.h +INCS= event.h CFLAGS+= -I${.CURDIR} \ -DHAVE_CLOCK_GETTIME \ Modified: head/lib/libsqlite3/Makefile ============================================================================== --- head/lib/libsqlite3/Makefile Mon Mar 27 22:00:03 2017 (r316062) +++ head/lib/libsqlite3/Makefile Mon Mar 27 22:34:43 2017 (r316063) @@ -7,6 +7,7 @@ SHLIB_MAJOR?= 0 LIBADD+= pthread SRCS= sqlite3.c +INCS= sqlite3.h sqlite3ext.h SQLITE= ${SRCTOP}/contrib/sqlite3 .PATH: ${SQLITE} From owner-svn-src-all@freebsd.org Mon Mar 27 22:53:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7ADAD209D6; Mon, 27 Mar 2017 22:53:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B76E8199; Mon, 27 Mar 2017 22:53:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RMradV032488; Mon, 27 Mar 2017 22:53:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RMra2L032487; Mon, 27 Mar 2017 22:53:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703272253.v2RMra2L032487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 27 Mar 2017 22:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316064 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 22:53:38 -0000 Author: imp Date: Mon Mar 27 22:53:36 2017 New Revision: 316064 URL: https://svnweb.freebsd.org/changeset/base/316064 Log: Fix build with path names with 'align' or 'nop' in them. clang is now inserting .file directives with the entire path in them. This is fine, except that our sed peephole optimizer removes them if ${SRCTOP} or ${OBJTOP} contains 'align' or 'nop', leading to build failures. The sed peephole optimizer removes useful things for boot2 when used with clang, so restrict its use to gcc. Also, gcc no longer generates nops to pad things, so there's no point in removing it. Specialize the optimization to just removing the .align 4 lines to preclude inadvertant path matching. Sponsored by: Netflix Commit brought to you the path: /home/xxx/NCD-3592-logsynopts/FreeBSD Modified: head/sys/boot/i386/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:34:43 2017 (r316063) +++ head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:53:36 2017 (r316064) @@ -91,10 +91,18 @@ boot2.o: boot2.s SRCS= boot2.c boot2.h +# Gcc (4.2.1 at least) benefits from removing the forced alignment +# clang doesn't. Make the removal as specific as possible to avoid +# false positives (like path names with odd names for debugging info). +# In the past, gcc benefited from nop removal, but not in 4.2.1. +# Think of this as a poor-man's peephole optimizer for gcc 4.2.1 boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c - sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s - rm -f boot2.s.tmp +.if ${COMPILER_TYPE} == "gcc" + sed -e '/\.align 4/d' < boot2.s.tmp > boot2.s +.else + cp boot2.s.tmp boot2.s +.endif boot2.h: boot1.out ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ From owner-svn-src-all@freebsd.org Mon Mar 27 23:48:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B509ED20B7D; Mon, 27 Mar 2017 23:48:37 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C01F78A; Mon, 27 Mar 2017 23:48:37 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2RNma9D053073; Mon, 27 Mar 2017 23:48:36 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2RNmaEf053072; Mon, 27 Mar 2017 23:48:36 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201703272348.v2RNmaEf053072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Mon, 27 Mar 2017 23:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316065 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 23:48:37 -0000 Author: karels Date: Mon Mar 27 23:48:36 2017 New Revision: 316065 URL: https://svnweb.freebsd.org/changeset/base/316065 Log: Enable route and LLE (ndp) caching in TCP/IPv6 tcp_output.c was using a route on the stack for IPv6, which does not allow route caching or LLE/ndp caching. Switch to using the route (v6 flavor) in the in_pcb, which was already present, which caches both L3 and L2 lookups. Reviewed by: gnn hiren MFC after: 2 weeks Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Mar 27 22:53:36 2017 (r316064) +++ head/sys/netinet/tcp_output.c Mon Mar 27 23:48:36 2017 (r316065) @@ -1377,9 +1377,6 @@ send: */ #ifdef INET6 if (isipv6) { - struct route_in6 ro; - - bzero(&ro, sizeof(ro)); /* * we separately set hoplimit for every segment, since the * user might want to change the value via setsockopt. @@ -1411,13 +1408,13 @@ send: #endif /* TODO: IPv6 IP6TOS_ECT bit on */ - error = ip6_output(m, tp->t_inpcb->in6p_outputopts, &ro, + error = ip6_output(m, tp->t_inpcb->in6p_outputopts, + &tp->t_inpcb->inp_route6, ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), NULL, NULL, tp->t_inpcb); - if (error == EMSGSIZE && ro.ro_rt != NULL) - mtu = ro.ro_rt->rt_mtu; - RO_RTFREE(&ro); + if (error == EMSGSIZE && tp->t_inpcb->inp_route6.ro_rt != NULL) + mtu = tp->t_inpcb->inp_route6.ro_rt->rt_mtu; } #endif /* INET6 */ #if defined(INET) && defined(INET6) From owner-svn-src-all@freebsd.org Tue Mar 28 00:39:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42160D1E919; Tue, 28 Mar 2017 00:39:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EEBECDB; Tue, 28 Mar 2017 00:39:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2S0dggU073162; Tue, 28 Mar 2017 00:39:42 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S0dgpt073161; Tue, 28 Mar 2017 00:39:42 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201703280039.v2S0dgpt073161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 28 Mar 2017 00:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316066 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 00:39:43 -0000 Author: bdrewery Date: Tue Mar 28 00:39:41 2017 New Revision: 316066 URL: https://svnweb.freebsd.org/changeset/base/316066 Log: Release ccb if mode_buffer allocation fails. MFC after: 2 weeks Obtained from: OneFS Sponsored by: Dell EMC Isilon Modified: head/sys/cam/scsi/scsi_ch.c Modified: head/sys/cam/scsi/scsi_ch.c ============================================================================== --- head/sys/cam/scsi/scsi_ch.c Mon Mar 27 23:48:36 2017 (r316065) +++ head/sys/cam/scsi/scsi_ch.c Tue Mar 28 00:39:41 2017 (r316066) @@ -1569,6 +1569,7 @@ chgetparams(struct cam_periph *periph) if (mode_buffer == NULL) { printf("chgetparams: couldn't malloc mode sense data\n"); + xpt_release_ccb(ccb); return(ENOSPC); } From owner-svn-src-all@freebsd.org Tue Mar 28 00:57:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D407D1EF9E; Tue, 28 Mar 2017 00:57:35 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F4188813; Tue, 28 Mar 2017 00:57:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2S0vYHs081348; Tue, 28 Mar 2017 00:57:34 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S0vXO1081343; Tue, 28 Mar 2017 00:57:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703280057.v2S0vXO1081343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 28 Mar 2017 00:57:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316067 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 00:57:35 -0000 Author: emaste Date: Tue Mar 28 00:57:33 2017 New Revision: 316067 URL: https://svnweb.freebsd.org/changeset/base/316067 Log: Remove usfs(4) from arm kernel configs cfumass(4) is not usable if usfs(4) is loaded or compiled into the kernel. Remove usfs so that the user may kldload the USB mass storage target they prefer. PR: 218169 Reviewed by: trasz, hselasky (no objection) Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10153 Modified: head/sys/arm/conf/ATMEL head/sys/arm/conf/BEAGLEBONE head/sys/arm/conf/EB9200 head/sys/arm/conf/GENERIC head/sys/arm/conf/KB920X Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Tue Mar 28 00:39:41 2017 (r316066) +++ head/sys/arm/conf/ATMEL Tue Mar 28 00:57:33 2017 (r316067) @@ -145,7 +145,6 @@ device umass # Disks/Mass storage - R # USB device (gadget) support device at91_dci # Atmel's usb device -device usfs # emulate a flash device cdce # emulate an ethernet device usb_template # Control of the gadget Modified: head/sys/arm/conf/BEAGLEBONE ============================================================================== --- head/sys/arm/conf/BEAGLEBONE Tue Mar 28 00:39:41 2017 (r316066) +++ head/sys/arm/conf/BEAGLEBONE Tue Mar 28 00:57:33 2017 (r316067) @@ -114,9 +114,8 @@ device bpf # USB Ethernet support, requires miibus device miibus -# Device mode support and USFS template +# Device mode support device usb_template # Control of the gadget -device usfs # Pinmux device fdt_pinctrl Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Tue Mar 28 00:39:41 2017 (r316066) +++ head/sys/arm/conf/EB9200 Tue Mar 28 00:57:33 2017 (r316067) @@ -111,7 +111,6 @@ device umass # Disks/Mass storage - R # USB device (gadget) support #device at91_dci # Atmel's usb device -#device usfs # emulate a flash #device cdce # emulate an ethernet #device usb_template # Control of the gadget Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Tue Mar 28 00:39:41 2017 (r316066) +++ head/sys/arm/conf/GENERIC Tue Mar 28 00:57:33 2017 (r316067) @@ -183,9 +183,8 @@ device umass # Disks/Mass storage - R device uhid # "Human Interface Devices" device ukbd # Allow keyboard like HIDs to control console -# Device mode support and USFS template +# Device mode support device usb_template # Control of the gadget -device usfs # Ethernet device loop Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Tue Mar 28 00:39:41 2017 (r316066) +++ head/sys/arm/conf/KB920X Tue Mar 28 00:57:33 2017 (r316067) @@ -153,7 +153,6 @@ device zyd # ZyDAS zd1211/zd1211b wir # USB device (gadget) support device at91_dci # Atmel's usb device -device usfs # emulate a flash device cdce # emulate an ethernet device usb_template # Control of the gadget From owner-svn-src-all@freebsd.org Tue Mar 28 04:48:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 04:48:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 05:53:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F9B3D215F5; Tue, 28 Mar 2017 05:53:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 0BA28C6A; Tue, 28 Mar 2017 05:53:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 056BBD4B469; Tue, 28 Mar 2017 16:53:43 +1100 (AEDT) Date: Tue, 28 Mar 2017 16:53:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-Reply-To: <201703272253.v2RMra2L032487@repo.freebsd.org> Message-ID: <20170328141213.T927@besplex.bde.org> References: <201703272253.v2RMra2L032487@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=aeK8h4ylv7gmVhhUwpwA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 05:53:55 -0000 On Mon, 27 Mar 2017, Warner Losh wrote: > Log: > Fix build with path names with 'align' or 'nop' in them. > > clang is now inserting .file directives with the entire path in > them. This is fine, except that our sed peephole optimizer removes > them if ${SRCTOP} or ${OBJTOP} contains 'align' or 'nop', leading to > build failures. The sed peephole optimizer removes useful things for > boot2 when used with clang, so restrict its use to gcc. Also, gcc no > longer generates nops to pad things, so there's no point in removing > it. Specialize the optimization to just removing the .align 4 lines to > preclude inadvertant path matching. > > Sponsored by: Netflix > Commit brought to you the path: /home/xxx/NCD-3592-logsynopts/FreeBSD > > Modified: > head/sys/boot/i386/boot2/Makefile > > Modified: head/sys/boot/i386/boot2/Makefile > ============================================================================== > --- head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:34:43 2017 (r316063) > +++ head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:53:36 2017 (r316064) > @@ -91,10 +91,18 @@ boot2.o: boot2.s > > SRCS= boot2.c boot2.h > > +# Gcc (4.2.1 at least) benefits from removing the forced alignment > +# clang doesn't. Make the removal as specific as possible to avoid > +# false positives (like path names with odd names for debugging info). > +# In the past, gcc benefited from nop removal, but not in 4.2.1. > +# Think of this as a poor-man's peephole optimizer for gcc 4.2.1 > boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c > ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c > - sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s > - rm -f boot2.s.tmp > +.if ${COMPILER_TYPE} == "gcc" > + sed -e '/\.align 4/d' < boot2.s.tmp > boot2.s > +.else > + cp boot2.s.tmp boot2.s > +.endif > > boot2.h: boot1.out > ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ That's silly; if you just fix the regexps to actually be as specifice as possible, then they would just work with no need for large comments or ifdefs. '\.align' instead of 'align' is a good start. ' 4' instead of nothing is not so good. There should also be a check for nothing except whitespace before '\.align'. The whitespace before '4' might be a tab, but perhaps gcc only generates a space, and only generates unwanted alignments of precisely 4, with no fill bytes. The general syntax would be too hard to parse, but it is easy to handle any digit, and also '\.p2align', and allow nothing except whitespace after the digit. Last time I looked at this about 5 years ago, but after clang, the whole optimization step was silly. It made little difference for gcc and no difference for clang as you say. The nop removal that you removed was silliest. I think compilers stopped generating nops for padding many years before that code was written. In text sections, They should generate something like '.p2align x,y,z', where x is the alignment, y is empty (it is the fill byte, which defaults to nop, but we don't want that but want a larger null instruction for multiple bytes) and z is a limit on the amount of padding (x is only a preference and z limits it). This syntax would be hard to parse. But CFLAGS has -Os, and that works for preventing padding in the text section, so nop is never generated, not even with the spelling 'align'. -Os doesn't work so well for other things. For kernels, it is completely broken with gcc-4.2.1 unless -fno-inline-functions is also used (it breaks the inlining parameters whose misconfiguration is probably the actual bug. This doesn't seem to be a problem for boot code. IIRC, the only simply broken thing is that alignment is still done for variables. This generates ".align 4". -Os is differently broken for clang, so the simple editing doesn't help. -Wa,-al to see what the assembler is doing is broken for clang. -mpreferred-stack-boundary doesn't work for clang, so is not used, but clang does better stack alignment by default. This might still waste some instructions, but not for every function. -mno-align-long-strings doesn't work for clang or for gcc > 4.2.1, so is not used. clang does quite different string padding by default, and IIRC it is worse. But boot2 hardly has any long strings. boot code is hard to test since it is not modular. This is much more broken than when I last tested the size of boot2.o. The most obvious new bugs are: - something like SRCTOP breaks finding the relative path to ufs headers in a FreeBSD-11 sys tree - ${CLANG_OPT_SMALL} is added for all compilers. This is defined out-of-tree in /usr/share/mk/bsd.sys.mk. (I tested on a host running nearly -current with a nearly FreeBSD-10 sys tree). In boot2, CLANG_P{T_SMALL is wrong even for clang since it contains -mstack-alignment=8 unconditionally, but the stack alignment should be 4 or even 1 with -m32 -Os. Fixing this makes no difference for boot2.o compiled by clang. The corresponding -mpreferred-stack-boundary=2 for gcc is configured correctly in boot2/Makefile. After fixing this, simply "CC=gcc-4.2.1 make boot2.o". Adding -Wa,-al to CC also works (-Wa,-al is broken for clang, and clang produces a boot2.s which cannot be assembled by gas). The file sizes for FreeBSD-10 are: text data bss dec hex filename 5126 12 4940 10078 0x275e clang/boot2-unhacked.o 5126 9 4940 10075 0x275b clang/boot2.o 5036 32 4928 9996 0x270c gcc/boot-unhacked.o 5032 29 4928 9989 0x2705 gcc/boot2.o In other words, the editing saves a whole 4 bytes of text and 3 bytes of data for gcc. It also saves a whole 3 bytes of data for clang, and you just broke this :-). (I would be surprised if the data isn't padded back to a multiple of 4 anyway.) After the reductions, the result with gcc is 86 bytes smaller than with clang, instead of only 82 bytes smaller. It is silly doing such small optimizations specially. The editing actually removes 22 alignment statements, all spelled "^\.align4$'. All of these are for data. -Wa,-al shows that the padding is 2 instances of 2 bytes and 1 of 3 bytes. At least half of the padding is for pessimal layout which is also a style bug in the source code. Arrays of characters are mixed with 32-bit variables. Style(9) says to sort on size (it means on alignment/ element size), to minimize padding (mainly for structs) and get a conistent order as a side effect. The padding usually doesn't matter except for structs. After fixing the source code, there would be just 1 odd byte in a character array that normally causes 3 bytes of padding after it. It takes considerably more magic to avoid getting this padding anyway in the link step, In the old a.out boot blocks, the linker forces 16-byte alignment at the end of every object file. The old boot blocks put most of the data in a single object file to avoid an aerage of 8 bytes of padding between files. Elf is more flexible, and usually gives 4-byte alignment. I think it is possible to match an odd byte at the end of 1 object file with an odd 3 bytes at the beginning of the next object file, but this usually doesn't happen. The new boot2 uses hacks like including ufsread.c to avoid having lots of object files. I use the old a.out boot blocks updated to elf and EDD and have squeezed them more extensively. The squeezing is also silly since I could very easily switch to 64K ones (much larger than that is not easy, since they have to fit below 640K and a few multiples of 64K are already used for buffers). The limit on 8K is mainly a historical mistake. A limit of 7.5K simplified booting from 15-sector floppies. 18-sector floppies allowed easy expansion to 9K, but were unportable for a small gain. The default partition layout left only 8K below the ffs superblock, but was only a default. Bruce From owner-svn-src-all@freebsd.org Tue Mar 28 05:57:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 06:03:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 06:05:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 06:08:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 06:13:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 06:13:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 06:19:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6FC5D21A82; Tue, 28 Mar 2017 06:19:23 +0000 (UTC) (envelope-from julian@vps1.elischer.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C54784; Tue, 28 Mar 2017 06:19:23 +0000 (UTC) (envelope-from julian@vps1.elischer.org) Received: from vps1.elischer.org (localhost [127.0.0.1]) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPS id v2S6JEp0073751 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 27 Mar 2017 23:19:16 -0700 (PDT) (envelope-from julian@vps1.elischer.org) Received: from localhost (julian@localhost) by vps1.elischer.org (8.15.2/8.15.2/Submit) with ESMTP id v2S6JEIB073748; Mon, 27 Mar 2017 23:19:14 -0700 (PDT) (envelope-from julian@vps1.elischer.org) Date: Mon, 27 Mar 2017 23:19:14 -0700 (PDT) From: Julian Elischer To: Bruce Evans cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-Reply-To: <20170328141213.T927@besplex.bde.org> Message-ID: References: <201703272253.v2RMra2L032487@repo.freebsd.org> <20170328141213.T927@besplex.bde.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:19:24 -0000 On Tue, 28 Mar 2017, Bruce Evans wrote: [...] > they have to fit below 640K and a few multiples of 64K are already > used for buffers). The limit on 8K is mainly a historical mistake. > A limit of 7.5K simplified booting from 15-sector floppies. 18-sector My memory says that the limit of 7.5K is becuase there was only 8k left free at the front of UFS1 and one sector was used for the boot0 code. > floppies allowed easy expansion to 9K, but were unportable for a small > gain. The default partition layout left only 8K below the ffs > superblock, but was only a default. > > Bruce > > From owner-svn-src-all@freebsd.org Tue Mar 28 06:39:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57DD4D227F3; Tue, 28 Mar 2017 06:39:56 +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 276526E4; Tue, 28 Mar 2017 06:39:56 +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 v2S6dta7019523; Tue, 28 Mar 2017 06:39:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S6dtx9019521; Tue, 28 Mar 2017 06:39:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280639.v2S6dtx9019521@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:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316076 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 06:39:56 -0000 Author: ngie Date: Tue Mar 28 06:39:54 2017 New Revision: 316076 URL: https://svnweb.freebsd.org/changeset/base/316076 Log: sys/boot/common: Make geli(4) support optional in MI sources This saves a negligible amount of memory for non-geli enabled bootloaders. MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/boot/common/Makefile.inc head/sys/boot/common/module.c Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Tue Mar 28 06:13:21 2017 (r316075) +++ head/sys/boot/common/Makefile.inc Tue Mar 28 06:39:54 2017 (r316076) @@ -37,6 +37,9 @@ CFLAGS+= -DLOADER_GPT_SUPPORT CFLAGS+= -DLOADER_MBR_SUPPORT .endif .endif +.if !defined(LOADER_NO_GELI_SUPPORT) +CFLAGS+= -DLOADER_GELI_SUPPORT +.endif .if defined(HAVE_BCACHE) SRCS+= bcache.c Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Tue Mar 28 06:13:21 2017 (r316075) +++ head/sys/boot/common/module.c Tue Mar 28 06:39:54 2017 (r316076) @@ -183,6 +183,7 @@ command_load(int argc, char *argv[]) return (error == 0 ? CMD_OK : CMD_CRIT); } +#ifdef LOADER_GELI_SUPPORT COMMAND_SET(load_geli, "load_geli", "load a geli key", command_load_geli); static int @@ -221,6 +222,7 @@ command_load_geli(int argc, char *argv[] sprintf(typestr, "%s:geli_keyfile%d", argv[1], num); return (file_loadraw(argv[2], typestr, 1) ? CMD_OK : CMD_ERROR); } +#endif void unload(void) From owner-svn-src-all@freebsd.org Tue Mar 28 07:01:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DADC5D2211A; Tue, 28 Mar 2017 07:01: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 A7BBD89C; Tue, 28 Mar 2017 07:01: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 v2S71ehC030080; Tue, 28 Mar 2017 07:01:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S71e0T030079; Tue, 28 Mar 2017 07:01:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280701.v2S71e0T030079@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 07:01:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316077 - head/sys/boot/i386/gptzfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 07:01:42 -0000 Author: ngie Date: Tue Mar 28 07:01:40 2017 New Revision: 316077 URL: https://svnweb.freebsd.org/changeset/base/316077 Log: Unbreak compilation with gcc 4.2.1 -Wtentative-definition-incomplete-type isn't implemented for 4.2.1 X-MFC with: r304321 Sponsored by: Dell EMC Isilon Modified: head/sys/boot/i386/gptzfsboot/Makefile Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Tue Mar 28 06:39:54 2017 (r316076) +++ head/sys/boot/i386/gptzfsboot/Makefile Tue Mar 28 07:01:40 2017 (r316077) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein @@ -34,7 +36,12 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline -Wno-tentative-definition-incomplete-type -Wno-pointer-sign + -Winline -Wno-pointer-sign + +.if ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201) +CFLAGS+= -Wno-tentative-definition-incomplete-type +.endif # Do not unroll skein loops, reduce code size CFLAGS+= -DSKEIN_LOOP=111 From owner-svn-src-all@freebsd.org Tue Mar 28 07:10:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64B6CD224E0; Tue, 28 Mar 2017 07:10: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 31409CCD; Tue, 28 Mar 2017 07:10: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 v2S7AZep032176; Tue, 28 Mar 2017 07:10:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S7AZjf032175; Tue, 28 Mar 2017 07:10:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280710.v2S7AZjf032175@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 07:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316078 - head/sys/boot/i386/gptboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 07:10:36 -0000 Author: ngie Date: Tue Mar 28 07:10:35 2017 New Revision: 316078 URL: https://svnweb.freebsd.org/changeset/base/316078 Log: gpt*boot: Save a bit more memory when LOADER_NO_GELI_SUPPORT is specified Don't compile geliargs into the image and don't pass geliargs to the respective bootloader code via __exec(..). This saves a negligible amount of memory/disk space. X-MFC with: r296963 Obtained from: Isilon OneFS Sponsored by: Dell EMC Isilon Modified: head/sys/boot/i386/gptboot/gptboot.c Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Tue Mar 28 07:01:40 2017 (r316077) +++ head/sys/boot/i386/gptboot/gptboot.c Tue Mar 28 07:10:35 2017 (r316078) @@ -84,7 +84,9 @@ static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; +#ifdef LOADER_GELI_SUPPORT static struct geli_boot_args geliargs; +#endif static vm_offset_t high_heap_base; static uint32_t bios_basemem, bios_extmem, high_heap_size; @@ -476,16 +478,18 @@ load(void) bootinfo.bi_esymtab = VTOP(p); bootinfo.bi_kernelname = VTOP(kname); bootinfo.bi_bios_dev = dsk.drive; - geliargs.size = sizeof(geliargs); #ifdef LOADER_GELI_SUPPORT + geliargs.size = sizeof(geliargs); bcopy(gelipw, geliargs.gelipw, sizeof(geliargs.gelipw)); bzero(gelipw, sizeof(gelipw)); -#else - geliargs.gelipw[0] = '\0'; #endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), - KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo), geliargs); + KARGS_FLAGS_EXTARG, 0, 0, VTOP(&bootinfo) +#ifdef LOADER_GELI_SUPPORT + , geliargs +#endif + ); } static int From owner-svn-src-all@freebsd.org Tue Mar 28 07:58:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE194D20AFA; Tue, 28 Mar 2017 07:58:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DB51E6C; Tue, 28 Mar 2017 07:58:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2S7wRNS053276; Tue, 28 Mar 2017 07:58:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S7wR78053275; Tue, 28 Mar 2017 07:58:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703280758.v2S7wR78053275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 28 Mar 2017 07:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316079 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 07:58:28 -0000 Author: imp Date: Tue Mar 28 07:58:27 2017 New Revision: 316079 URL: https://svnweb.freebsd.org/changeset/base/316079 Log: Simply retire the sedification of the boot2.s file. It's been obsolete for years. clang before 96 free after 100 (+4) gcc before 163 free after 156 (-7) Suggested by: bde@ Sponsored by: Netflix Modified: head/sys/boot/i386/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Tue Mar 28 07:10:35 2017 (r316078) +++ head/sys/boot/i386/boot2/Makefile Tue Mar 28 07:58:27 2017 (r316079) @@ -66,7 +66,7 @@ boot1.out: boot1.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} boot1.o CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ - boot2.s boot2.s.tmp boot2.h sio.o + boot2.h sio.o boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ @@ -86,24 +86,8 @@ boot2.bin: boot2.out boot2.out: ${BTXCRT} boot2.o sio.o ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} -boot2.o: boot2.s - ${CC} ${ACFLAGS} -c boot2.s - SRCS= boot2.c boot2.h -# Gcc (4.2.1 at least) benefits from removing the forced alignment -# clang doesn't. Make the removal as specific as possible to avoid -# false positives (like path names with odd names for debugging info). -# In the past, gcc benefited from nop removal, but not in 4.2.1. -# Think of this as a poor-man's peephole optimizer for gcc 4.2.1 -boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c - ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c -.if ${COMPILER_TYPE} == "gcc" - sed -e '/\.align 4/d' < boot2.s.tmp > boot2.s -.else - cp boot2.s.tmp boot2.s -.endif - boot2.h: boot1.out ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ { x = $$1 - ORG1; \ From owner-svn-src-all@freebsd.org Tue Mar 28 08:03:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D098D1B516 for ; Tue, 28 Mar 2017 08:03:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::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 F15A1838 for ; Tue, 28 Mar 2017 08:03:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id e75so47588122itd.1 for ; Tue, 28 Mar 2017 01:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qLaoogz3ViyPEwZvy0vyWWD/NoxLIkIZb9xyGOMUUeo=; b=hpRsdBwJ4WLkx9piXzH/W6MmbiTOjPP/Sh3WWFNf88oecKjIjhraH82zlxTiTiM8kf Qeub/yf8nfUIAdbAMHvQ2GhPquWoLtYerfwFrCNSoU+aUrc45QN/9Rlt3Rt3tTPO/PTg oG+45Absa7q9d9sskEOBPGiJhh46uc04nas3EhHxg30L3A/lyALtyO5zfS7/qamVdGtY YkYV+7mLWc5sq7ij4/kLWN3vqC/aSfsW6ArFDKdgf7ifpeet7DsqOsaIn4lEsaVxKrM0 T4HUCHou9DyJW76rgibU6b44LvXPXnwhIbc0bjyMAPRmccxW4Dbeudg9qN89GUorIGSg 5lBQ== 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=qLaoogz3ViyPEwZvy0vyWWD/NoxLIkIZb9xyGOMUUeo=; b=R45t+5zqYUZHP/q53nme2KVbcQrdWCNQiBFcwAc87u7rk4vjLo4vrGeR4TMxgR9Zct OpI+iSDdiHiSeTXop1/6pa8nsAzJF4K82M7dllSgCnp5CtgPsI6OskVyq4BN+z/P1MoP Vwf+q6ONxBPfEvghiiRCf2NzNmKXHzTZmzBS3yEMDzwbTkFD5lozVRO7cs7DZ+iQWKif CYX4SKefJVChIYyv3qJ6zU6nPy783I54LUtmCmXMzMHkIpEvxnWT8vYzD4wVHbiDU/J8 28noPeWyR7nk484/vEh5Hb91iOEFR3qLNy2kyKG5Ti6iW0bIdfiaHDadB0xGPAOahk1R VTEw== X-Gm-Message-State: AFeK/H3rE/+KGtt9yOBkIPF+8R6Sc7gWgx9nS21g2MRzfA8Y60fUg1YlkNMkoPP8bNCOOvjemLDOtETFhcGBiA== X-Received: by 10.107.198.193 with SMTP id w184mr25021627iof.19.1490688205054; Tue, 28 Mar 2017 01:03:25 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Tue, 28 Mar 2017 01:03:24 -0700 (PDT) X-Originating-IP: [2607:fb10:7021:1::504b] In-Reply-To: <20170328141213.T927@besplex.bde.org> References: <201703272253.v2RMra2L032487@repo.freebsd.org> <20170328141213.T927@besplex.bde.org> From: Warner Losh Date: Tue, 28 Mar 2017 02:03:24 -0600 X-Google-Sender-Auth: WFPgbvo_-2X8Yd8un2mIhLMAMG4 Message-ID: Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 To: Bruce Evans Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 08:03:26 -0000 [[ sorry for the top post but it's quick ]] Summary, in Bruce's own words > the whole optimization step was silly. I agree. on my -current system, clang compiled boot2 was 4 bytes smaller after ripping it out. gcc was a whopping 7 bytes larger. Since gcc has 156 still free, I think it's best to just retire this. Maybe you can give me a hint as to which structs to look at to get back those 7 bytes :) Thanks for the writeup. It was most enlightening. Warner On Mon, Mar 27, 2017 at 11:53 PM, Bruce Evans wrote: > On Mon, 27 Mar 2017, Warner Losh wrote: > >> Log: >> Fix build with path names with 'align' or 'nop' in them. >> >> clang is now inserting .file directives with the entire path in >> them. This is fine, except that our sed peephole optimizer removes >> them if ${SRCTOP} or ${OBJTOP} contains 'align' or 'nop', leading to >> build failures. The sed peephole optimizer removes useful things for >> boot2 when used with clang, so restrict its use to gcc. Also, gcc no >> longer generates nops to pad things, so there's no point in removing >> it. Specialize the optimization to just removing the .align 4 lines to >> preclude inadvertant path matching. >> >> Sponsored by: Netflix >> Commit brought to you the path: /home/xxx/NCD-3592-logsynopts/FreeBSD >> >> Modified: >> head/sys/boot/i386/boot2/Makefile >> >> Modified: head/sys/boot/i386/boot2/Makefile >> >> ============================================================================== >> --- head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:34:43 2017 >> (r316063) >> +++ head/sys/boot/i386/boot2/Makefile Mon Mar 27 22:53:36 2017 >> (r316064) >> @@ -91,10 +91,18 @@ boot2.o: boot2.s >> >> SRCS= boot2.c boot2.h >> >> +# Gcc (4.2.1 at least) benefits from removing the forced alignment >> +# clang doesn't. Make the removal as specific as possible to avoid >> +# false positives (like path names with odd names for debugging info). >> +# In the past, gcc benefited from nop removal, but not in 4.2.1. >> +# Think of this as a poor-man's peephole optimizer for gcc 4.2.1 >> boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c >> ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c >> - sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s >> - rm -f boot2.s.tmp >> +.if ${COMPILER_TYPE} == "gcc" >> + sed -e '/\.align 4/d' < boot2.s.tmp > boot2.s >> +.else >> + cp boot2.s.tmp boot2.s >> +.endif >> >> boot2.h: boot1.out >> ${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \ > > > That's silly; if you just fix the regexps to actually be as specifice as > possible, then they would just work with no need for large comments or > ifdefs. '\.align' instead of 'align' is a good start. ' 4' instead of > nothing is not so good. There should also be a check for nothing > except whitespace before '\.align'. The whitespace before '4' might > be a tab, but perhaps gcc only generates a space, and only generates > unwanted alignments of precisely 4, with no fill bytes. The general > syntax would be too hard to parse, but it is easy to handle any digit, > and also '\.p2align', and allow nothing except whitespace after the > digit. > > Last time I looked at this about 5 years ago, but after clang, the > whole optimization step was silly. It made little difference for gcc > and no difference for clang as you say. The nop removal that you > removed was silliest. I think compilers stopped generating nops for > padding many years before that code was written. In text sections, > They should generate something like '.p2align x,y,z', where x is the > alignment, y is empty (it is the fill byte, which defaults to nop, but > we don't want that but want a larger null instruction for multiple > bytes) and z is a limit on the amount of padding (x is only a > preference and z limits it). This syntax would be hard to parse. > But CFLAGS has -Os, and that works for preventing padding in the > text section, so nop is never generated, not even with the spelling > 'align'. > > -Os doesn't work so well for other things. For kernels, it is completely > broken with gcc-4.2.1 unless -fno-inline-functions is also used (it > breaks the inlining parameters whose misconfiguration is probably the > actual bug. This doesn't seem to be a problem for boot code. IIRC, > the only simply broken thing is that alignment is still done for variables. > This generates ".align 4". > > -Os is differently broken for clang, so the simple editing doesn't help. > -Wa,-al to see what the assembler is doing is broken for clang. > -mpreferred-stack-boundary doesn't work for clang, so is not used, but > clang does better stack alignment by default. This might still waste > some instructions, but not for every function. -mno-align-long-strings > doesn't work for clang or for gcc > 4.2.1, so is not used. clang does > quite different string padding by default, and IIRC it is worse. But > boot2 hardly has any long strings. > > boot code is hard to test since it is not modular. This is much more broken > than when I last tested the size of boot2.o. The most obvious new bugs are: > - something like SRCTOP breaks finding the relative path to ufs headers in > a FreeBSD-11 sys tree > - ${CLANG_OPT_SMALL} is added for all compilers. This is defined > out-of-tree > in /usr/share/mk/bsd.sys.mk. (I tested on a host running nearly -current > with a nearly FreeBSD-10 sys tree). In boot2, CLANG_P{T_SMALL is > wrong even for clang since it contains -mstack-alignment=8 > unconditionally, but the stack alignment should be 4 or even 1 with > -m32 -Os. Fixing this makes no difference for boot2.o compiled by > clang. The corresponding -mpreferred-stack-boundary=2 for gcc is > configured correctly in boot2/Makefile. > > After fixing this, simply "CC=gcc-4.2.1 make boot2.o". Adding -Wa,-al > to CC also works (-Wa,-al is broken for clang, and clang produces a boot2.s > which cannot be assembled by gas). > > The file sizes for FreeBSD-10 are: > > text data bss dec hex filename > 5126 12 4940 10078 0x275e clang/boot2-unhacked.o > 5126 9 4940 10075 0x275b clang/boot2.o > 5036 32 4928 9996 0x270c gcc/boot-unhacked.o > 5032 29 4928 9989 0x2705 gcc/boot2.o > > In other words, the editing saves a whole 4 bytes of text and 3 bytes of > data for gcc. It also saves a whole 3 bytes of data for clang, and you > just broke this :-). (I would be surprised if the data isn't padded back > to a multiple of 4 anyway.) > > After the reductions, the result with gcc is 86 bytes smaller than with > clang, instead of only 82 bytes smaller. > > It is silly doing such small optimizations specially. > > The editing actually removes 22 alignment statements, all spelled > "^\.align4$'. All of these are for data. -Wa,-al shows > that the padding is 2 instances of 2 bytes and 1 of 3 bytes. At > least half of the padding is for pessimal layout which is also a > style bug in the source code. Arrays of characters are mixed with > 32-bit variables. Style(9) says to sort on size (it means on alignment/ > element size), to minimize padding (mainly for structs) and get a conistent > order as a side effect. The padding usually doesn't matter except for > structs. > > After fixing the source code, there would be just 1 odd byte in a > character array that normally causes 3 bytes of padding after it. It > takes considerably more magic to avoid getting this padding anyway in > the link step, In the old a.out boot blocks, the linker forces 16-byte > alignment at the end of every object file. The old boot blocks put > most of the data in a single object file to avoid an aerage of 8 bytes > of padding between files. Elf is more flexible, and usually gives > 4-byte alignment. I think it is possible to match an odd byte at the > end of 1 object file with an odd 3 bytes at the beginning of the next > object file, but this usually doesn't happen. The new boot2 uses > hacks like including ufsread.c to avoid having lots of object files. > > I use the old a.out boot blocks updated to elf and EDD and have squeezed > them more extensively. The squeezing is also silly since I could very > easily switch to 64K ones (much larger than that is not easy, since > they have to fit below 640K and a few multiples of 64K are already > used for buffers). The limit on 8K is mainly a historical mistake. > A limit of 7.5K simplified booting from 15-sector floppies. 18-sector > floppies allowed easy expansion to 9K, but were unportable for a small > gain. The default partition layout left only 8K below the ffs > superblock, but was only a default. > > Bruce From owner-svn-src-all@freebsd.org Tue Mar 28 08:19:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F54D1BD86; Tue, 28 Mar 2017 08:19: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 EDE9F274; Tue, 28 Mar 2017 08:19: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 v2S8Jqfw062098; Tue, 28 Mar 2017 08:19:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S8JqXF062097; Tue, 28 Mar 2017 08:19:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280819.v2S8JqXF062097@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 08:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316080 - head/lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 08:19:53 -0000 Author: ngie Date: Tue Mar 28 08:19:51 2017 New Revision: 316080 URL: https://svnweb.freebsd.org/changeset/base/316080 Log: Fix some localized style(9) issues and reword CAM_ERRBUF_SIZE description The CAM_ERRBUF_SIZE description rewording fixes a typo by proxy. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libcam/camlib.h Modified: head/lib/libcam/camlib.h ============================================================================== --- head/lib/libcam/camlib.h Tue Mar 28 07:58:27 2017 (r316079) +++ head/lib/libcam/camlib.h Tue Mar 28 08:19:51 2017 (r316080) @@ -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-all@freebsd.org Tue Mar 28 08:24:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF1D2D21078; Tue, 28 Mar 2017 08:24: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 AFB90A8D; Tue, 28 Mar 2017 08:24: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 v2S8OG8A066056; Tue, 28 Mar 2017 08:24:16 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S8OGTb066055; Tue, 28 Mar 2017 08:24:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703280824.v2S8OGTb066055@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 08:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316081 - head/lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 08:24:18 -0000 Author: ngie Date: Tue Mar 28 08:24:16 2017 New Revision: 316081 URL: https://svnweb.freebsd.org/changeset/base/316081 Log: 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. MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/lib/libcam/camlib.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Tue Mar 28 08:19:51 2017 (r316080) +++ head/lib/libcam/camlib.c Tue Mar 28 08:24:16 2017 (r316081) @@ -120,10 +120,9 @@ cam_get_device(const char *path, char *d 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_name); return(-1); } @@ -145,8 +144,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_name); free(newpath); return(-1); } @@ -173,9 +172,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_name); free(newpath); return(-1); } @@ -185,9 +184,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_name); free(newpath); return(-1); } @@ -198,8 +197,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_name); free(newpath); return(-1); } @@ -275,9 +274,9 @@ cam_open_btl(path_id_t path_id, target_i 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_name, XPT_DEVICE, + func_name, strerror(errno)); return(NULL); } @@ -292,8 +291,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_name); close(fd); return(NULL); } @@ -305,8 +304,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_name); free(ccb.cdm.matches); ccb.cdm.matches = NULL; close(fd); @@ -328,9 +327,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_name, func_name, strerror(errno)); goto btl_bailout; } @@ -340,26 +339,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_name, + 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_name, 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_name, path_id, target_id, + (uintmax_t)target_lun); goto btl_bailout; } @@ -382,9 +381,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_name); goto btl_bailout; break; /* NOTREACHED */ } @@ -426,9 +425,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_name, XPT_DEVICE, + func_name, strerror(errno)); return(NULL); } @@ -459,10 +458,10 @@ cam_lookup_pass(const char *dev_name, in "your kernel\n%s: or %s%d doesn't exist", func_name, func_name, 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_name, func_name, strerror(errno), + (errno == ENOENT) ? tmpstr : ""); close(fd); return(NULL); @@ -477,9 +476,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_name, dev_name, unit); return(NULL); } @@ -509,10 +508,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_name, func_name, + strerror(errno)); return(NULL); } device->fd = -1; @@ -540,10 +539,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_name, path, func_name, + strerror(errno)); goto crod_bailout; } @@ -568,9 +567,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_name, func_name, strerror(errno)); goto crod_bailout; } @@ -581,8 +580,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_name); goto crod_bailout; } @@ -595,9 +594,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_name, func_name, strerror(errno)); goto crod_bailout; } strlcpy(device->sim_name, ccb.cpi.dev_name, sizeof(device->sim_name)); @@ -610,9 +609,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_name, func_name, strerror(errno)); goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); @@ -634,9 +633,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_name, func_name, strerror(errno)); goto crod_bailout; } if (ccb.cts.transport == XPORT_SPI) { @@ -717,16 +716,16 @@ cam_device_dup(struct cam_device *device 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_name); + 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_name); + return (NULL); } bcopy(device, newdev, sizeof(struct cam_device)); @@ -743,14 +742,14 @@ cam_device_copy(struct cam_device *src, 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_name); 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_name); return; } From owner-svn-src-all@freebsd.org Tue Mar 28 08:54:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2592D22074; Tue, 28 Mar 2017 08:54:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9D63CB; Tue, 28 Mar 2017 08:54:07 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id D69C342668F; Tue, 28 Mar 2017 19:53:58 +1100 (AEDT) Date: Tue, 28 Mar 2017 19:53:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Julian Elischer cc: Bruce Evans , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-Reply-To: Message-ID: <20170328192226.F1710@besplex.bde.org> References: <201703272253.v2RMra2L032487@repo.freebsd.org> <20170328141213.T927@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=1pLQmm0RdxnPiy69pbYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 08:54:07 -0000 On Mon, 27 Mar 2017, Julian Elischer wrote: > On Tue, 28 Mar 2017, Bruce Evans wrote: > > [...] > >> they have to fit below 640K and a few multiples of 64K are already >> used for buffers). The limit on 8K is mainly a historical mistake. >> A limit of 7.5K simplified booting from 15-sector floppies. 18-sector > > My memory says that the limit of 7.5K is becuase there was only 8k left free > at the front of UFS1 and one sector was used for the boot0 code. That is only a limit if the boot code is in the ffs partition. This causes other problems. It was the default to start the 'a' partition at offset 0, but that was changed 10-15 years ago. I can't find exactly where it is changed. I use an offset of 8192 sectors or 4M on new and repartitioned hard disks. This is again affected by the existence of floppy disks. Floppy disks are usually not partitioned, and don't have space to spare for large boot blocks. Some version of the boot code has to work on small media, and FreeBSD uses the same boot code for all media. This allowed FreeBSD-1 to have a single boot.flp where IIRC Linux had about 100 variations. Small media is not as small as it used to be. Bruce From owner-svn-src-all@freebsd.org Tue Mar 28 09:02:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 306AFD22745; Tue, 28 Mar 2017 09:02:44 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F19A6FEB; Tue, 28 Mar 2017 09:02:43 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2S92hJ0083192; Tue, 28 Mar 2017 09:02:43 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S92hRv083191; Tue, 28 Mar 2017 09:02:43 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201703280902.v2S92hRv083191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 28 Mar 2017 09:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316082 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 09:02:44 -0000 Author: maxim Date: Tue Mar 28 09:02:42 2017 New Revision: 316082 URL: https://svnweb.freebsd.org/changeset/base/316082 Log: DragonFly BSD 4.8.0 release added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Mar 28 08:24:16 2017 (r316081) +++ head/share/misc/bsd-family-tree Tue Mar 28 09:02:42 2017 (r316082) @@ -351,6 +351,7 @@ FreeBSD 5.2 | | *--FreeBSD macOS | OpenBSD 6.0 | | 11.0 10.12 | | | | | NetBSD 7.1 | | + | | | | DragonFly 4.8.0 | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -708,6 +709,7 @@ OpenBSD 6.0 2016-09-01 [OBD] macOS 10.12 2016-09-20 [APL] FreeBSD 11.0 2016-10-10 [FBD] NetBSD 7.1 2017-03-11 [NBD] +DragonFly 4.8.0 2017-03-27 [DFB] Bibliography ------------------------ From owner-svn-src-all@freebsd.org Tue Mar 28 09:58:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 549A2D1DF27; Tue, 28 Mar 2017 09:58:56 +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 E1142D39; Tue, 28 Mar 2017 09:58:55 +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 v2S9wtmR005348; Tue, 28 Mar 2017 09:58:55 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2S9wsWA005343; Tue, 28 Mar 2017 09:58:54 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201703280958.v2S9wsWA005343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 28 Mar 2017 09:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316083 - vendor/libarchive/dist/libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 09:58:56 -0000 Author: mm Date: Tue Mar 28 09:58:54 2017 New Revision: 316083 URL: https://svnweb.freebsd.org/changeset/base/316083 Log: Update vendor/libarchive to git 13b0ed2ba504389c363cd302041fe10afa1837ad Vendor changes (FreeBSD-related): - 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: vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c - copied, changed from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_darwin.c vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c - copied, changed from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_freebsd.c vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c - copied, changed from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_linux.c vendor/libarchive/dist/libarchive/archive_disk_acl_sunos.c - copied, changed from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_sunos.c Deleted: vendor/libarchive/dist/libarchive/archive_acl_maps.h vendor/libarchive/dist/libarchive/archive_acl_maps_darwin.c vendor/libarchive/dist/libarchive/archive_acl_maps_freebsd.c vendor/libarchive/dist/libarchive/archive_acl_maps_linux.c vendor/libarchive/dist/libarchive/archive_acl_maps_sunos.c vendor/libarchive/dist/libarchive/archive_read_disk_acl_darwin.c vendor/libarchive/dist/libarchive/archive_read_disk_acl_freebsd.c vendor/libarchive/dist/libarchive/archive_read_disk_acl_linux.c vendor/libarchive/dist/libarchive/archive_read_disk_acl_sunos.c vendor/libarchive/dist/libarchive/archive_write_disk_acl_darwin.c vendor/libarchive/dist/libarchive/archive_write_disk_acl_freebsd.c vendor/libarchive/dist/libarchive/archive_write_disk_acl_linux.c vendor/libarchive/dist/libarchive/archive_write_disk_acl_sunos.c Modified: vendor/libarchive/dist/libarchive/CMakeLists.txt vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_getdate.c vendor/libarchive/dist/libarchive/archive_pack_dev.c vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_zip.c vendor/libarchive/dist/libarchive/archive_string_sprintf.c vendor/libarchive/dist/libarchive/archive_util.c vendor/libarchive/dist/libarchive/archive_write_add_filter.c vendor/libarchive/dist/libarchive/archive_write_add_filter_by_name.c vendor/libarchive/dist/libarchive/archive_write_add_filter_lz4.c vendor/libarchive/dist/libarchive/archive_write_add_filter_program.c vendor/libarchive/dist/libarchive/archive_write_set_format.c vendor/libarchive/dist/libarchive/archive_write_set_format_by_name.c vendor/libarchive/dist/libarchive/archive_write_set_format_filter_by_ext.c vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c Modified: vendor/libarchive/dist/libarchive/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/CMakeLists.txt Tue Mar 28 09:02:42 2017 (r316082) +++ vendor/libarchive/dist/libarchive/CMakeLists.txt Tue Mar 28 09:58:54 2017 (r316083) @@ -214,25 +214,13 @@ IF(WIN32 AND NOT CYGWIN) ENDIF(WIN32 AND NOT CYGWIN) IF(ARCHIVE_ACL_DARWIN) - LIST(APPEND libarchive_SOURCES archive_acl_maps.h) - LIST(APPEND libarchive_SOURCES archive_acl_maps_darwin.c) - LIST(APPEND libarchive_SOURCES archive_read_disk_acl_darwin.c) - LIST(APPEND libarchive_SOURCES archive_write_disk_acl_darwin.c) + LIST(APPEND libarchive_SOURCES archive_disk_acl_darwin.c) ELSEIF(ARCHIVE_ACL_FREEBSD) - LIST(APPEND libarchive_SOURCES archive_acl_maps.h) - LIST(APPEND libarchive_SOURCES archive_acl_maps_freebsd.c) - LIST(APPEND libarchive_SOURCES archive_read_disk_acl_freebsd.c) - LIST(APPEND libarchive_SOURCES archive_write_disk_acl_freebsd.c) + LIST(APPEND libarchive_SOURCES archive_disk_acl_freebsd.c) ELSEIF(ARCHIVE_ACL_LIBACL) - LIST(APPEND libarchive_SOURCES archive_acl_maps.h) - LIST(APPEND libarchive_SOURCES archive_acl_maps_linux.c) - LIST(APPEND libarchive_SOURCES archive_read_disk_acl_linux.c) - LIST(APPEND libarchive_SOURCES archive_write_disk_acl_linux.c) + LIST(APPEND libarchive_SOURCES archive_disk_acl_linux.c) ELSEIF(ARCHIVE_ACL_SUNOS) - LIST(APPEND libarchive_SOURCES archive_acl_maps.h) - LIST(APPEND libarchive_SOURCES archive_acl_maps_sunos.c) - LIST(APPEND libarchive_SOURCES archive_read_disk_acl_sunos.c) - LIST(APPEND libarchive_SOURCES archive_write_disk_acl_sunos.c) + LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c) ENDIF() # Libarchive is a shared library Copied and modified: vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c (from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_darwin.c) ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_acl_darwin.c Tue Mar 28 09:02:42 2017 (r316082, copy source) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c Tue Mar 28 09:58:54 2017 (r316083) @@ -45,15 +45,49 @@ #include "archive_entry.h" #include "archive_private.h" #include "archive_read_disk_private.h" -#include "archive_acl_maps.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_nfs4_perm_map[] = { + {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_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {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_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER}, +#if HAVE_DECL_ACL_SYNCHRONIZE + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +#endif +}; + +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_INHERITED, ACL_ENTRY_INHERITED}, + {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_LIMIT_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT} +}; + +static const int acl_nfs4_flag_map_size = + (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0])); -/* - * Darwin-specific ACL functions and helper functions - * - * Exported functions: - * none - */ static int translate_guid(struct archive *a, acl_entry_t acl_entry, int *ae_id, int *ae_tag, const char **ae_name) { @@ -84,9 +118,6 @@ static int translate_guid(struct archive return (r); } -/* - * Add trivial NFSv4 ACL entries from mode - */ static void add_trivial_nfs4_acl(struct archive_entry *entry) { @@ -284,6 +315,178 @@ translate_acl(struct archive_read_disk * 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) +{ + acl_t acl; + acl_entry_t acl_entry; + acl_permset_t acl_permset; + acl_flagset_t acl_flagset; + int ret; + int ae_type, ae_permset, ae_tag, ae_id; + uuid_t ae_uuid; + 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); + + if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + 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) { + /* + * Mac OS doesn't support NFSv4 ACLs for + * owner@, group@ and everyone@. + * We skip any of these ACLs found. + */ + if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ || + ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ || + ae_tag == ARCHIVE_ENTRY_ACL_EVERYONE) + continue; + + 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_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + acl_set_tag_type(acl_entry, ACL_EXTENDED_ALLOW); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + acl_set_tag_type(acl_entry, ACL_EXTENDED_DENY); + break; + default: + /* We don't support any other types on MacOS */ + continue; + } + + switch (ae_tag) { + case ARCHIVE_ENTRY_ACL_USER: + ae_uid = archive_write_disk_uid(a, ae_name, ae_id); + if (mbr_uid_to_uuid(ae_uid, ae_uuid) != 0) + continue; + if (acl_set_qualifier(acl_entry, &ae_uuid) != 0) + continue; + break; + case ARCHIVE_ENTRY_ACL_GROUP: + ae_gid = archive_write_disk_gid(a, ae_name, ae_id); + if (mbr_gid_to_uuid(ae_gid, ae_uuid) != 0) + continue; + if (acl_set_qualifier(acl_entry, &ae_uuid) != 0) + continue; + break; + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + + 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; + } + + for (i = 0; i < acl_nfs4_perm_map_size; ++i) { + if (ae_permset & acl_nfs4_perm_map[i].a_perm) { + if (acl_add_perm(acl_permset, + acl_nfs4_perm_map[i].p_perm) != 0) { + archive_set_error(a, errno, + "Failed to add ACL permission"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + } + } + + /* + * 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; + } + } + } + } + + if (fd >= 0) { + if (acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == 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; + } + } + } else if (acl_set_link_np(name, ACL_TYPE_EXTENDED, acl) != 0) { + 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) @@ -335,3 +538,19 @@ archive_read_disk_entry_setup_acls(struc } 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_NFS4) != 0) { + ret = set_acl(a, fd, name, abstract_acl, + ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4"); + } + return (ret); +} Copied and modified: vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c (from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_freebsd.c) ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_acl_freebsd.c Tue Mar 28 09:02:42 2017 (r316082, copy source) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c Tue Mar 28 09:58:54 2017 (r316083) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2009 Tim Kientzle * Copyright (c) 2010-2012 Michihiro NAKAJIMA - * Copyright (c) 2016-2017 Martin Matuska + * Copyright (c) 2017 Martin Matuska * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,11 +44,60 @@ #include "archive_entry.h" #include "archive_private.h" #include "archive_read_disk_private.h" -#include "archive_acl_maps.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 */ -/* - * Translate FreeBSD ACLs into libarchive internal structure - */ static int translate_acl(struct archive_read_disk *a, struct archive_entry *entry, acl_t acl, int default_entry_acl_type) @@ -56,11 +105,11 @@ translate_acl(struct archive_read_disk * #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; - acl_entry_type_t acl_type; int i, entry_acl_type, perm_map_size; const acl_perm_map_t *perm_map; int r, s, ae_id, ae_tag, ae_perm; @@ -264,6 +313,248 @@ translate_acl(struct archive_read_disk * 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) @@ -369,3 +660,38 @@ archive_read_disk_entry_setup_acls(struc } 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); +} Copied and modified: vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c (from r316082, vendor/libarchive/dist/libarchive/archive_read_disk_acl_linux.c) ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_acl_linux.c Tue Mar 28 09:02:42 2017 (r316082, copy source) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c Tue Mar 28 09:58:54 2017 (r316083) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2009 Tim Kientzle * Copyright (c) 2010-2012 Michihiro NAKAJIMA - * Copyright (c) 2016-2017 Martin Matuska + * Copyright (c) 2017 Martin Matuska * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,18 +39,66 @@ #ifdef HAVE_SYS_ACL_H #include #endif -#if HAVE_SYS_RICHACL_H +#ifdef HAVE_SYS_RICHACL_H #include #endif #include "archive_entry.h" #include "archive_private.h" #include "archive_read_disk_private.h" -#include "archive_acl_maps.h" +#include "archive_write_disk_private.h" -#if HAVE_LIBACL -#include -#endif +typedef struct { + const int a_perm; /* Libarchive permission or flag */ + const int p_perm; /* Platform permission or flag */ +} acl_perm_map_t; + +#if ARCHIVE_ACL_LIBACL +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])); +#endif /* ARCHIVE_ACL_LIBACL */ + +#if ARCHIVE_ACL_LIBRICHACL +static const acl_perm_map_t acl_nfs4_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, RICHACE_EXECUTE}, + {ARCHIVE_ENTRY_ACL_READ_DATA, RICHACE_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, RICHACE_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, RICHACE_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, RICHACE_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, RICHACE_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, RICHACE_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, RICHACE_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, RICHACE_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, RICHACE_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, RICHACE_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, RICHACE_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, RICHACE_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, RICHACE_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, RICHACE_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, RICHACE_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, RICHACE_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, RICHACE_FILE_INHERIT_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, RICHACE_DIRECTORY_INHERIT_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, RICHACE_NO_PROPAGATE_INHERIT_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, RICHACE_INHERIT_ONLY_ACE}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, RICHACE_INHERITED_ACE} +}; + +static const int acl_nfs4_flag_map_size = + (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0])); +#endif /* ARCHIVE_ACL_LIBRICHACL */ #if ARCHIVE_ACL_LIBACL /* @@ -240,6 +288,307 @@ translate_richacl(struct archive_read_di } #endif /* ARCHIVE_ACL_LIBRICHACL */ +#if ARCHIVE_ACL_LIBRICHACL +static int +_richacl_mode_to_mask(short mode) +{ + int mask = 0; + + if (mode & S_IROTH) + mask |= RICHACE_POSIX_MODE_READ; + if (mode & S_IWOTH) + mask |= RICHACE_POSIX_MODE_WRITE; + if (mode & S_IXOTH) + mask |= RICHACE_POSIX_MODE_EXEC; + + return (mask); +} + +static void +_richacl_mode_to_masks(struct richacl *richacl, __LA_MODE_T mode) +{ + richacl->a_owner_mask = _richacl_mode_to_mask((mode & 0700) >> 6); + richacl->a_group_mask = _richacl_mode_to_mask((mode & 0070) >> 3); + richacl->a_other_mask = _richacl_mode_to_mask(mode & 0007); +} +#endif /* ARCHIVE_ACL_LIBRICHACL */ + +#if ARCHIVE_ACL_LIBRICHACL +static int +set_richacl(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl, __LA_MODE_T mode, + int ae_requested_type, const char *tname) +{ + int ae_type, ae_permset, ae_tag, ae_id; + uid_t ae_uid; + gid_t ae_gid; + const char *ae_name; + int entries; + int i; + int ret; + int e = 0; + struct richacl *richacl = NULL; + struct richace *richace; + + ret = ARCHIVE_OK; + entries = archive_acl_reset(abstract_acl, ae_requested_type); + if (entries == 0) + return (ARCHIVE_OK); + + if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + errno = ENOENT; + archive_set_error(a, errno, "Unsupported ACL type"); + return (ARCHIVE_FAILED); + } + + richacl = richacl_alloc(entries); + if (richacl == NULL) { + archive_set_error(a, errno, + "Failed to initialize RichACL working storage"); + return (ARCHIVE_FAILED); + } + + e = 0; + + while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, + &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { + richace = &(richacl->a_entries[e]); + + richace->e_flags = 0; + richace->e_mask = 0; + + switch (ae_tag) { + case ARCHIVE_ENTRY_ACL_USER: + ae_uid = archive_write_disk_uid(a, ae_name, ae_id); + richace->e_id = ae_uid; + break; + case ARCHIVE_ENTRY_ACL_GROUP: + ae_gid = archive_write_disk_gid(a, ae_name, ae_id); + richace->e_id = ae_gid; + richace->e_flags |= RICHACE_IDENTIFIER_GROUP; + break; + case ARCHIVE_ENTRY_ACL_USER_OBJ: + richace->e_flags |= RICHACE_SPECIAL_WHO; + richace->e_id = RICHACE_OWNER_SPECIAL_ID; + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + richace->e_flags |= RICHACE_SPECIAL_WHO; + richace->e_id = RICHACE_GROUP_SPECIAL_ID; + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + richace->e_flags |= RICHACE_SPECIAL_WHO; + richace->e_id = RICHACE_EVERYONE_SPECIAL_ID; + break; + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL tag"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + + switch (ae_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + richace->e_type = + RICHACE_ACCESS_ALLOWED_ACE_TYPE; + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + richace->e_type = + RICHACE_ACCESS_DENIED_ACE_TYPE; + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + break; + default: + archive_set_error(a, ARCHIVE_ERRNO_MISC, + "Unsupported ACL entry type"); + ret = ARCHIVE_FAILED; + goto exit_free; + } + + for (i = 0; i < acl_nfs4_perm_map_size; ++i) { + if (ae_permset & acl_nfs4_perm_map[i].a_perm) + richace->e_mask |= acl_nfs4_perm_map[i].p_perm; + } + + for (i = 0; i < acl_nfs4_flag_map_size; ++i) { + if (ae_permset & + acl_nfs4_flag_map[i].a_perm) + richace->e_flags |= acl_nfs4_flag_map[i].p_perm; + } + e++; + } + + /* Fill RichACL masks */ + _richacl_mode_to_masks(richacl, mode); + + if (fd >= 0) { + if (richacl_set_fd(fd, richacl) == 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 richacl on fd: %s", tname); + ret = ARCHIVE_WARN; + } + } + } else if (richacl_set_file(name, richacl) != 0) { + if (errno == EOPNOTSUPP) { + /* Filesystem doesn't support ACLs */ + ret = ARCHIVE_OK; + } else { + archive_set_error(a, errno, "Failed to set richacl: %s", + tname); + ret = ARCHIVE_WARN; + } + } +exit_free: + richacl_free(richacl); + return (ret); +} +#endif /* ARCHIVE_ACL_RICHACL */ + +#if ARCHIVE_ACL_LIBACL +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; + int ae_type, ae_permset, ae_tag, ae_id; + uid_t ae_uid; + gid_t ae_gid; + const char *ae_name; + int entries; + int i; + int ret; + acl_t acl = NULL; + acl_entry_t acl_entry; + acl_permset_t acl_permset; + + 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; + 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: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Mar 28 10:11:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:15:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:19:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:20:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA22D1F9B7; Tue, 28 Mar 2017 10:20:04 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF06B8B; Tue, 28 Mar 2017 10:20:03 +0000 (UTC) (envelope-from melounmichal@gmail.com) Received: by mail-wr0-x22a.google.com with SMTP id u1so97260544wra.2; Tue, 28 Mar 2017 03:20:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:reply-to:subject:references:to:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=wiGmeVIP+T0Z1ctPYHoERxFS1ObJrRJfY1degxHTyTs=; b=VPwdfqK7zsmwTXTERUxZvOWcncACIUNUOc9SlQD5U4DUQCqL6SsjSaYQKDhkRH0K2T Kk5gzW70p2r499BwVI9RxZml1sTuBBvToH570EVAcptPZecfgQZoH2BU89iT+c/m5iCF 5WlauktQqHaY3xUWm77J/Tv0xMJj5Ir0j7lsh1hUqL/cwnSAM1xzWwIj1ygInD7r96m/ aoDbaXnLTu8Mq/JSmRaZadYKfPnmRxne4K02YqONI12mIOMFeK/Xd5Ujdof1nOwXISjK tTzr0xnEJ/8YhT6BSp9OMQlf39gxI9l5OwH8XMwVwI/U81jDM/0Ig3LJBaPbEkJ/Z5yi jaRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:reply-to:subject:references:to:cc :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=wiGmeVIP+T0Z1ctPYHoERxFS1ObJrRJfY1degxHTyTs=; b=MkUubwYEVG6zr2Pox60ZvHrrpuiMpIXC21ikXJlWtsv8PO025eeGLA/v51ZdFmRY+Q blHlBxygWv2bmfrgfdqDDvqW24CbCtlL5VYUO1T1Tt4dKuJNjFnCbgmA+X0nfJlmeS2U 2SC2UMUncvFsa7e4tziS2McQU/piPL/5nuIOqffQJz6XuHyNcdmbjoE3PigxSSWoxzKv dukqvD9rLytIHX6Eu07lPZ6qXbkfCtWCItujSt6cH5j5vxjybc08STeeiPyNOxHCBCUO oiW69Bm0cMHtIuqizUaTDZG8Imt9Awtn9Hx4vt2zjpxeHYogBB+NJ97QuzyJxg8uvjJB 3A0A== X-Gm-Message-State: AFeK/H0vAKyy3jkDqGnRnadJlQSC46+MbppBxZEVfnqyDTyuNryN9KSjJp1Zs66PqOZNTQ== X-Received: by 10.223.180.86 with SMTP id v22mr25119302wrd.169.1490696402140; Tue, 28 Mar 2017 03:20:02 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id v108sm4235779wrc.41.2017.03.28.03.20.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 03:20:01 -0700 (PDT) From: Michal Meloun X-Google-Original-From: Michal Meloun Reply-To: mmel@freebsd.org Subject: Re: svn commit: r315974 - in head: lib/libthread_db/arch/arm sys/arm/arm sys/arm/include References: <201703260836.v2Q8auoU069005@repo.freebsd.org> <1579704.6DjZ3RBGJe@ralph.baldwin.cx> To: Warner Losh , John Baldwin Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <74bb4fb0-b5d5-4be4-bcfe-4be343c2aee7@freebsd.org> Date: Tue, 28 Mar 2017 12:20:04 +0200 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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:20:04 -0000 On 27.03.2017 19:40, Warner Losh wrote: > On Mon, Mar 27, 2017 at 11:07 AM, John Baldwin wrote: >> On Sunday, March 26, 2017 08:36:56 AM Michal Meloun wrote: >>> Author: mmel >>> Date: Sun Mar 26 08:36:56 2017 >>> New Revision: 315974 >>> URL: https://svnweb.freebsd.org/changeset/base/315974 >>> >>> Log: >>> Preserve VFP state across signal delivery. >>> >>> We don't have enouch space to store full VFP context within mcontext >>> stucture. Due to this: >>> - follow i386/amd64 way and store VFP state outside of the mcontext_t >>> but point to it. Use the size of VFP state structure as an 'magic' >>> indicator of the saved VFP state presence. >>> - teach set_mcontext() about this external storage. >>> - for signal delivery, store VFP state to expanded 'struct sigframe'. >>> >>> Submited by: Andrew Gierth (initial version) >>> PR: 217611 >>> MFC after: 2 weeks >>> >>> Modified: >>> head/lib/libthread_db/arch/arm/libpthread_md.c >>> head/sys/arm/arm/machdep.c >>> head/sys/arm/include/frame.h >>> head/sys/arm/include/ucontext.h >>> >>> Modified: head/lib/libthread_db/arch/arm/libpthread_md.c >>> ============================================================================== >>> --- head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:20 2017 (r315973) >>> +++ head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:56 2017 (r315974) >>> @@ -90,7 +90,9 @@ pt_fpreg_to_ucontext(const struct fpreg >>> mcontext_t *mc = &uc->uc_mcontext; >>> >>> /* XXX */ >>> - memset(&mc->mc_spare, 0, sizeof(mc->mc_spare)); >>> + mc->mc_vfp_size = 0; >>> + mc->mc_vfp_ptr = NULL; >>> + memset(mc->mc_spare, 0, sizeof(mc->mc_spare)); >>> } >> I suspect you don't need this bit? Has FreeBSD/arm ever supported VFP on a release >> that also shipped libkse? (i.e. not libthr but the other thread library) > No. And even if we had, we blew up binary compat when we went from OABI to EABI. > > Warner I just wanted to maintain the status quo, nothing more. All I know is that none of threading libraries maintains VFP state, 'struct fpreg' is badly defined (is to short for fill VFP context), and pre r315974 kernel doesn't initialize _vfp (renamed to mc_spare) part of mcontext_t. So I'm seeking a way how to fix all this. But I'm not familiar with kse -> pthread transition history, so I'm not sure which parts are actively used. Michal From owner-svn-src-all@freebsd.org Tue Mar 28 10:22:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:23:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:24:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:24:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:25:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:25:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:26:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1F6DD1FFF7; Tue, 28 Mar 2017 10:26:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 8948DEFC; Tue, 28 Mar 2017 10:26:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id B15C31040F1B; Tue, 28 Mar 2017 20:51:49 +1100 (AEDT) Date: Tue, 28 Mar 2017 20:51:48 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-Reply-To: Message-ID: <20170328203618.N1920@besplex.bde.org> References: <201703272253.v2RMra2L032487@repo.freebsd.org> <20170328141213.T927@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=ecsj_lGnN_rLbzqxT6gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:26:08 -0000 On Tue, 28 Mar 2017, Warner Losh wrote: > [[ sorry for the top post but it's quick ]] It's quicker and almost equivalent to delete what you reply to. > Summary, in Bruce's own words > >> the whole optimization step was silly. > > I agree. on my -current system, clang compiled boot2 was 4 bytes > smaller after ripping it out. gcc was a whopping 7 bytes larger. Since > gcc has 156 still free, I think it's best to just retire this. > > Maybe you can give me a hint as to which structs to look at to get > back those 7 bytes :) Just sort the character arrays to get back 4. Maybe clang already does this, though I like getting the same order as in the sources. Reducing 1 of the arrays by 1 byte would then save 1 and get back the other 3. Bruce From owner-svn-src-all@freebsd.org Tue Mar 28 10:26:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:34:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47F73D2059F; Tue, 28 Mar 2017 10:34:46 +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 1FBC7AB5; Tue, 28 Mar 2017 10:34:46 +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 v2SAYj9x022967; Tue, 28 Mar 2017 10:34:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAYikF022960; Tue, 28 Mar 2017 10:34:44 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201703281034.v2SAYikF022960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 28 Mar 2017 10:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316094 - in vendor/libarchive/dist: . libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:34:46 -0000 Author: mm Date: Tue Mar 28 10:34:44 2017 New Revision: 316094 URL: https://svnweb.freebsd.org/changeset/base/316094 Log: Update vendor/libarchive to git a04b5adede4022dd593af76cb2fc2e96cb34df91 Vendor changes (FreeBSD-related): - add missing file from previous merge - encapsulate platform ACL code in an #ifdef Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c vendor/libarchive/dist/libarchive/archive_disk_acl_sunos.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Tue Mar 28 10:26:27 2017 (r316093) +++ vendor/libarchive/dist/Makefile.am Tue Mar 28 10:34:44 2017 (r316094) @@ -250,32 +250,16 @@ libarchive_la_SOURCES+= \ endif if INC_LINUX_ACL -libarchive_la_SOURCES+= \ - libarchive/archive_acl_maps.h \ - libarchive/archive_acl_maps_linux.c \ - libarchive/archive_read_disk_acl_linux.c \ - libarchive/archive_write_disk_acl_linux.c +libarchive_la_SOURCES+= libarchive/archive_disk_acl_linux.c else if INC_SUNOS_ACL -libarchive_la_SOURCES+= \ - libarchive/archive_acl_maps.h \ - libarchive/archive_acl_maps_sunos.c \ - libarchive/archive_read_disk_acl_sunos.c \ - libarchive/archive_write_disk_acl_sunos.c +libarchive_la_SOURCES+= libarchive/archive_disk_acl_sunos.c else if INC_DARWIN_ACL -libarchive_la_SOURCES+= \ - libarchive/archive_acl_maps.h \ - libarchive/archive_acl_maps_darwin.c \ - libarchive/archive_read_disk_acl_darwin.c \ - libarchive/archive_write_disk_acl_darwin.c +libarchive_la_SOURCES+= libarchive/archive_disk_acl_darwin.c else if INC_FREEBSD_ACL -libarchive_la_SOURCES+= \ - libarchive/archive_acl_maps.h \ - libarchive/archive_acl_maps_freebsd.c \ - libarchive/archive_read_disk_acl_freebsd.c \ - libarchive/archive_write_disk_acl_freebsd.c +libarchive_la_SOURCES+= libarchive/archive_disk_acl_freebsd.c endif endif endif Modified: vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c Tue Mar 28 10:26:27 2017 (r316093) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c Tue Mar 28 10:34:44 2017 (r316094) @@ -25,6 +25,8 @@ #include "archive_platform.h" +#if ARCHIVE_ACL_DARWIN + #ifdef HAVE_FCNTL_H #include #endif @@ -554,3 +556,4 @@ archive_write_disk_set_acls(struct archi } return (ret); } +#endif /* ARCHIVE_ACL_DARWIN */ Modified: vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c Tue Mar 28 10:26:27 2017 (r316093) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c Tue Mar 28 10:34:44 2017 (r316094) @@ -27,6 +27,8 @@ #include "archive_platform.h" +#if ARCHIVE_ACL_FREEBSD + #ifdef HAVE_ERRNO_H #include #endif @@ -695,3 +697,4 @@ archive_write_disk_set_acls(struct archi #endif return (ret); } +#endif /* ARCHIVE_ACL_FREEBSD */ Modified: vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c Tue Mar 28 10:26:27 2017 (r316093) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c Tue Mar 28 10:34:44 2017 (r316094) @@ -27,6 +27,8 @@ #include "archive_platform.h" +#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_LIBRICHACL + #ifdef HAVE_ERRNO_H #include #endif @@ -738,3 +740,4 @@ archive_write_disk_set_acls(struct archi #endif /* ARCHIVE_ACL_LIBACL */ return (ret); } +#endif /* ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_LIBRICHACL */ Modified: vendor/libarchive/dist/libarchive/archive_disk_acl_sunos.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_disk_acl_sunos.c Tue Mar 28 10:26:27 2017 (r316093) +++ vendor/libarchive/dist/libarchive/archive_disk_acl_sunos.c Tue Mar 28 10:34:44 2017 (r316094) @@ -25,6 +25,8 @@ #include "archive_platform.h" +#if ARCHIVE_ACL_SUNOS + #ifdef HAVE_ERRNO_H #include #endif @@ -816,3 +818,4 @@ archive_write_disk_set_acls(struct archi #endif return (ret); } +#endif /* ARCHIVE_ACL_SUNOS */ From owner-svn-src-all@freebsd.org Tue Mar 28 10:39:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0818D206F9; Tue, 28 Mar 2017 10:39:20 +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 BC870C72; Tue, 28 Mar 2017 10:39:20 +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 v2SAdJJx023298; Tue, 28 Mar 2017 10:39:19 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SAdHI7023277; Tue, 28 Mar 2017 10:39:17 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201703281039.v2SAdHI7023277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 28 Mar 2017 10:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316095 - in head: contrib/libarchive contrib/libarchive/libarchive lib/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:39:21 -0000 Author: mm Date: Tue Mar 28 10:39:17 2017 New Revision: 316095 URL: https://svnweb.freebsd.org/changeset/base/316095 Log: MFV r316083,316094: Sync libarchive with vendor Vendor changes (FreeBSD-related): - 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 MFC after: 3 days X-MFC-with: 315636, 315876 Added: head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c - copied, changed from r316083, vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c Deleted: head/contrib/libarchive/libarchive/archive_acl_maps.h head/contrib/libarchive/libarchive/archive_acl_maps_freebsd.c head/contrib/libarchive/libarchive/archive_read_disk_acl_freebsd.c head/contrib/libarchive/libarchive/archive_write_disk_acl_freebsd.c Modified: head/contrib/libarchive/FREEBSD-Xlist head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_getdate.c head/contrib/libarchive/libarchive/archive_pack_dev.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_string_sprintf.c head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_write_add_filter.c head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c head/contrib/libarchive/libarchive/archive_write_add_filter_program.c head/contrib/libarchive/libarchive/archive_write_set_format.c head/contrib/libarchive/libarchive/archive_write_set_format_by_name.c head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c head/contrib/libarchive/libarchive/archive_write_set_format_warc.c head/lib/libarchive/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/FREEBSD-Xlist ============================================================================== --- head/contrib/libarchive/FREEBSD-Xlist Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/FREEBSD-Xlist Tue Mar 28 10:39:17 2017 (r316095) @@ -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 Copied and modified: head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c (from r316083, vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c) ============================================================================== --- vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c Tue Mar 28 09:58:54 2017 (r316083, copy source) +++ head/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c Tue Mar 28 10:39:17 2017 (r316095) @@ -27,6 +27,8 @@ #include "archive_platform.h" +#if ARCHIVE_ACL_FREEBSD + #ifdef HAVE_ERRNO_H #include #endif @@ -695,3 +697,4 @@ archive_write_disk_set_acls(struct archi #endif return (ret); } +#endif /* ARCHIVE_ACL_FREEBSD */ Modified: head/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_entry.c Tue Mar 28 10:39:17 2017 (r316095) @@ -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; @@ -1843,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; @@ -1895,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; @@ -1963,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: head/contrib/libarchive/libarchive/archive_getdate.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_getdate.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_getdate.c Tue Mar 28 10:39:17 2017 (r316095) @@ -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: head/contrib/libarchive/libarchive/archive_pack_dev.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_pack_dev.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_pack_dev.c Tue Mar 28 10:39:17 2017 (r316095) @@ -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: head/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Tue Mar 28 10:39:17 2017 (r316095) @@ -187,7 +187,7 @@ struct lzx_stream { #define CFDATA_cbData 4 #define CFDATA_cbUncomp 6 -static const char *compression_name[] = { +static const char * const compression_name[] = { "NONE", "MSZIP", "Quantum", Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Tue Mar 28 10:39:17 2017 (r316095) @@ -2477,7 +2477,7 @@ lzh_huffman_free(struct huffman *hf) free(hf->tree); } -static char bitlen_tbl[0x400] = { +static const char bitlen_tbl[0x400] = { 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Mar 28 10:39:17 2017 (r316095) @@ -399,41 +399,41 @@ bid_keycmp(const char *p, const char *ke static int bid_keyword(const char *p, ssize_t len) { - static const char *keys_c[] = { + static const char * const keys_c[] = { "content", "contents", "cksum", NULL }; - static const char *keys_df[] = { + static const char * const keys_df[] = { "device", "flags", NULL }; - static const char *keys_g[] = { + static const char * const keys_g[] = { "gid", "gname", NULL }; - static const char *keys_il[] = { + static const char * const keys_il[] = { "ignore", "inode", "link", NULL }; - static const char *keys_m[] = { + static const char * const keys_m[] = { "md5", "md5digest", "mode", NULL }; - static const char *keys_no[] = { + static const char * const keys_no[] = { "nlink", "nochange", "optional", NULL }; - static const char *keys_r[] = { + static const char * const keys_r[] = { "resdevice", "rmd160", "rmd160digest", NULL }; - static const char *keys_s[] = { + static const char * const keys_s[] = { "sha1", "sha1digest", "sha256", "sha256digest", "sha384", "sha384digest", "sha512", "sha512digest", "size", NULL }; - static const char *keys_t[] = { + static const char * const keys_t[] = { "tags", "time", "type", NULL }; - static const char *keys_u[] = { + static const char * const keys_u[] = { "uid", "uname", NULL }; - const char **keys; + const char * const *keys; int i; switch (*p) { Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Mar 28 10:39:17 2017 (r316095) @@ -347,7 +347,7 @@ fake_crc32(unsigned long crc, const void return 0; } -static struct { +static const struct { int id; const char * name; } compression_methods[] = { Modified: head/contrib/libarchive/libarchive/archive_string_sprintf.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_string_sprintf.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_string_sprintf.c Tue Mar 28 10:39:17 2017 (r316095) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); static void append_uint(struct archive_string *as, uintmax_t d, unsigned base) { - static const char *digits = "0123456789abcdef"; + static const char digits[] = "0123456789abcdef"; if (d >= base) append_uint(as, d/base, base); archive_strappend_char(as, digits[d % base]); Modified: head/contrib/libarchive/libarchive/archive_util.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_util.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_util.c Tue Mar 28 10:39:17 2017 (r316095) @@ -193,7 +193,7 @@ archive_copy_error(struct archive *dest, void __archive_errx(int retvalue, const char *msg) { - static const char *msg1 = "Fatal Internal Error in libarchive: "; + static const char msg1[] = "Fatal Internal Error in libarchive: "; size_t s; s = write(2, msg1, strlen(msg1)); @@ -221,8 +221,8 @@ __archive_errx(int retvalue, const char int __archive_mktemp(const char *tmpdir) { - static const wchar_t *prefix = L"libarchive_"; - static const wchar_t *suffix = L"XXXXXXXXXX"; + static const wchar_t prefix[] = L"libarchive_"; + static const wchar_t suffix[] = L"XXXXXXXXXX"; static const wchar_t num[] = { L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7', L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F', Modified: head/contrib/libarchive/libarchive/archive_write_add_filter.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_add_filter.c Tue Mar 28 10:39:17 2017 (r316095) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" /* A table that maps filter codes to functions. */ -static +static const struct { int code; int (*setter)(struct archive *); } codes[] = { { ARCHIVE_FILTER_NONE, archive_write_add_filter_none }, Modified: head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c Tue Mar 28 10:39:17 2017 (r316095) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" /* A table that maps names to functions. */ -static +static const struct { const char *name; int (*setter)(struct archive *); } names[] = { { "b64encode", archive_write_add_filter_b64encode }, Modified: head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c Tue Mar 28 10:39:17 2017 (r316095) @@ -225,7 +225,7 @@ archive_filter_lz4_open(struct archive_w struct private_data *data = (struct private_data *)f->data; int ret; size_t required_size; - static size_t bkmap[] = { 64 * 1024, 256 * 1024, 1 * 1024 * 1024, + static size_t const bkmap[] = { 64 * 1024, 256 * 1024, 1 * 1024 * 1024, 4 * 1024 * 1024 }; size_t pre_block_size; Modified: head/contrib/libarchive/libarchive/archive_write_add_filter_program.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_add_filter_program.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_add_filter_program.c Tue Mar 28 10:39:17 2017 (r316095) @@ -92,7 +92,7 @@ archive_write_add_filter_program(struct { struct archive_write_filter *f = __archive_write_allocate_filter(_a); struct private_data *data; - static const char *prefix = "Program: "; + static const char prefix[] = "Program: "; archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, "archive_write_add_filter_program"); Modified: head/contrib/libarchive/libarchive/archive_write_set_format.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_set_format.c Tue Mar 28 10:39:17 2017 (r316095) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" /* A table that maps format codes to functions. */ -static +static const struct { int code; int (*setter)(struct archive *); } codes[] = { { ARCHIVE_FORMAT_7ZIP, archive_write_set_format_7zip }, Modified: head/contrib/libarchive/libarchive/archive_write_set_format_by_name.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_by_name.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_set_format_by_name.c Tue Mar 28 10:39:17 2017 (r316095) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" /* A table that maps names to functions. */ -static +static const struct { const char *name; int (*setter)(struct archive *); } names[] = { { "7zip", archive_write_set_format_7zip }, Modified: head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c Tue Mar 28 10:39:17 2017 (r316095) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" /* A table that maps names to functions. */ -static +static const struct { const char *name; int (*format)(struct archive *); int (*filter)(struct archive *); } names[] = { { ".7z", archive_write_set_format_7zip, archive_write_add_filter_none}, Modified: head/contrib/libarchive/libarchive/archive_write_set_format_warc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_warc.c Tue Mar 28 10:34:44 2017 (r316094) +++ head/contrib/libarchive/libarchive/archive_write_set_format_warc.c Tue Mar 28 10:39:17 2017 (r316095) @@ -354,7 +354,7 @@ static ssize_t _popul_ehdr(struct archive_string *tgt, size_t tsz, warc_essential_hdr_t hdr) { static const char _ver[] = "WARC/1.0\r\n"; - static const char *_typ[LAST_WT] = { + static const char * const _typ[LAST_WT] = { NULL, "warcinfo", "metadata", "resource", NULL }; char std_uuid[48U]; Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Tue Mar 28 10:34:44 2017 (r316094) +++ head/lib/libarchive/Makefile Tue Mar 28 10:39:17 2017 (r316095) @@ -45,10 +45,10 @@ INCS= archive.h archive_entry.h # Sources to be compiled. SRCS= archive_acl.c \ - archive_acl_maps_freebsd.c \ archive_check_magic.c \ archive_cmdline.c \ archive_cryptor.c \ + archive_disk_acl_freebsd.c \ archive_digest.c \ archive_entry.c \ archive_entry_copy_stat.c \ @@ -70,7 +70,6 @@ SRCS= archive_acl.c \ archive_read_add_passphrase.c \ archive_read_append_filter.c \ archive_read_data_into_fd.c \ - archive_read_disk_acl_freebsd.c \ archive_read_disk_entry_from_file.c \ archive_read_disk_posix.c \ archive_read_disk_set_standard_lookup.c \ @@ -118,7 +117,6 @@ SRCS= archive_acl.c \ archive_virtual.c \ archive_write.c \ archive_write_add_filter.c \ - archive_write_disk_acl_freebsd.c \ archive_write_disk_set_standard_lookup.c \ archive_write_disk_posix.c \ archive_write_open_fd.c \ From owner-svn-src-all@freebsd.org Tue Mar 28 10:43:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:43:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 10:53:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 007FBD20D3C; Tue, 28 Mar 2017 10:53:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id BF163AAE; Tue, 28 Mar 2017 10:53:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 893181A2079; Tue, 28 Mar 2017 21:22:46 +1100 (AEDT) Date: Tue, 28 Mar 2017 21:22:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ngie Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316081 - head/lib/libcam In-Reply-To: <201703280824.v2S8OGTb066055@repo.freebsd.org> Message-ID: <20170328205205.O1920@besplex.bde.org> References: <201703280824.v2S8OGTb066055@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=-kYPNxOwzWyFIoaqOU8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 10:53:10 -0000 On Tue, 28 Mar 2017, Ngie Cooper wrote: > Log: > 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. Unfortunately, cam is is supposed to not match style(9) guidelines for indentation. It has its own style for many things, and used to follow this very consistently. Its style for continuation indentation is the same as gnu style (-lp). The following of -lp seems to have been perfect for multi-line snprintf()s in camlib.c. This gave 56 lines perfectly not matching style(9), or about 1/4 of the non-matches. Bruce From owner-svn-src-all@freebsd.org Tue Mar 28 13:20:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6BDCD2191F for ; Tue, 28 Mar 2017 13:20:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) (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 312A3832 for ; Tue, 28 Mar 2017 13:20:50 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f65.google.com with SMTP id v2so10492345lfi.2 for ; Tue, 28 Mar 2017 06:20:50 -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=H6fUvwSl+gYgrpyog3+AbXsLBma7RO1jYpiy6L+nuToFUDwZSRvbYP0iZQBPbvt59z HphHO7djz2qCbSNplptM7qPcSjnB9WLCaEgU/qq+Np9swCo2WVT+wv8RVEiO51MZ3kBL J5n7ARtTRgL2gHkKWgRFOC/Sa30fs2YX1X5Hy5eKMsFbFBkb2ozgWGatAqwasU7saXJF Vl5fVexaASwNkphuuEDViPWfAERbC3/jnk/8GF9UgUEdTzCvLVI5tX/XqSWbh3Wr8h66 rJxvkxw8jdANN/SU92KwuuwyOAQF/7JNmutQAgyKyKTaF8krBbqohsml894bPocc89sz F3LQ== X-Gm-Message-State: AFeK/H0OdeyieoTM7qT8zDVaMvbLj9NtRK8ES9TWHlEerSaNvSUb+ByuLmb+GOW2N+DDpw== 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 13:20:51 -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-all@freebsd.org Tue Mar 28 13:39:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-all@freebsd.org Tue Mar 28 15:55:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEFA6D2229F; Tue, 28 Mar 2017 15:55:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1AFBB38; Tue, 28 Mar 2017 15:55:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v2SFtpT2005539; Tue, 28 Mar 2017 08:55:51 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v2SFtoSU005538; Tue, 28 Mar 2017 08:55:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-Reply-To: <20170328192226.F1710@besplex.bde.org> To: Bruce Evans Date: Tue, 28 Mar 2017 08:55:50 -0700 (PDT) CC: Julian Elischer , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 15:55:55 -0000 > On Mon, 27 Mar 2017, Julian Elischer wrote: > > > On Tue, 28 Mar 2017, Bruce Evans wrote: > > > > [...] > > > >> they have to fit below 640K and a few multiples of 64K are already > >> used for buffers). The limit on 8K is mainly a historical mistake. > >> A limit of 7.5K simplified booting from 15-sector floppies. 18-sector > > > > My memory says that the limit of 7.5K is becuase there was only 8k left free > > at the front of UFS1 and one sector was used for the boot0 code. > > That is only a limit if the boot code is in the ffs partition. This causes > other problems. It was the default to start the 'a' partition at offset 0, > but that was changed 10-15 years ago. I can't find exactly where it is > changed. I use an offset of 8192 sectors or 4M on new and repartitioned > hard disks. IIRC, it was sizeof(boot0)+sizeof(boot1) had to fit in the 8K byte hole at the start of a ffs/ufs1 disk if and only if the disk was in dangeriously dedicated mode, which is the same case for a floppy. This 8K hole, again iirc, is actually a #define. Later someone seems to have though you need to offset partition a: by 16 blocks for this and made the installers do magic this, as far as I can see, is incorrect and I have manually been reseting the first partition of my bsdlabels to 0 and adding 16 blocks to there size. I think we still have an 8k size limit on boot1 for ffs/(ufs1 or ufs2) (Proved self wrong on the 8k limit, see comments from sys/ufs/ffs/fs.h below) as it this code still lives in the start of the partition, though there is usually 62 (or some other similiar number that is geometry dependent) sectors of unused space between the mbr and the start of the bsd slice. Here is the truth on the magic holes from sys/ufs/ffs/fs.h: * Depending on the architecture and the media, the superblock may * reside in any one of four places. For tiny media where every block * counts, it is placed at the very front of the partition. Historically, * UFS1 placed it 8K from the front to leave room for the disk label and * a small bootstrap. For UFS2 it got moved to 64K from the front to leave * room for the disk label and a bigger bootstrap, and for really piggy * systems we check at 256K from the front if the first three fail. In * all cases the size of the superblock will be SBLOCKSIZE. All values are * given in byte-offset form, so they do not imply a sector size. The * SBLOCKSEARCH specifies the order in which the locations should be searched. > This is again affected by the existence of floppy disks. Floppy disks are > usually not partitioned, and don't have space to spare for large boot > blocks. Some version of the boot code has to work on small media, and > FreeBSD uses the same boot code for all media. This allowed FreeBSD-1 > to have a single boot.flp where IIRC Linux had about 100 variations. > Small media is not as small as it used to be. > > Bruce -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Mar 28 16:07:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD4A4D226A5; Tue, 28 Mar 2017 16:07:25 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B440C20B; Tue, 28 Mar 2017 16:07:25 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0ONJ00N008ER2Y00@st13p35im-asmtp001.me.com>; Tue, 28 Mar 2017 16:07:17 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1490717236; bh=8AasVPW+rVdImHldV070NxGirRdnw2/St7KLq3hhmP8=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=Ny8NASJt0DJTEucQl4NpmgULwI/vMbm3Z19FxHDkHktEhOhmUDlWJkfWmjt+ErXG3 zL04BRSCGleIbkwOxIoH0dv8cq9pcQyZNmpRaRN+0/8YhaowRrUexTH4Puy8NAXoIE G6+Rf6JczrzyMkqbdckXjjmVVAKXloDf8eMnizo8nXhHY5i6h9Ph7tDR32AKsIubVh on8fDfUwuIYwz2fZKvtQiAneof0asplIMtutvT3uTOokyimQFsEOP5OxGDmZf1dOy8 rPGokt4kqOVMy/gSVp5LeaIOVrd1VW4wIsCAKhk67Eg7s8QTLW/dFa21+9v1fFNE91 5+5J4I7a7J1LQ== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0ONJ00MG28S1UW00@st13p35im-asmtp001.me.com>; Tue, 28 Mar 2017 16:07:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-28_13:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=3 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1703280134 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 From: Toomas Soome In-reply-to: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> Date: Tue, 28 Mar 2017 19:07:13 +0300 Cc: Bruce Evans , Julian Elischer , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <8EB5A473-1218-4A57-8741-374669A9F5B8@me.com> References: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 16:07:26 -0000 > On 28. m=C3=A4rts 2017, at 18:55, Rodney W. Grimes = wrote: >=20 >> On Mon, 27 Mar 2017, Julian Elischer wrote: >>=20 >>> On Tue, 28 Mar 2017, Bruce Evans wrote: >>>=20 >>> [...] >>>=20 >>>> they have to fit below 640K and a few multiples of 64K are already >>>> used for buffers). The limit on 8K is mainly a historical mistake. >>>> A limit of 7.5K simplified booting from 15-sector floppies. = 18-sector >>>=20 >>> My memory says that the limit of 7.5K is becuase there was only 8k = left free=20 >>> at the front of UFS1 and one sector was used for the boot0 code. >>=20 >> That is only a limit if the boot code is in the ffs partition. This = causes >> other problems. It was the default to start the 'a' partition at = offset 0, >> but that was changed 10-15 years ago. I can't find exactly where it = is >> changed. I use an offset of 8192 sectors or 4M on new and = repartitioned >> hard disks. >=20 > IIRC, it was sizeof(boot0)+sizeof(boot1) had to fit in the 8K byte = hole > at the start of a ffs/ufs1 disk if and only if the disk was in = dangeriously > dedicated mode, which is the same case for a floppy. >=20 > This 8K hole, again iirc, is actually a #define. Later someone seems > to have though you need to offset partition a: by 16 blocks for this > and made the installers do magic this, as far as I can see, is = incorrect > and I have manually been reseting the first partition of my bsdlabels > to 0 and adding 16 blocks to there size. >=20 > I think we still have an 8k size limit on boot1 for ffs/(ufs1 or ufs2) > (Proved self wrong on the 8k limit, see comments from sys/ufs/ffs/fs.h > below) > as it this code still lives in the start of the partition, though = there > is usually 62 (or some other similiar number that is geometry = dependent) > sectors of unused space between the mbr and the start of the bsd = slice. >=20 > Here is the truth on the magic holes from sys/ufs/ffs/fs.h: > * Depending on the architecture and the media, the superblock may > * reside in any one of four places. For tiny media where every block > * counts, it is placed at the very front of the partition. = Historically, > * UFS1 placed it 8K from the front to leave room for the disk label = and > * a small bootstrap. For UFS2 it got moved to 64K from the front to = leave > * room for the disk label and a bigger bootstrap, and for really piggy > * systems we check at 256K from the front if the first three fail. In > * all cases the size of the superblock will be SBLOCKSIZE. All values = are > * given in byte-offset form, so they do not imply a sector size. The > * SBLOCKSEARCH specifies the order in which the locations should be = searched. >=20 >> This is again affected by the existence of floppy disks. Floppy = disks are >> usually not partitioned, and don't have space to spare for large boot >> blocks. Some version of the boot code has to work on small media, = and >> FreeBSD uses the same boot code for all media. This allowed = FreeBSD-1 >> to have a single boot.flp where IIRC Linux had about 100 variations. >> Small media is not as small as it used to be. >>=20 >> Bruce >=20 > --=20 > Rod Grimes = rgrimes@freebsd.org >=20 Also note that SunOS (which ufs is based on ufs1), has disk layout on = sparc as sector 0 for VTOC (512B), followed by 15 sectors for bootblk, = total 16 sectors, or 8KB, the setup which did allow to define slice 0 to = start from the absolute sector 0, and which probably did also burn = uncounted amount of DBA=E2=80=99s who did attempt the same for their raw = databases;) rgds, toomas= From owner-svn-src-all@freebsd.org Tue Mar 28 16:35:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E48D5D2205D; Tue, 28 Mar 2017 16:35:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 777AE893; Tue, 28 Mar 2017 16:35:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 1E97242726F; Wed, 29 Mar 2017 03:35:15 +1100 (AEDT) Date: Wed, 29 Mar 2017 03:35:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: rgrimes@freebsd.org cc: Bruce Evans , Julian Elischer , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-Reply-To: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> Message-ID: <20170329025928.K2954@besplex.bde.org> References: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=XTA5t8YazG6EhG8ZpPQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 16:35:19 -0000 On Tue, 28 Mar 2017, Rodney W. Grimes wrote: >> On Mon, 27 Mar 2017, Julian Elischer wrote: >> >>> On Tue, 28 Mar 2017, Bruce Evans wrote: >>> >>> [...] >>> >>>> they have to fit below 640K and a few multiples of 64K are already >>>> used for buffers). The limit on 8K is mainly a historical mistake. >>>> A limit of 7.5K simplified booting from 15-sector floppies. 18-sector >>> >>> My memory says that the limit of 7.5K is becuase there was only 8k left free >>> at the front of UFS1 and one sector was used for the boot0 code. >> >> That is only a limit if the boot code is in the ffs partition. This causes >> other problems. It was the default to start the 'a' partition at offset 0, >> but that was changed 10-15 years ago. I can't find exactly where it is >> changed. I use an offset of 8192 sectors or 4M on new and repartitioned >> hard disks. > > IIRC, it was sizeof(boot0)+sizeof(boot1) had to fit in the 8K byte hole > at the start of a ffs/ufs1 disk if and only if the disk was in dangeriously > dedicated mode, which is the same case for a floppy. Dangerously dedicated is still often partitioned, except on floppies. > This 8K hole, again iirc, is actually a #define. Later someone seems > to have though you need to offset partition a: by 16 blocks for this > and made the installers do magic this, as far as I can see, is incorrect > and I have manually been reseting the first partition of my bsdlabels > to 0 and adding 16 blocks to there size. The #define is BBSIZE, but struct disklabel always (at least as far back as FreeBSD-1) had a variable field d_bbsize for it. The support for changing the variable is just fairly broken. struct disklabel also has d_sbsize for giving the maximum size of the "fs" superblock. These fields might be limited by the fs iff the label is inside an fs partition. They are in practice for ffs. Other fs's might not even have an ffs-style superblock. The offset is necessary for separate protection on the metadata and the file system. I still have to fight the geom's protection. kern.debug/geomflags sometimes works. If there were more partitions then the metadata should be on a separate one. Of course, you might want the same protection on the label and the root partition, to make it harder to change either. > I think we still have an 8k size limit on boot1 for ffs/(ufs1 or ufs2) > (Proved self wrong on the 8k limit, see comments from sys/ufs/ffs/fs.h > below) > as it this code still lives in the start of the partition, though there > is usually 62 (or some other similiar number that is geometry dependent) > sectors of unused space between the mbr and the start of the bsd slice. boot1 is normally part of boot2, and only exists logically. boot0 should have size 1 sector (or 512 bytes) since the second sector is more likely to be clobbered by other OSes and BIOSes and you can't control these. Windows even scribbles a disk id on the first sector. > Here is the truth on the magic holes from sys/ufs/ffs/fs.h: > * Depending on the architecture and the media, the superblock may > * reside in any one of four places. For tiny media where every block > * counts, it is placed at the very front of the partition. Historically, > * UFS1 placed it 8K from the front to leave room for the disk label and > * a small bootstrap. For UFS2 it got moved to 64K from the front to leave > * room for the disk label and a bigger bootstrap, and for really piggy > * systems we check at 256K from the front if the first three fail. In > * all cases the size of the superblock will be SBLOCKSIZE. All values are > * given in byte-offset form, so they do not imply a sector size. The > * SBLOCKSEARCH specifies the order in which the locations should be searched. Only true for ffs in the very dangerously dedicated case with no partitions :-). The boot blocks are somewhat constrained by this. You need small ones if you want to support the worse case of ffs1 on a very dangerously dedicated disk. Once you have written these, it is simplest to use them in all cases. Bruce From owner-svn-src-all@freebsd.org Tue Mar 28 17:37:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2651AD2244D; Tue, 28 Mar 2017 17:37:51 +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 E304427D; Tue, 28 Mar 2017 17:37: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 v2SHboE0099072; Tue, 28 Mar 2017 17:37:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SHbn1i099064; Tue, 28 Mar 2017 17:37:49 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703281737.v2SHbn1i099064@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 17:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316099 - in head: etc/mtree lib/libkvm lib/libkvm/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 17:37:51 -0000 Author: ngie Date: Tue Mar 28 17:37:49 2017 New Revision: 316099 URL: https://svnweb.freebsd.org/changeset/base/316099 Log: lib/libkvm: start adding basic tests for kvm(3) - kvm_close: add a testcase to verify support for errno = EINVAL / -1 (see D10065) when kd == NULL is provided to the libcall. - kvm_geterr: -- Add a negative testcase for kd == NULL returning "" (see D10022). -- Add two positive testcases: --- test the error case using kvm_write on a O_RDONLY descriptor. --- test the "no error" case using kvm_read(3) and kvm_nlist(3) as helper routines and by injecting a bogus error message via _kvm_err (an internal API) _kvm_err was used as there isn't a formalized way to clear the error output, and because kvm_nlist always returns ENOENT with the NULL terminator today. - kvm_open, kvm_open2: -- Add some basic negative tests for kvm_open(3) and kvm_open2(3). Testing positive cases with a specific `corefile`/`execfile`/`resolver` requires more work and would require user intervention today in order to reliably test this out. Reviewed by: markj MFC after: 2 months Sponsored by: Dell EMC Isilon Differential Revision: D10024 Added: head/lib/libkvm/tests/ head/lib/libkvm/tests/Makefile (contents, props changed) head/lib/libkvm/tests/kvm_close_test.c (contents, props changed) head/lib/libkvm/tests/kvm_geterr_test.c (contents, props changed) head/lib/libkvm/tests/kvm_open2_test.c (contents, props changed) head/lib/libkvm/tests/kvm_open_test.c (contents, props changed) head/lib/libkvm/tests/kvm_test_common.c (contents, props changed) head/lib/libkvm/tests/kvm_test_common.h (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/lib/libkvm/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Mar 28 13:39:04 2017 (r316098) +++ head/etc/mtree/BSD.tests.dist Tue Mar 28 17:37:49 2017 (r316099) @@ -328,6 +328,8 @@ .. libdevdctl .. + libkvm + .. libmp .. libnv Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Tue Mar 28 13:39:04 2017 (r316098) +++ head/lib/libkvm/Makefile Tue Mar 28 17:37:49 2017 (r316099) @@ -36,4 +36,8 @@ MLINKS+=kvm_nlist.3 kvm_nlist2.3 MLINKS+=kvm_open.3 kvm_close.3 kvm_open.3 kvm_open2.3 kvm_open.3 kvm_openfiles.3 MLINKS+=kvm_read.3 kvm_read2.3 kvm_read.3 kvm_write.3 +.include + +SUBDIR.${MK_TESTS}= tests + .include Added: head/lib/libkvm/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/Makefile Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,22 @@ +# $FreeBSD$ + +.include + +ATF_TESTS_C+= kvm_close_test +ATF_TESTS_C+= kvm_geterr_test +ATF_TESTS_C+= kvm_open_test +ATF_TESTS_C+= kvm_open2_test + +CFLAGS.kvm_geterr_test+= -I${.CURDIR:H} + +LIBADD+= kvm + +WARNS?= 6 + +BINDIR= ${TESTSDIR} + +.for t in kvm_geterr_test kvm_open_test kvm_open2_test +SRCS.$t= $t.c kvm_test_common.c +.endfor + +.include Added: head/lib/libkvm/tests/kvm_close_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/kvm_close_test.c Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2017 Ngie Cooper + * 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 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 + +ATF_TC(kvm_close_negative_test_NULL); +ATF_TC_HEAD(kvm_close_negative_test_NULL, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "test that kvm_close(NULL) succeeds without error"); +} + +ATF_TC_BODY(kvm_close_negative_test_NULL, tc) +{ + + ATF_REQUIRE_ERRNO(EINVAL, kvm_close(NULL) == -1); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, kvm_close_negative_test_NULL); + + return (atf_no_error()); +} Added: head/lib/libkvm/tests/kvm_geterr_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/kvm_geterr_test.c Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,137 @@ +/*- + * Copyright (c) 2017 Ngie Cooper + * 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 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 + +#include "kvm_private.h" + +#include "kvm_test_common.h" + +ATF_TC(kvm_geterr_negative_test_NULL); +ATF_TC_HEAD(kvm_geterr_negative_test_NULL, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "test that kvm_geterr(NULL) returns NULL"); +} + +ATF_TC_BODY(kvm_geterr_negative_test_NULL, tc) +{ + + ATF_REQUIRE(!errbuf_has_error(kvm_geterr(NULL))); +} + +ATF_TC(kvm_geterr_positive_test_error); +ATF_TC_HEAD(kvm_geterr_positive_test_error, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "test that kvm_geterr(kd) when kd doesn't contain an error returns \"\""); + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(kvm_geterr_positive_test_error, tc) +{ + kvm_t *kd; + char *error_msg; + + errbuf_clear(); + kd = kvm_open2(NULL, NULL, O_RDONLY, errbuf, NULL); + ATF_CHECK(!errbuf_has_error(errbuf)); + ATF_REQUIRE_MSG(kd != NULL, "kvm_open2 failed: %s", errbuf); + ATF_REQUIRE_MSG(kvm_write(kd, 0, NULL, 0) == -1, + "kvm_write succeeded unexpectedly on an O_RDONLY file descriptor"); + error_msg = kvm_geterr(kd); + ATF_CHECK(errbuf_has_error(error_msg)); + ATF_REQUIRE_MSG(kvm_close(kd) == 0, "kvm_close failed: %s", + strerror(errno)); +} + +ATF_TC(kvm_geterr_positive_test_no_error); +ATF_TC_HEAD(kvm_geterr_positive_test_no_error, tc) +{ + + atf_tc_set_md_var(tc, "descr", + "test that kvm_geterr(kd) when kd contains an error returns an error message"); + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(kvm_geterr_positive_test_no_error, tc) +{ +#define ALL_IS_WELL "that ends well" + kvm_t *kd; + char *error_msg; + struct nlist nl[] = { +#define SYMNAME "_mp_maxcpus" +#define X_MAXCPUS 0 + { SYMNAME, 0, 0, 0, 0 }, + { NULL, 0, 0, 0, 0 }, + }; + ssize_t rc; + int mp_maxcpus, retcode; + + errbuf_clear(); + kd = kvm_open2(NULL, NULL, O_RDONLY, errbuf, NULL); + ATF_CHECK(!errbuf_has_error(errbuf)); + ATF_REQUIRE_MSG(kd != NULL, "kvm_open2 failed: %s", errbuf); + retcode = kvm_nlist(kd, nl); + ATF_REQUIRE_MSG(retcode != -1, + "kvm_nlist failed (returned %d): %s", retcode, kvm_geterr(kd)); + if (nl[X_MAXCPUS].n_type == 0) + atf_tc_skip("symbol (\"%s\") couldn't be found", SYMNAME); + _kvm_err(kd, NULL, "%s", ALL_IS_WELL); /* XXX: internal API */ + rc = kvm_read(kd, nl[X_MAXCPUS].n_value, &mp_maxcpus, + sizeof(mp_maxcpus)); + + ATF_REQUIRE_MSG(rc != -1, "kvm_read failed: %s", kvm_geterr(kd)); + error_msg = kvm_geterr(kd); + ATF_REQUIRE_MSG(strcmp(error_msg, ALL_IS_WELL) == 0, + "error message changed: %s", error_msg); + ATF_REQUIRE_MSG(kvm_close(kd) == 0, "kvm_close failed: %s", + strerror(errno)); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, kvm_geterr_negative_test_NULL); + ATF_TP_ADD_TC(tp, kvm_geterr_positive_test_error); + ATF_TP_ADD_TC(tp, kvm_geterr_positive_test_no_error); + + return (atf_no_error()); +} Added: head/lib/libkvm/tests/kvm_open2_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/kvm_open2_test.c Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2017 Ngie Cooper + * 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 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 +#include + +#include + +#include "kvm_test_common.h" + +ATF_TC_WITHOUT_HEAD(kvm_open2_negative_test_nonexistent_corefile); +ATF_TC_BODY(kvm_open2_negative_test_nonexistent_corefile, tc) +{ + + errbuf_clear(); + ATF_CHECK(kvm_open2(NULL, "/nonexistent", O_RDONLY, NULL, NULL) == NULL); + ATF_CHECK(!errbuf_has_error(errbuf)); + errbuf_clear(); + ATF_CHECK(kvm_open2(NULL, "/nonexistent", O_RDONLY, + errbuf, NULL) == NULL); + ATF_CHECK(errbuf_has_error(errbuf)); +} + +ATF_TC_WITHOUT_HEAD(kvm_open2_negative_test_nonexistent_execfile); +ATF_TC_BODY(kvm_open2_negative_test_nonexistent_execfile, tc) +{ + + errbuf_clear(); + ATF_CHECK(kvm_open2("/nonexistent", _PATH_DEVZERO, O_RDONLY, + NULL, NULL) == NULL); + ATF_CHECK(strlen(errbuf) == 0); + errbuf_clear(); + ATF_CHECK(kvm_open2("/nonexistent", _PATH_DEVZERO, O_RDONLY, + errbuf, NULL) == NULL); + ATF_CHECK(errbuf_has_error(errbuf)); +} + +ATF_TC(kvm_open2_negative_test_invalid_corefile); +ATF_TC_HEAD(kvm_open2_negative_test_invalid_corefile, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(kvm_open2_negative_test_invalid_corefile, tc) +{ + kvm_t *kd; + + errbuf_clear(); + atf_utils_create_file("some-file", "this is a text file"); + kd = kvm_open2(NULL, "some-file", O_RDONLY, errbuf, NULL); + ATF_CHECK(errbuf_has_error(errbuf)); + ATF_REQUIRE_MSG(kd == NULL, "kvm_open2 succeeded"); +} + +ATF_TC(kvm_open2_negative_test_invalid_execfile); +ATF_TC_HEAD(kvm_open2_negative_test_invalid_execfile, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(kvm_open2_negative_test_invalid_execfile, tc) +{ + kvm_t *kd; + + errbuf_clear(); + atf_utils_create_file("some-file", "this is a text file"); + kd = kvm_open2("some-file", "/bin/sh", O_RDONLY, errbuf, NULL); + ATF_CHECK(errbuf_has_error(errbuf)); + ATF_REQUIRE_MSG(kd == NULL, "kvm_open2 succeeded unexpectedly"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, kvm_open2_negative_test_invalid_corefile); + ATF_TP_ADD_TC(tp, kvm_open2_negative_test_invalid_execfile); + ATF_TP_ADD_TC(tp, kvm_open2_negative_test_nonexistent_corefile); + ATF_TP_ADD_TC(tp, kvm_open2_negative_test_nonexistent_execfile); + + return (atf_no_error()); +} Added: head/lib/libkvm/tests/kvm_open_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/kvm_open_test.c Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2017 Ngie Cooper + * 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 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 +#include + +#include + +#include "kvm_test_common.h" + +ATF_TC_WITHOUT_HEAD(kvm_open_negative_test_nonexistent_corefile); +ATF_TC_BODY(kvm_open_negative_test_nonexistent_corefile, tc) +{ + + ATF_CHECK(kvm_open(NULL, "/nonexistent", NULL, O_RDONLY, NULL) == NULL); + ATF_CHECK(kvm_open(NULL, "/nonexistent", NULL, O_RDONLY, + getprogname()) == NULL); +} + +ATF_TC_WITHOUT_HEAD(kvm_open_negative_test_nonexistent_execfile); +ATF_TC_BODY(kvm_open_negative_test_nonexistent_execfile, tc) +{ + + ATF_CHECK(kvm_open("/nonexistent", _PATH_DEVZERO, NULL, O_RDONLY, + NULL) == NULL); + ATF_CHECK(kvm_open("/nonexistent", _PATH_DEVZERO, NULL, O_RDONLY, + getprogname()) == NULL); +} + +ATF_TC(kvm_open_negative_test_invalid_corefile); +ATF_TC_HEAD(kvm_open_negative_test_invalid_corefile, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(kvm_open_negative_test_invalid_corefile, tc) +{ + kvm_t *kd; + + atf_utils_create_file("some-file", "this is a text file"); + kd = kvm_open(NULL, "some-file", NULL, O_RDONLY, getprogname()); + ATF_REQUIRE_MSG(kd == NULL, "kvm_open didn't return NULL on failure"); +} + +ATF_TC(kvm_open_negative_test_invalid_execfile); +ATF_TC_HEAD(kvm_open_negative_test_invalid_execfile, tc) +{ + + atf_tc_set_md_var(tc, "require.user", "root"); +} + +ATF_TC_BODY(kvm_open_negative_test_invalid_execfile, tc) +{ + kvm_t *kd; + + atf_utils_create_file("some-file", "this is a text file"); + kd = kvm_open("some-file", "/bin/sh", NULL, O_RDONLY, getprogname()); + ATF_REQUIRE_MSG(kd == NULL, "kvm_open succeeded unexpectedly"); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, kvm_open_negative_test_invalid_corefile); + ATF_TP_ADD_TC(tp, kvm_open_negative_test_invalid_execfile); + ATF_TP_ADD_TC(tp, kvm_open_negative_test_nonexistent_corefile); + ATF_TP_ADD_TC(tp, kvm_open_negative_test_nonexistent_execfile); + + return (atf_no_error()); +} Added: head/lib/libkvm/tests/kvm_test_common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/kvm_test_common.c Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2017 Ngie Cooper + * 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 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 "kvm_test_common.h" + +char errbuf[_POSIX2_LINE_MAX]; + +void +errbuf_clear(void) +{ + + strcpy(errbuf, ""); +} + +bool +errbuf_has_error(const char *_errbuf) +{ + + return (strcmp(_errbuf, "")); +} Added: head/lib/libkvm/tests/kvm_test_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libkvm/tests/kvm_test_common.h Tue Mar 28 17:37:49 2017 (r316099) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2017 Ngie Cooper + * 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __KVM_TEST_COMMON_H__ + +#include +#include +#include + +extern char errbuf[_POSIX2_LINE_MAX]; + +void errbuf_clear(void); +bool errbuf_has_error(const char *); + +#endif From owner-svn-src-all@freebsd.org Tue Mar 28 17:48:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CBAD22865; Tue, 28 Mar 2017 17:48:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::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 4F198BE3; Tue, 28 Mar 2017 17:48:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id g2so22892979pge.2; Tue, 28 Mar 2017 10:48:04 -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=zs8P0IYGcUAHDOpVAQUxAi3ZwJgR6u4+i59+mxQBr2I=; b=BNRVD+rCWy3E5MTQWKAVQht5OEdsIFAlSr4TrL2G+tc81I5T1DXemjhMGUCG3sYg9V 48MTWDPvxfio7aPGYBqrEARQ8GrgamSh/y4V+bQczyoalItPab8H79k+RhK1dfBg3TGt 14ZNlEHnduxqyp+FllLzKFn4Q5IadjDppar84ab9pvfEZ1VtJ0vCf7NYP+abvcUmbilD TTF/W1QEEomNeidMMzUqpuQK80obbKhZTZHt4lH9B2J67kFkfqnm1QZzbbGnNreRl7H4 wfYHRYWhYJU0GF/qf532lCXXCk4cjxAYNg08MYZaf9ss3pakbiL7a2J/Udh/NSPjTXAM 5hNQ== 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=zs8P0IYGcUAHDOpVAQUxAi3ZwJgR6u4+i59+mxQBr2I=; b=QLrrPPP/MFJcVlC1YA1/KINFfmfwXBe6Up/4AFy58jy7YP3SdHlPsD/gFVDaZLL+ww /Th3b75zInq1s5NzXHfYr0/KMWfMkL6vx+clxH72VF7kXqnL8SquWC4vE0asf1AkPQoa iwuQ9mlDZ9c3cQna/+f2m8YcDWK/3ysKmh58zv9vVkFE1JwSvYdLPXgE2Vs2LHheytbM kjUY2NZNKi28VY7S95C9Z6k4xCTY2D0KW0d+3n28TNAM/USAXjHPjNgn2qzNRcLFGnB0 28VbwV39wNdQI1uebx4d7r8LQuQg0cj2nxxPFE53V24UNAw8nVGESYC5qVbU3DP4aUt1 0h1Q== X-Gm-Message-State: AFeK/H02BKsa5MhM+NGV3wWeUdV4VtYtviwtvds4J+mdXzzGXej+uIbkHdzdJsGUgOLcbg== X-Received: by 10.98.70.198 with SMTP id o67mr32685665pfi.39.1490723283740; Tue, 28 Mar 2017 10:48:03 -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 z4sm8643093pge.49.2017.03.28.10.48.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Mar 2017 10:48:02 -0700 (PDT) Subject: Re: svn commit: r315689 - head/lib/libcompiler_rt Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4EAF6CE8-E9AE-4129-B859-D54CB0CC2CFB"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201703212107.v2LL7bYE020476@repo.freebsd.org> Date: Tue, 28 Mar 2017 10:48:01 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201703212107.v2LL7bYE020476@repo.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 17:48:04 -0000 --Apple-Mail=_4EAF6CE8-E9AE-4129-B859-D54CB0CC2CFB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 21, 2017, at 14:07, Dimitry Andric wrote: >=20 > Author: dim > Date: Tue Mar 21 21:07:37 2017 > New Revision: 315689 > URL: https://svnweb.freebsd.org/changeset/base/315689 >=20 > Log: > Gcc has incompatible internal declarations for __divtc3 and __multc3 = as > defined in compiler-rt, but it has no option to silence its warning, = so > make gcc warnings for libcompiler_rt non-fatal. >=20 > Noticed by: lwhsu > MFC after: 3 days >=20 > Modified: > head/lib/libcompiler_rt/Makefile This doesn=E2=80=99t work: 11:31:39 /workspace/src/contrib/compiler-rt/lib/builtins/divtc3.c:21:1: error: = conflicting types for built-in function '__divtc3' [-Werror] 11:31:39 __divtc3(long double __a, long double __b, long double __c, long double = __d) 11:31:39 ^~~~~~~~ Thanks, -Ngie --Apple-Mail=_4EAF6CE8-E9AE-4129-B859-D54CB0CC2CFB 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 iQIcBAEBCgAGBQJY2qHSAAoJEPWDqSZpMIYVrOoQANYX2l5of1t3rSAiHQRkz+mq PsHwx9AwfsBkEwphuqEyrT/LdgXJgyhSKU3yBIrBcFdHQGtEQ0qNOi1o2uj6lGyO Uy/Vdst7ORmWgIaSKE9viGXf6xP6cBmd7wSBiDIVcPIuEjuHWgDtGjeiJSCkOKzH jrq5AVCrJL2IRBfLkozedgMNYyJ+p74Cxv4rh2ar/m8Dra+vwgJa6YSB55uC5abU 1Leiw0ofGEFyie+CaRXL2Fzs16Fx7mqotKFZ3h9icF/287Ak/NOPrhe1TBoP13/O hUGuRQ1HjxflpEtRWRURs3yckEd9fAgx/YP2OXl22M+w0Q00OoPFV8J3+pLIsmTh MUBoF7wF4h9dkGmXUL4gN87hXaJGGnb0EGY+BBLuA1x4rpTvyTGg6cOy9j1zXn6u SVuIQpucKzUR530ZNtq4raXn+zxng/1lQwbYAHq2OggmHkj2r9cDxpwH3jhKSHoS SAIigebAVjS22+l5UpUqN7/8TaV2FEzyJqe18rEztB7oaSGAwL7H9GrCgzr5SGGX 4YntFPD1w0+H9EDSs1flvs82/otNpNOCecdeOxqEGarTvoEkOEjxo7kf72sLDQgJ haThaJkRLsHwCS14bf7eiHO+66YTmV3Bceu8LnL0sBEsDgo38SU6Im2qGQAkUPIL eLOc0+dWGbLBVuL0lo7A =mmSF -----END PGP SIGNATURE----- --Apple-Mail=_4EAF6CE8-E9AE-4129-B859-D54CB0CC2CFB-- From owner-svn-src-all@freebsd.org Tue Mar 28 17:49:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88FDAD22966; Tue, 28 Mar 2017 17:49:31 +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 55311DE7; Tue, 28 Mar 2017 17:49:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id 81so22942366pgh.3; Tue, 28 Mar 2017 10:49:31 -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=VtgC3Y9j632X7pMOhbpB4DGEErTDg/e/nCSgRs3CtKQ=; b=DtwpXfa676a9zvGwZ7ry2MvyzpeP4C3JHdv0EOgBf3Z4EhkYtyU7EdSKmPfcyw0eVS QqtV+rvIkXezkllnfEZkXt53H4Sq7QofMysZFCmIDQQrhr35W+zPk2n3LSHsWStjc2xB e5uKmcxZM87Zl3ga9OG2P24nOEGlEU3CkNnCXc9jihnm7E4qu8+fCpagbs4Nd6BTTpAV O/fDprFyZfxI2yT10MT57LFPC8iYMjidiw06R6HdW/q7yVCfiTrg1FL+zb2y+cT+KbQp RFIUgshzk5bDyW7NdBTMebCnz0RY7YRZiXU345t68aMbGh83awzbeE/XEu8lrLSaS3uI +3gQ== 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=VtgC3Y9j632X7pMOhbpB4DGEErTDg/e/nCSgRs3CtKQ=; b=J//tmJFMx3Ew1VxkZOvqItG2SMQrYrStv1fkEhJBFQlTTdJJ4YwGkFoj1IDSHx33/s RaBUv+gB4kHdsEoJcog47nSOF7mvFQCT0R9lMoBnUK1+aAjm2+Oe5WtYyyVG8PKLimAE rkv2sQnaeWZJAitq6ELU16HaqV2lbeneXEJA4A4fADngvl0I0RaQxdIMd+Dy+TOwzb9m OYrA+xJh6J2/SncLjRxX3cUMAdzyTjAWV5B9wQRH1kJ72cxkIr19VKCpM7pFrnhpmijB R5J5AP7Rqt8uKJ1oarVxnhFr7X1SdAlQrzH1o76PHLU8/Xp/JD8kdcd74UnacLRNMDYW HFrQ== X-Gm-Message-State: AFeK/H1txw2YLConRJzlKP2XNaJrEYZ4cR3PYKLV3VWO0ekBlMw+nEV9GD4klDuqLBJFRQ== X-Received: by 10.98.150.196 with SMTP id s65mr32328958pfk.220.1490723370645; Tue, 28 Mar 2017 10:49:30 -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 r13sm8723984pfg.55.2017.03.28.10.49.29 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Mar 2017 10:49:29 -0700 (PDT) Subject: Re: svn commit: r315689 - head/lib/libcompiler_rt Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_84375612-12A3-433C-91AB-7370A2AD8B6B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 28 Mar 2017 10:49:29 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201703212107.v2LL7bYE020476@repo.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 17:49:31 -0000 --Apple-Mail=_84375612-12A3-433C-91AB-7370A2AD8B6B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 28, 2017, at 10:48, Ngie Cooper (yaneurabeya) = wrote: >=20 >>=20 >> On Mar 21, 2017, at 14:07, Dimitry Andric wrote: >>=20 >> Author: dim >> Date: Tue Mar 21 21:07:37 2017 >> New Revision: 315689 >> URL: https://svnweb.freebsd.org/changeset/base/315689 >>=20 >> Log: >> Gcc has incompatible internal declarations for __divtc3 and __multc3 = as >> defined in compiler-rt, but it has no option to silence its warning, = so >> make gcc warnings for libcompiler_rt non-fatal. >>=20 >> Noticed by: lwhsu >> MFC after: 3 days >>=20 >> Modified: >> head/lib/libcompiler_rt/Makefile >=20 > This doesn=E2=80=99t work: >=20 > 11:31:39 > /workspace/src/contrib/compiler-rt/lib/builtins/divtc3.c:21:1: error: = conflicting types for built-in function '__divtc3' [-Werror] >=20 > 11:31:39 > __divtc3(long double __a, long double __b, long double __c, long = double __d) >=20 > 11:31:39 ^~~~~~~~ >=20 > Thanks, > -Ngie Oh wait=E2=80=A6 I forgot that libgcc_s also references these sources = *facepalm*. Thanks, -Ngie --Apple-Mail=_84375612-12A3-433C-91AB-7370A2AD8B6B 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 iQIcBAEBCgAGBQJY2qIpAAoJEPWDqSZpMIYVs68P/0nWdhGqYX1NbhDbkOHp1C9Q MvtGRlXBOShf/r3c25LHJTori41UUUL0cuLo4rvh5jaT3oX7jbeWrHcTaanF7pxv 9xZMG6iUGOsP4MClUWZK1vWZBBJABtWRMm50fwBaWlwb2EUEjYNA+OwCMWPpPbkH 5hPRwxxQAHbaG14PmkJqN/FtnB2JKlPbSnE/jZBR7RjE0vIVVgvoXNA1DkR4TAb0 h4kpxR+eUhpq3NSohzwv3NmpiGykEvtncCUbjFr1LVWEbKqi4+hPdl9zJtl+UgCK Mt9Y7eaXDOA0pQtfgSuAONSo3usaAzQzx0sGwGohf3iP8XpB76UnD57Tqc76eLw+ yF/YS1h/1opuHCmK9m+MoGw5wU3XEoq2IpoT2DuxMTv5d4D8in3iKiVXjgqJJ9MH IgTlXQOCyOplDW8a0ol0PLLYanYFrL9XrmSitF5Ylg2yXmWVplMfVzPGGJuKu0TZ 1sNYJ2T7H30p+xR2JODmkbuRokY3nkaFNcFknNI+ZM/NqJbnlRofAS2K69GVaW3a nFhnbl6+hTjdNyGnVqxLlz0d+Nqn1umIblbl9TBgKCdgqoj1NjEDiF6veLlxIQwm swD7g/NcN5csmzXrz3FM2bqBGYSy1brEw0FZXXvHFaJ75/UJk2T0WOCUd+NkWuK7 uMSOgxJkuC63/pzT2Fbe =woUF -----END PGP SIGNATURE----- --Apple-Mail=_84375612-12A3-433C-91AB-7370A2AD8B6B-- From owner-svn-src-all@freebsd.org Tue Mar 28 18:09:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3182AD221D1; Tue, 28 Mar 2017 18:09:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 013B8D96; Tue, 28 Mar 2017 18:09:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SI92S7011781; Tue, 28 Mar 2017 18:09:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SI92Ck011780; Tue, 28 Mar 2017 18:09:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703281809.v2SI92Ck011780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 28 Mar 2017 18:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316100 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 18:09:03 -0000 Author: imp Date: Tue Mar 28 18:09:01 2017 New Revision: 316100 URL: https://svnweb.freebsd.org/changeset/base/316100 Log: Remove -fno-guess-branch-probability and -fno-unit-at-a-time. bde enabled -fno-guess-branch-probability in 2003, well before our current compiler was imported. At the time it produced weirdly orded code. It no longer does that. It also saves 0-4 bytes depending on other options. kan disabled unit-at-a-time in 2004 because it badly mangled boot2 so it wouldn't work. That too was before the 4.2.1 compiler, where it no longer does that. This saves 44 bytes. I had planned to document why they were needed, but when I discovered their antiquity, I removed them and boot2 still works and is smaller. In qemu, the old and new boot2's behaved identically. These are gcc specific hacks, and won't affect clang-built boot2 at all. Modified: head/sys/boot/i386/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Tue Mar 28 17:37:49 2017 (r316099) +++ head/sys/boot/i386/boot2/Makefile Tue Mar 28 18:09:01 2017 (r316100) @@ -38,8 +38,6 @@ CFLAGS= -fomit-frame-pointer \ -Winline CFLAGS.gcc+= -Os \ - -fno-guess-branch-probability \ - -fno-unit-at-a-time \ --param max-inline-insns-single=100 .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 CFLAGS.gcc+= -mno-align-long-strings From owner-svn-src-all@freebsd.org Tue Mar 28 18:20:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19DF5D2287E; Tue, 28 Mar 2017 18:20:28 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id D6DFC7A7; Tue, 28 Mar 2017 18:20:26 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id A8702273C2; Tue, 28 Mar 2017 18:20:19 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id v2SIKGur069050; Tue, 28 Mar 2017 18:20:16 GMT (envelope-from phk@phk.freebsd.dk) To: rgrimes@freebsd.org, "Rodney W. Grimes" cc: Bruce Evans , Julian Elischer , Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316064 - head/sys/boot/i386/boot2 In-reply-to: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> From: "Poul-Henning Kamp" References: <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <69048.1490725215.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 Mar 2017 18:20:16 +0000 Message-ID: <69049.1490725216@critter.freebsd.dk> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 18:20:28 -0000 -------- In message <201703281555.v2SFtoSU005538@pdx.rh.CN85.dnsmgr.net>, "Rodney W= . Gri mes" writes: >I think we still have an 8k size limit on boot1 for ffs/(ufs1 or ufs2) Having a former release-engineer & disk-I/O renovator on the UFS2 team took care of that: We tried to be future compatible, and UFS2 will look four different places for the superblock: +64k, +8k, +0k and +256k, (the latter named SBLOCK_PIGGY because somebody senior thought even 64k was an outrageous waste of space :-) -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-all@freebsd.org Tue Mar 28 18:42:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15F58D23225; Tue, 28 Mar 2017 18:42:15 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x232.google.com (mail-pg0-x232.google.com [IPv6:2607:f8b0:400e:c05::232]) (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 E0935AA0; Tue, 28 Mar 2017 18:42:14 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x232.google.com with SMTP id 21so80617619pgg.1; Tue, 28 Mar 2017 11:42:14 -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=hldKCwacp2ibs+LKzL/rsxrm3MBcoyMvLb5T/DV8fB8=; b=rVkX22FETzq5HbO+GaGwx3au3+kR9RoHIzPLj+El91gUTUEEDk8kvFJjBf+1uaTmAi rhN8H+8TUM0jy2wqORGBN8ByefkCxko4K+uxJowOStDlFi0PD3qZzMCqJoC/9KSmiPPs DIAH52HFHjsffls5wPKfK0UmCExA0s0IuRJESAp1mvkFWzVP7mTuWiJmQgx1cBGqf4/0 G1vfVAyFILnSFB1w0LQmrFMLt4LZ99igUyGiZk+WL/Xa7ckyw24TH2SUiezr+KuKjxXE 1i4A8IYnMtz1o4kBMTTn7pWazUpPUC9ii6MQPn27kKki+vV5u+LGSusrx5akB6Ag2/gh B4jQ== 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=hldKCwacp2ibs+LKzL/rsxrm3MBcoyMvLb5T/DV8fB8=; b=V4mLru7BA3POGxAJvdvSocvjSko0k8HNYT8SOGURfZeE3ntjYatvZ1OIGfdOcaoU2Z ZB2wMwhOSKGz100mYvZ3uH9O4p6y8wqkVEvWK3BIYHoAiT9Wrgua1LcC757qspC9PcTq 9KnIhDxH36LS9uyFDw0dhbMjyWnS6/6sPNTEEdir18yAaJsSmMKxRwLjjJVU4M0usowe jOmm/fP3TOC/oVYmlvpbx923RMt9gDjqxN/K0TutS22RxynKud9F6z15tjR2nAo4qOEB SJaJ+RPowo+wAV6jFY3QDgBDDr/JqzmOUhDeg+33AntmLmMXM5BrzVTxtOyeclxmo9yy m5KQ== X-Gm-Message-State: AFeK/H1JSqzhUe0hN5/BLvMKE8A9M6nXSZ27in15WKNGNSXVcuUV468YMRJIiikAPCVO1w== X-Received: by 10.99.9.65 with SMTP id 62mr32111934pgj.22.1490726534004; Tue, 28 Mar 2017 11:42:14 -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 d4sm8813268pfb.104.2017.03.28.11.42.12 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Mar 2017 11:42:13 -0700 (PDT) Subject: Re: svn commit: r316100 - head/sys/boot/i386/boot2 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_41DF7CF7-EF47-4737-9BF5-483E7C7D3B7B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201703281809.v2SI92Ck011780@repo.freebsd.org> Date: Tue, 28 Mar 2017 11:42:11 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <6BF9BF65-E700-4176-B405-244D7BA60541@gmail.com> References: <201703281809.v2SI92Ck011780@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 18:42:15 -0000 --Apple-Mail=_41DF7CF7-EF47-4737-9BF5-483E7C7D3B7B Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On Mar 28, 2017, at 11:09, Warner Losh wrote: > > Author: imp > Date: Tue Mar 28 18:09:01 2017 > New Revision: 316100 > URL: https://svnweb.freebsd.org/changeset/base/316100 > > Log: > Remove -fno-guess-branch-probability and -fno-unit-at-a-time. > > bde enabled -fno-guess-branch-probability in 2003, well before our > current compiler was imported. At the time it produced weirdly orded > code. It no longer does that. It also saves 0-4 bytes depending on > other options. > > kan disabled unit-at-a-time in 2004 because it badly mangled boot2 so > it wouldn't work. That too was before the 4.2.1 compiler, where it no > longer does that. This saves 44 bytes. > > I had planned to document why they were needed, but when I discovered > their antiquity, I removed them and boot2 still works and is > smaller. In qemu, the old and new boot2's behaved identically. > > These are gcc specific hacks, and won't affect clang-built boot2 > at all. Nice!!! -Ngie --Apple-Mail=_41DF7CF7-EF47-4737-9BF5-483E7C7D3B7B 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 iQIcBAEBCgAGBQJY2q6EAAoJEPWDqSZpMIYV9KkQAKYgsd2eQevCUnVCphk7iDvP ivz0TAZQhLTuQy1kbVSus+PfWESwRxhW9bTow+Q2EuTtQDfeSHMLb6eaCB0ZAplS 8GSljOnDeUAFGbtXXz3rDzDBwszKNCz3MLSPxmfJw5SeIVU1bLjNjfgi/REzCZ4F YzgfZAsq67ZhNnaWCT7aO9Icb4ifdWCad87x3SA6GCtKrSzDMETXFm29CuULWw07 hLywLB/o1B1QjcW9QyWNR81XlqnlsxhBbk08Y3dgtQjQ2vq6ZRfumwrVGDfjxPsN lLewXwkxSpnq4uyvDdNjB10DZNxnfXOtrmaQt9zTujW5OpSUONvb9+T1vw24lI17 XxLqOmDA9aXVD84N9S335vWB8P344uGrL9pLnW27+gJolk7LY/pB2+uunZLDJw4h EkMc8od3CgIouvkekIYhwXVNhLpcq8nYC+TLuRzOYP0FTZ+CBlbeFnXG8drmmrdw StNBm0VgGo0yqx/Bo+B7e2ecOuPN4daf6f2Qbhmi1ThfvIAXXhZ+oQoyRxW8Iwgq Ui8D8uCgTw0dN1OKuLjn6KL97koK/ijJ6hji5wdsMysrs9OW2J2ymJ0/G5H5FR5e YdEE5MxGsWV93cREFmjqfkE70EhM0pTZdhugeT4Jm/RyOeMzhfbE43RXlEjjGVNJ wxako3sEJb06++9WHUew =xAap -----END PGP SIGNATURE----- --Apple-Mail=_41DF7CF7-EF47-4737-9BF5-483E7C7D3B7B-- From owner-svn-src-all@freebsd.org Tue Mar 28 19:01:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5861D23752; Tue, 28 Mar 2017 19:01: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 82CB3825; Tue, 28 Mar 2017 19:01: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 v2SJ11of033847; Tue, 28 Mar 2017 19:01:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SJ11dZ033846; Tue, 28 Mar 2017 19:01:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703281901.v2SJ11dZ033846@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 19:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316101 - head/lib/libgcc_s X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 19:01:02 -0000 Author: ngie Date: Tue Mar 28 19:01:01 2017 New Revision: 316101 URL: https://svnweb.freebsd.org/changeset/base/316101 Log: Apply r315689 to lib/libgcc_s as well to unbreak the gcc xtoolchain build lib/libgcc_s consumes lib/libcompiler_rt/Makefile*. The NO_WERROR.gcc in lib/libcompiler_rt/Makefile doesn't seem to have made a difference in being able to build this, so sprinkle NO_WERROR.gcc here as well. MFC after: 3 days Reported by: Jenkins (FreeBSD-head-amd64-gcc) Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/lib/libgcc_s/Makefile Modified: head/lib/libgcc_s/Makefile ============================================================================== --- head/lib/libgcc_s/Makefile Tue Mar 28 18:09:01 2017 (r316100) +++ head/lib/libgcc_s/Makefile Tue Mar 28 19:01:01 2017 (r316101) @@ -14,6 +14,10 @@ VERSION_MAP= ${.CURDIR}/Version.map .include "../libcompiler_rt/Makefile.inc" .include "../libgcc_eh/Makefile.inc" +# gcc has incompatible internal declarations for __divtc3 and __multc3, but has +# no option to silence its warning, so make warnings non-fatal. +NO_WERROR.gcc= + LIBCSRCDIR= ${SRCTOP}/lib/libc LIBMSRCDIR= ${SRCTOP}/lib/msun/src CFLAGS+= -I${LIBCSRCDIR}/include -I${LIBCSRCDIR}/${MACHINE_CPUARCH} From owner-svn-src-all@freebsd.org Tue Mar 28 19:02:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C94D238D0; Tue, 28 Mar 2017 19:02:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::242]) (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 73754B71; Tue, 28 Mar 2017 19:02:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id 79so23421737pgf.0; Tue, 28 Mar 2017 12:02:26 -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=//3EWoHsWhT+F6K2yPX24bKHi9OP2GgAyXa2VNIN2pg=; b=DZuS/NypR8v5YtYLxJ+KPWiSElR/rEHtxMgkculnGVQvXxi8apQssuI+VL6snIhzhO /J4c1wtlN9W92fjnKr0lkRY4sphYalZkaAN2zEOQHofXV6ygPJtd7fo+6P29yEVkiB1D /Ju2bsO2ZvG0BOUKuUTOYSDlydBSz8ACG4+jN85rjC37fKCcCc+SYcf5uCfBGN6LZ2a2 yKKaai+ZMZcoXGLdFed54sycbu0/S/mYt/HwTBeOjSuCKtFOXLl8OYTQ6I7Mafa+0IAH y37yKuoltksM1026breC6Z8/0VSr9NX5s7P/9RLdPnIzNgQCU7NOFDBVbiInCXgvPGdP ocug== 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=//3EWoHsWhT+F6K2yPX24bKHi9OP2GgAyXa2VNIN2pg=; b=Dgw49m9atu5XDkFe0cZiiM6GVQ+iMztulAVAGyfaoGlbtevOdV5htvfDuyaOg5xhFw unfzBwzyFtW6KfUhKV9ljke2Ki/LEaveD6XG70ncSnnCoyBGPfoLEdVgpbpAyGFbiYTb ptQcCipqQJhO54N3BEBco9GecR0dI4RIsVrFumBJDjNknrb5+N9BdNy43/QZJOBhQykz Susxlw3jbj4KII1YsOV1WCxDJ5rYQQDN0rf7gAgiLzgdvIpqRNseQTv0ov9JrO34XEJD 7JGnTr4rD4KeCxQzReTdy0BykMWx9EEE0nuLXLEFNr/joWSDFbFVGEwmKCCrdHL4uDH2 zrMA== X-Gm-Message-State: AFeK/H1qPX1myYJi9jRdZu7OvIpRxwzufoQu19kKDdV+PzA8vNYV3xrE68J7RvC0PV3fUA== X-Received: by 10.84.218.203 with SMTP id g11mr37493767plm.6.1490727745829; Tue, 28 Mar 2017 12:02: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 j19sm8962438pfk.4.2017.03.28.12.02.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Mar 2017 12:02:25 -0700 (PDT) Subject: Re: svn commit: r315689 - head/lib/libcompiler_rt Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_BC94893C-9587-4CDD-8F27-A2E66AE5203E"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 28 Mar 2017 12:02:23 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201703212107.v2LL7bYE020476@repo.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 19:02:26 -0000 --Apple-Mail=_BC94893C-9587-4CDD-8F27-A2E66AE5203E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 28, 2017, at 10:49, Ngie Cooper (yaneurabeya) = wrote: =E2=80=A6 > Oh wait=E2=80=A6 I forgot that libgcc_s also references these sources = *facepalm*. Addressed in r316101 (inspired by your change). Thanks! -Ngie --Apple-Mail=_BC94893C-9587-4CDD-8F27-A2E66AE5203E 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 iQIcBAEBCgAGBQJY2rNAAAoJEPWDqSZpMIYVQw4QAKY02WKUWIVzXTcb127aRAXj NelHsCATJX0+LaLdYERcmqE1th58NFfhrkLI+geTHncFKw88ag/N6jBftsJ3BjbW viDATeZF5soRhAMXKjQaDrVxAmmmD1D6Wfbh2Bqb90LUyJLUdBf8ETqHloINfPtE K9lHhOz5punyGR3e2CSo3yawh1DRR146m4kSvWl3UEMINqfIYD4IqknWheuEOK8T ma1SKPMdmN1ZSF/COdFQLGEjLGZQrKpvClVRGCzQstpcd6YmaNn4i5s7ec4goEri xkfEuR7PedGp4RDWylL0r5KfbzjqBiQta7DwI2EgzXZMNpOw84UxVI9f8VksstR0 b+CNqRA/su7f4NXvMRTga4gFcMqFuWCMka0NHW3LmfoTBcXU8ldWw1HOMrzBNh2F GlpUOC5L6o0E9DFyEq3aOWzpXE0Zchg+ZEgZVRK+e8cAZxL8jmuweUX0NkFXVYXF 6+GRndEEBEdCRIhL29+i37kEjy8ssxJ55Gbs/EQ+nMfZdTfUjKbmH6ysetOZF0jO MMoPcdObPWTDEZPpaMSDDO4kxuEz0N2W79bBJxR5tZ4cpAd11ocAhDcXJ62JTF1f l/lD8x4EpV8U1FNHN121o5jRJ90oA7pDk1LEteLlYENp7cuXgRxkYUya4BJ8pxlQ 1QnuXpcsc956z6QD6Kaq =2swS -----END PGP SIGNATURE----- --Apple-Mail=_BC94893C-9587-4CDD-8F27-A2E66AE5203E-- From owner-svn-src-all@freebsd.org Tue Mar 28 19:48:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BEEFD2101C; Tue, 28 Mar 2017 19:48:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:470:7a58:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66BCF39C; Tue, 28 Mar 2017 19:48:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::6904:bca:d10e:b83c] (unknown [IPv6:2001:470:7a58:0:6904:bca:d10e:b83c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 5CAB91FA45; Tue, 28 Mar 2017 21:48:21 +0200 (CEST) From: Dimitry Andric Message-Id: <4578F3A1-1781-4ACB-9680-E7405E51FC64@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_99AEBCA0-1F67-4B77-9B77-C518FCAC345B"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r315689 - head/lib/libcompiler_rt Date: Tue, 28 Mar 2017 21:48:14 +0200 In-Reply-To: Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Li-Wen Hsu To: "Ngie Cooper (yaneurabeya)" References: <201703212107.v2LL7bYE020476@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 19:48:23 -0000 --Apple-Mail=_99AEBCA0-1F67-4B77-9B77-C518FCAC345B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 28 Mar 2017, at 21:02, Ngie Cooper (yaneurabeya) = wrote: >=20 >> On Mar 28, 2017, at 10:49, Ngie Cooper (yaneurabeya) = wrote: > =E2=80=A6 >> Oh wait=E2=80=A6 I forgot that libgcc_s also references these sources = *facepalm*. Aha! That explains why Li-Wen still saw -Werror warnings on the Jenkins bot. They just happened in libgcc_s, not in libcompiler_rt. > Addressed in r316101 (inspired by your change). Thanks. It would be nice if there was some sort of pragma to shut up gcc in this particular case, then I could also submit it upstream... :) -Dimitry --Apple-Mail=_99AEBCA0-1F67-4B77-9B77-C518FCAC345B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAljavgQACgkQsF6jCi4glqMbugCg01qL4ul38xs9HITDXmCuzD4F Op0An1USs/sC5lPg9RZHq+oB75gmxYyZ =dhnG -----END PGP SIGNATURE----- --Apple-Mail=_99AEBCA0-1F67-4B77-9B77-C518FCAC345B-- From owner-svn-src-all@freebsd.org Tue Mar 28 20:22:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B38EED21DFC; Tue, 28 Mar 2017 20:22: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 833F8D26; Tue, 28 Mar 2017 20:22: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 v2SKMi0M069586; Tue, 28 Mar 2017 20:22:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SKMiA3069585; Tue, 28 Mar 2017 20:22:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282022.v2SKMiA3069585@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 20:22:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316102 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 20:22:45 -0000 Author: ngie Date: Tue Mar 28 20:22:44 2017 New Revision: 316102 URL: https://svnweb.freebsd.org/changeset/base/316102 Log: Wrap bootcamp DEBUG statement with curly braces This fixes a -Wempty-body warning with gcc 6.3.0 when PART_DEBUG is undefined. MFC after: 3 days Reported by: Jenkins (FreeBSD-head-amd64-gcc job) Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Tue Mar 28 19:01:01 2017 (r316101) +++ head/sys/boot/common/part.c Tue Mar 28 20:22:44 2017 (r316102) @@ -684,8 +684,9 @@ ptable_open(void *dev, uint64_t sectors, if (dp[1].dp_typ != DOSPTYP_HFS) { table->type = PTABLE_NONE; DEBUG("Incorrect PMBR, ignore it"); - } else + } else { DEBUG("Bootcamp detected"); + } } #ifdef LOADER_GPT_SUPPORT if (table->type == PTABLE_GPT) { From owner-svn-src-all@freebsd.org Tue Mar 28 20:26:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23A77D22022; Tue, 28 Mar 2017 20:26:06 +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 E748729; Tue, 28 Mar 2017 20:26:05 +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 v2SKQ5jD069774; Tue, 28 Mar 2017 20:26:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SKQ4r7069772; Tue, 28 Mar 2017 20:26:04 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282026.v2SKQ4r7069772@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 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316103 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 20:26:06 -0000 Author: ngie Date: Tue Mar 28 20:26:04 2017 New Revision: 316103 URL: https://svnweb.freebsd.org/changeset/base/316103 Log: Remove redundant declarations They're already defined in libstand.h MFC after: 1 week Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/boot1/boot_module.h Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Tue Mar 28 20:22:44 2017 (r316102) +++ head/sys/boot/efi/boot1/boot1.c Tue Mar 28 20:26:04 2017 (r316103) @@ -47,7 +47,6 @@ static const boot_module_t *boot_modules /* The initial number of handles used to query EFI for partitions. */ #define NUM_HANDLES_INIT 24 -void putchar(int c); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); EFI_SYSTEM_TABLE *systab; Modified: head/sys/boot/efi/boot1/boot_module.h ============================================================================== --- head/sys/boot/efi/boot1/boot_module.h Tue Mar 28 20:22:44 2017 (r316102) +++ head/sys/boot/efi/boot1/boot_module.h Tue Mar 28 20:26:04 2017 (r316103) @@ -105,8 +105,6 @@ extern const boot_module_t zfs_module; /* Functions available to modules. */ extern void add_device(dev_info_t **devinfop, dev_info_t *devinfo); -extern void panic(const char *fmt, ...) __dead2; -extern int printf(const char *fmt, ...); extern int vsnprintf(char *str, size_t sz, const char *fmt, va_list ap); extern EFI_SYSTEM_TABLE *systab; From owner-svn-src-all@freebsd.org Tue Mar 28 20:30:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9EBD22218; Tue, 28 Mar 2017 20:30: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 2A3AE2EB; Tue, 28 Mar 2017 20:30: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 v2SKUXG4070081; Tue, 28 Mar 2017 20:30:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SKUX0b070080; Tue, 28 Mar 2017 20:30:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282030.v2SKUX0b070080@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 20:30:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316104 - head/sys/boot/i386/gptzfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 20:30:34 -0000 Author: ngie Date: Tue Mar 28 20:30:33 2017 New Revision: 316104 URL: https://svnweb.freebsd.org/changeset/base/316104 Log: Use `NO_WCAST_ALIGN` instead of spelling it out as -Wno-cast-align in CFLAGS MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/boot/i386/gptzfsboot/Makefile Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Tue Mar 28 20:26:04 2017 (r316103) +++ head/sys/boot/i386/gptzfsboot/Makefile Tue Mar 28 20:30:33 2017 (r316104) @@ -33,11 +33,13 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ + -Wall -Waggregate-return -Wbad-function-cast \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline -Wno-pointer-sign +NO_WCAST_ALIGN= + .if ${COMPILER_TYPE} == "clang" || \ (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201) CFLAGS+= -Wno-tentative-definition-incomplete-type From owner-svn-src-all@freebsd.org Tue Mar 28 20:34:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5670D2258A; Tue, 28 Mar 2017 20:34: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 A273F9A8; Tue, 28 Mar 2017 20:34: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 v2SKY2aO073899; Tue, 28 Mar 2017 20:34:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SKY2Sb073898; Tue, 28 Mar 2017 20:34:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282034.v2SKY2Sb073898@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 20:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316105 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 20:34:03 -0000 Author: ngie Date: Tue Mar 28 20:34:02 2017 New Revision: 316105 URL: https://svnweb.freebsd.org/changeset/base/316105 Log: Don't use K&R style prototypes; ANSIfy them This fixes several -Wold-style-definition warnings. X-MFC with: 313191 Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sbin/nvmecontrol/wdc.c Modified: head/sbin/nvmecontrol/wdc.c ============================================================================== --- head/sbin/nvmecontrol/wdc.c Tue Mar 28 20:30:33 2017 (r316104) +++ head/sbin/nvmecontrol/wdc.c Tue Mar 28 20:34:02 2017 (r316105) @@ -178,7 +178,7 @@ wdc_do_clear_dump(int fd, uint32_t opcod } static void -wdc_cap_diag_usage() +wdc_cap_diag_usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, WDC_CAP_DIAG_USAGE); @@ -215,7 +215,7 @@ wdc_cap_diag(int argc, char *argv[]) } static void -wdc_drive_log_usage() +wdc_drive_log_usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, WDC_DRIVE_LOG_USAGE); @@ -252,7 +252,7 @@ wdc_drive_log(int argc, char *argv[]) } static void -wdc_get_crash_dump_usage() +wdc_get_crash_dump_usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, WDC_CAP_DIAG_USAGE); From owner-svn-src-all@freebsd.org Tue Mar 28 20:39:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 791D7D22781; Tue, 28 Mar 2017 20:39:25 +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 2F05AEA2; Tue, 28 Mar 2017 20:39:25 +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 v2SKdObP074150; Tue, 28 Mar 2017 20:39:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SKdONV074149; Tue, 28 Mar 2017 20:39:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282039.v2SKdONV074149@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 20:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316106 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 20:39:25 -0000 Author: ngie Date: Tue Mar 28 20:39:24 2017 New Revision: 316106 URL: https://svnweb.freebsd.org/changeset/base/316106 Log: 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. MFC after: 3 days Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Tue Mar 28 20:34:02 2017 (r316105) +++ head/sys/boot/zfs/zfsimpl.c Tue Mar 28 20:39:24 2017 (r316106) @@ -494,7 +494,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; @@ -503,7 +503,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); @@ -907,7 +907,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; @@ -932,7 +932,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); @@ -1060,7 +1060,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-all@freebsd.org Tue Mar 28 20:53:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D95EBD22D78; Tue, 28 Mar 2017 20:53:00 +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 A689CCA5; Tue, 28 Mar 2017 20:53:00 +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 v2SKqxin083146; Tue, 28 Mar 2017 20:52:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SKqxl7083145; Tue, 28 Mar 2017 20:52:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282052.v2SKqxl7083145@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 20:52:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316107 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 20:53:01 -0000 Author: ngie Date: Tue Mar 28 20:52:59 2017 New Revision: 316107 URL: https://svnweb.freebsd.org/changeset/base/316107 Log: 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. MFC after: 3 days Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Tue Mar 28 20:39:24 2017 (r316106) +++ head/sys/boot/zfs/zfsimpl.c Tue Mar 28 20:52:59 2017 (r316107) @@ -68,7 +68,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-all@freebsd.org Tue Mar 28 21:11:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9432D232D3; Tue, 28 Mar 2017 21:11:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67813CAD; Tue, 28 Mar 2017 21:11:12 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4D20310A7B9; Tue, 28 Mar 2017 17:11:05 -0400 (EDT) From: John Baldwin To: mmel@freebsd.org Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r315974 - in head: lib/libthread_db/arch/arm sys/arm/arm sys/arm/include Date: Tue, 28 Mar 2017 11:26:43 -0700 Message-ID: <22618548.zXcKfQPOV0@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <74bb4fb0-b5d5-4be4-bcfe-4be343c2aee7@freebsd.org> References: <201703260836.v2Q8auoU069005@repo.freebsd.org> <74bb4fb0-b5d5-4be4-bcfe-4be343c2aee7@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 28 Mar 2017 17:11:05 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:11:13 -0000 On Tuesday, March 28, 2017 12:20:04 PM Michal Meloun wrote: > > On 27.03.2017 19:40, Warner Losh wrote: > > On Mon, Mar 27, 2017 at 11:07 AM, John Baldwin wrote: > >> On Sunday, March 26, 2017 08:36:56 AM Michal Meloun wrote: > >>> Author: mmel > >>> Date: Sun Mar 26 08:36:56 2017 > >>> New Revision: 315974 > >>> URL: https://svnweb.freebsd.org/changeset/base/315974 > >>> > >>> Log: > >>> Preserve VFP state across signal delivery. > >>> > >>> We don't have enouch space to store full VFP context within mcontext > >>> stucture. Due to this: > >>> - follow i386/amd64 way and store VFP state outside of the mcontext_t > >>> but point to it. Use the size of VFP state structure as an 'magic' > >>> indicator of the saved VFP state presence. > >>> - teach set_mcontext() about this external storage. > >>> - for signal delivery, store VFP state to expanded 'struct sigframe'. > >>> > >>> Submited by: Andrew Gierth (initial version) > >>> PR: 217611 > >>> MFC after: 2 weeks > >>> > >>> Modified: > >>> head/lib/libthread_db/arch/arm/libpthread_md.c > >>> head/sys/arm/arm/machdep.c > >>> head/sys/arm/include/frame.h > >>> head/sys/arm/include/ucontext.h > >>> > >>> Modified: head/lib/libthread_db/arch/arm/libpthread_md.c > >>> ============================================================================== > >>> --- head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:20 2017 (r315973) > >>> +++ head/lib/libthread_db/arch/arm/libpthread_md.c Sun Mar 26 08:36:56 2017 (r315974) > >>> @@ -90,7 +90,9 @@ pt_fpreg_to_ucontext(const struct fpreg > >>> mcontext_t *mc = &uc->uc_mcontext; > >>> > >>> /* XXX */ > >>> - memset(&mc->mc_spare, 0, sizeof(mc->mc_spare)); > >>> + mc->mc_vfp_size = 0; > >>> + mc->mc_vfp_ptr = NULL; > >>> + memset(mc->mc_spare, 0, sizeof(mc->mc_spare)); > >>> } > >> I suspect you don't need this bit? Has FreeBSD/arm ever supported VFP on a release > >> that also shipped libkse? (i.e. not libthr but the other thread library) > > No. And even if we had, we blew up binary compat when we went from OABI to EABI. > > > > Warner > I just wanted to maintain the status quo, nothing more. > > All I know is that none of threading libraries maintains VFP state, > 'struct fpreg' is badly defined (is to short for fill VFP context), and > pre r315974 kernel doesn't initialize _vfp (renamed to mc_spare) part > of mcontext_t. > > So I'm seeking a way how to fix all this. But I'm not familiar with > kse -> pthread transition history, so I'm not sure which parts are > actively used. The libpthread_md.c files are for the KSE-based libpthread and generally don't need changing at this point as they are only there to allow old gdb binaries to debug old binaries using libpthread. In particular, with the KSE thread library, a "paused" user thread that wasn't associated with a kernel thread ("LWP") needed it's userland register state saved somewhere until it resumed execution. The libpthread bits are for extracting that saved register state so a debugger can examine a non-running user thread. Modern gdb in ports doesn't use libthread_db at all, and I think lldb might not use it either. (Both just assume that every pthread has an associated LWP and use ptrace() to query information about LWPs directly). Note that on x86 we haven't updated any of the libthread_db stuff to handle newer vector register extensions like AVX. That only works via direct ptrace() for example. It will be good to include VFP info in cores via new core notes (if not done already) and to provide a way to fetch the register banks from a running thread via ptrace, but you can generally ignore libthread_db. At some point gdb in ports might use some small bits of libthread_db to determine the pthread_t associated with a kernel-enumerated LWP, but that's about all it would ever be used for at this point. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Mar 28 21:16:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E89AED2340E; Tue, 28 Mar 2017 21:16: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 B5C6FF1; Tue, 28 Mar 2017 21:16: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 v2SLGBVU091261; Tue, 28 Mar 2017 21:16:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLGBna091260; Tue, 28 Mar 2017 21:16:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282116.v2SLGBna091260@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 21:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316108 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:16:13 -0000 Author: ngie Date: Tue Mar 28 21:16:11 2017 New Revision: 316108 URL: https://svnweb.freebsd.org/changeset/base/316108 Log: Remove -Wunused-but-set variable, `tail` in `ls_getdir(..)` This variable has been unused since its inception in r40106. MFC after: 3 days Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/common/ls.c Modified: head/sys/boot/common/ls.c ============================================================================== --- head/sys/boot/common/ls.c Tue Mar 28 20:52:59 2017 (r316107) +++ head/sys/boot/common/ls.c Tue Mar 28 21:16:11 2017 (r316108) @@ -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-all@freebsd.org Tue Mar 28 21:35:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8C9BD23943; Tue, 28 Mar 2017 21:35: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 7310512D; Tue, 28 Mar 2017 21:35: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 v2SLZJg6099657; Tue, 28 Mar 2017 21:35:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLZJX1099653; Tue, 28 Mar 2017 21:35:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282135.v2SLZJX1099653@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 21:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316109 - in head/sys/boot: efi/boot1 i386/boot2 i386/zfsboot sparc64/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:35:20 -0000 Author: ngie Date: Tue Mar 28 21:35:18 2017 New Revision: 316109 URL: https://svnweb.freebsd.org/changeset/base/316109 Log: Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead This is a better pattern to follow when creating the bootloaders and doing the relevant space checks to make sure that the sizes aren't exceeded (and thus, copy-pasting is a bit less error prone). MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/efi/boot1/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -114,7 +114,7 @@ boot1.o: ${.CURDIR}/../../common/ufsread BOOT1_MAXSIZE?= 131072 boot1.efifat: boot1.efi - @set -- `ls -l boot1.efi`; \ + @set -- `ls -l ${.ALLSRC}`; \ x=$$(($$5-${BOOT1_MAXSIZE})); \ if [ $$x -ge 0 ]; then \ echo "boot1 $$x bytes too large; regenerate FAT templates?" >&2 ;\ @@ -124,7 +124,7 @@ boot1.efifat: boot1.efi uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - ${DD} if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES= boot1.efi boot1.efifat Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/i386/boot2/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -67,9 +67,9 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2.h sio.o boot2: boot2.ld - @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/i386/zfsboot/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -68,9 +68,9 @@ CLEANFILES+= zfsboot2 zfsboot.ld zfsboot BOOT2SIZE= 131072 zfsboot2: zfsboot.ld - @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/sparc64/boot1/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -17,10 +17,10 @@ LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. ${FILES}: boot1.aout - @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 ${DD} if=/dev/zero of=${.TARGET} bs=512 count=16 - ${DD} if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc + ${DD} if=${.ALLSRC} of=${.TARGET} bs=512 oseek=1 conv=notrunc boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} From owner-svn-src-all@freebsd.org Tue Mar 28 21:39:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 338B2D239B8; Tue, 28 Mar 2017 21:39: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 EC8C62F0; Tue, 28 Mar 2017 21:39:25 +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 v2SLdPA3099848; Tue, 28 Mar 2017 21:39:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLdPtn099847; Tue, 28 Mar 2017 21:39:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282139.v2SLdPtn099847@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 21:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316110 - head/sys/boot/efi/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:39:26 -0000 Author: ngie Date: Tue Mar 28 21:39:24 2017 New Revision: 316110 URL: https://svnweb.freebsd.org/changeset/base/316110 Log: Use `-Wno-missing-declarations` with CWARNFLAGS for skein.c `-Wno-missing-variable-declarations` is a clang-specific flag, so gcc (not 4.2.1, in particular 6.3.0 in my case) dies when it's passed the flag. X-MFC with: r304321 Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/efi/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Mar 28 21:35:18 2017 (r316109) +++ head/sys/boot/efi/boot1/Makefile Tue Mar 28 21:39:24 2017 (r316110) @@ -20,7 +20,11 @@ CWARNFLAGS.zfs_module.c += -Wno-sign-com CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function CWARNFLAGS.skein.c += -Wno-cast-align +.if ${COMPILER_TYPE} == "clang" CWARNFLAGS.skein.c += -Wno-missing-variable-declarations +.else if ${COMPILER_TYPE} == "gcc" +CWARNFLAGS.skein.c += -Wno-missing-declarations +.endif .endif # architecture-specific loader code From owner-svn-src-all@freebsd.org Tue Mar 28 21:47:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7ECAD23DD8; Tue, 28 Mar 2017 21:47:13 +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 94EA8C2C; Tue, 28 Mar 2017 21:47:13 +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 v2SLlCAQ003883; Tue, 28 Mar 2017 21:47:12 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLlClt003881; Tue, 28 Mar 2017 21:47:12 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201703282147.v2SLlClt003881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 28 Mar 2017 21:47:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316111 - head/sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:47:13 -0000 Author: tsoome Date: Tue Mar 28 21:47:12 2017 New Revision: 316111 URL: https://svnweb.freebsd.org/changeset/base/316111 Log: loader: move bios getsecs into time.c Move the time related function into time.c, keep the same logic as libefi. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D10058 Modified: head/sys/boot/i386/libi386/pxe.c head/sys/boot/i386/libi386/time.c Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Tue Mar 28 21:39:24 2017 (r316110) +++ head/sys/boot/i386/libi386/pxe.c Tue Mar 28 21:47:12 2017 (r316111) @@ -621,13 +621,6 @@ bangpxe_call(int func) v86.ctl = V86_FLAGS; } -time_t -getsecs(void) -{ - time_t n = 0; - time(&n); - return n; -} static int pxe_netif_match(struct netif *nif, void *machdep_hint) Modified: head/sys/boot/i386/libi386/time.c ============================================================================== --- head/sys/boot/i386/libi386/time.c Tue Mar 28 21:39:24 2017 (r316110) +++ head/sys/boot/i386/libi386/time.c Tue Mar 28 21:47:12 2017 (r316111) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "libi386.h" +time_t getsecs(void); static int bios_seconds(void); /* @@ -91,6 +92,14 @@ time(time_t *t) return(now); } +time_t +getsecs(void) +{ + time_t n = 0; + time(&n); + return n; +} + /* * Use the BIOS Wait function to pause for (period) microseconds. * From owner-svn-src-all@freebsd.org Tue Mar 28 21:50:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EF6D23FCE; Tue, 28 Mar 2017 21:50:12 +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 CD9ACF06; Tue, 28 Mar 2017 21:50:12 +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 v2SLoBhc004096; Tue, 28 Mar 2017 21:50:11 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLoBCb004095; Tue, 28 Mar 2017 21:50:11 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201703282150.v2SLoBCb004095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 28 Mar 2017 21:50:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316112 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:50:13 -0000 Author: tsoome Date: Tue Mar 28 21:50:11 2017 New Revision: 316112 URL: https://svnweb.freebsd.org/changeset/base/316112 Log: loader: ls command should display file types properly With some file system the ls is unable to display file types. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D10066 Modified: head/sys/boot/common/ls.c Modified: head/sys/boot/common/ls.c ============================================================================== --- head/sys/boot/common/ls.c Tue Mar 28 21:47:12 2017 (r316111) +++ head/sys/boot/common/ls.c Tue Mar 28 21:50:11 2017 (r316112) @@ -60,26 +60,26 @@ command_ls(int argc, char *argv[]) { int fd; struct stat sb; - struct dirent *d; + struct dirent *d; char *buf, *path; char lbuf[128]; /* one line */ int result, ch; int verbose; - + result = CMD_OK; fd = -1; verbose = 0; optind = 1; optreset = 1; while ((ch = getopt(argc, argv, "l")) != -1) { - switch(ch) { + switch (ch) { case 'l': verbose = 1; break; case '?': default: /* getopt has already reported an error */ - return(CMD_OK); + return (CMD_OK); } } argv += (optind - 1); @@ -91,6 +91,18 @@ command_ls(int argc, char *argv[]) path = argv[1]; } + if (stat(path, &sb) == 0 && !S_ISDIR(sb.st_mode)) { + if (verbose) { + printf(" %c %8d %s\n", + typestr[sb.st_mode >> 12], + (int)sb.st_size, path); + } else { + printf(" %c %s\n", + typestr[sb.st_mode >> 12], path); + } + return (CMD_OK); + } + fd = ls_getdir(&path); if (fd == -1) { result = CMD_ERROR; @@ -102,19 +114,28 @@ command_ls(int argc, char *argv[]) while ((d = readdirfd(fd)) != NULL) { if (strcmp(d->d_name, ".") && strcmp(d->d_name, "..")) { - if (verbose) { + if (d->d_type == 0 || verbose) { /* stat the file, if possible */ sb.st_size = 0; + sb.st_mode = 0; buf = malloc(strlen(path) + strlen(d->d_name) + 2); - sprintf(buf, "%s/%s", path, d->d_name); - /* ignore return, could be symlink, etc. */ - if (stat(buf, &sb)) - sb.st_size = 0; - free(buf); - sprintf(lbuf, " %c %8d %s\n", typestr[d->d_type], + if (buf != NULL) { + sprintf(buf, "%s/%s", path, d->d_name); + /* ignore return, could be symlink, etc. */ + if (stat(buf, &sb)) { + sb.st_size = 0; + sb.st_mode = 0; + } + free(buf); + } + } + if (verbose) { + snprintf(lbuf, sizeof(lbuf), " %c %8d %s\n", + typestr[d->d_type? d->d_type:sb.st_mode >> 12], (int)sb.st_size, d->d_name); } else { - sprintf(lbuf, " %c %s\n", typestr[d->d_type], d->d_name); + snprintf(lbuf, sizeof(lbuf), " %c %s\n", + typestr[d->d_type? d->d_type:sb.st_mode >> 12], d->d_name); } if (pager_output(lbuf)) goto out; @@ -124,9 +145,8 @@ command_ls(int argc, char *argv[]) pager_close(); if (fd != -1) close(fd); - if (path != NULL) - free(path); - return(result); + free(path); /* ls_getdir() did allocate path */ + return (result); } /* @@ -145,6 +165,11 @@ ls_getdir(char **pathp) /* one extra byte for a possible trailing slash required */ path = malloc(strlen(*pathp) + 2); + if (path == NULL) { + snprintf(command_errbuf, sizeof (command_errbuf), + "out of memory"); + goto out; + } strcpy(path, *pathp); /* Make sure the path is respectable to begin with */ @@ -153,7 +178,7 @@ ls_getdir(char **pathp) "bad path '%s'", path); goto out; } - + /* If there's no path on the device, assume '/' */ if (*cp == 0) strcat(path, "/"); @@ -176,12 +201,12 @@ ls_getdir(char **pathp) } *pathp = path; - return(fd); + return (fd); out: free(path); *pathp = NULL; if (fd != -1) close(fd); - return(-1); + return (-1); } From owner-svn-src-all@freebsd.org Tue Mar 28 21:54:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE68ED2324A; Tue, 28 Mar 2017 21:54:37 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE07669E; Tue, 28 Mar 2017 21:54:37 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SLsa4C007842; Tue, 28 Mar 2017 21:54:36 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLsaFj007841; Tue, 28 Mar 2017 21:54:36 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201703282154.v2SLsaFj007841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Tue, 28 Mar 2017 21:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316113 - head/sys/dev/ichsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:54:38 -0000 Author: gavin Date: Tue Mar 28 21:54:36 2017 New Revision: 316113 URL: https://svnweb.freebsd.org/changeset/base/316113 Log: Remove #define PCIS_SERIALBUS_SMBUS_PROGIF, unused since r200091 Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Tue Mar 28 21:50:11 2017 (r316112) +++ head/sys/dev/ichsmb/ichsmb_pci.c Tue Mar 28 21:54:36 2017 (r316113) @@ -95,8 +95,6 @@ __FBSDID("$FreeBSD$"); #define ID_SRPT 0xa1238086 #define ID_SRPTLP 0x9d238086 -#define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 - /* Internal functions */ static int ichsmb_pci_probe(device_t dev); static int ichsmb_pci_attach(device_t dev); From owner-svn-src-all@freebsd.org Tue Mar 28 22:31:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 638AED239E4; Tue, 28 Mar 2017 22:31:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E619A9C; Tue, 28 Mar 2017 22:31:49 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SMVmML023869; Tue, 28 Mar 2017 22:31:48 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SMVmO4023868; Tue, 28 Mar 2017 22:31:48 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703282231.v2SMVmO4023868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 28 Mar 2017 22:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316114 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 22:31:49 -0000 Author: avos Date: Tue Mar 28 22:31:48 2017 New Revision: 316114 URL: https://svnweb.freebsd.org/changeset/base/316114 Log: iwn: drop duplicate synchronization requests. Rx descriptor / payload is already synchronized in iwn_notif_intr() (before accessing desc->type / desc->qid fields). Tested with Intel 6205, STA mode. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Mar 28 21:54:36 2017 (r316113) +++ head/sys/dev/iwn/if_iwn.c Tue Mar 28 22:31:48 2017 (r316114) @@ -196,16 +196,13 @@ static void iwn_newassoc(struct ieee8021 static int iwn_media_change(struct ifnet *); static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwn_calib_timeout(void *); -static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, - struct iwn_rx_data *); +static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *); static void iwn_rx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); -static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *, - struct iwn_rx_data *); +static void iwn_rx_compressed_ba(struct iwn_softc *, struct iwn_rx_desc *); static void iwn5000_rx_calib_results(struct iwn_softc *, - struct iwn_rx_desc *, struct iwn_rx_data *); -static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *, - struct iwn_rx_data *); + struct iwn_rx_desc *); +static void iwn_rx_statistics(struct iwn_softc *, struct iwn_rx_desc *); static void iwn4965_tx_done(struct iwn_softc *, struct iwn_rx_desc *, struct iwn_rx_data *); static void iwn5000_tx_done(struct iwn_softc *, struct iwn_rx_desc *, @@ -2975,13 +2972,11 @@ iwn_calib_timeout(void *arg) * followed by an MPDU_RX_DONE notification. */ static void -iwn_rx_phy(struct iwn_softc *sc, struct iwn_rx_desc *desc, - struct iwn_rx_data *data) +iwn_rx_phy(struct iwn_softc *sc, struct iwn_rx_desc *desc) { struct iwn_rx_stat *stat = (struct iwn_rx_stat *)(desc + 1); DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: received PHY stats\n", __func__); - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); /* Save RX statistics, they will be used on MPDU_RX_DONE. */ memcpy(&sc->last_rx_stat, stat, sizeof (*stat)); @@ -3021,8 +3016,6 @@ iwn_rx_done(struct iwn_softc *sc, struct } else stat = (struct iwn_rx_stat *)(desc + 1); - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - if (stat->cfg_phy_len > IWN_STAT_MAXLEN) { device_printf(sc->sc_dev, "%s: invalid RX statistic header, len %d\n", __func__, @@ -3176,8 +3169,7 @@ iwn_rx_done(struct iwn_softc *sc, struct /* Process an incoming Compressed BlockAck. */ static void -iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc, - struct iwn_rx_data *data) +iwn_rx_compressed_ba(struct iwn_softc *sc, struct iwn_rx_desc *desc) { struct ieee80211_ratectl_tx_status *txs = &sc->sc_txs; struct iwn_ops *ops = &sc->ops; @@ -3196,8 +3188,6 @@ iwn_rx_compressed_ba(struct iwn_softc *s DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", __func__); - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - qid = le16toh(ba->qid); txq = &sc->txq[ba->qid]; tap = sc->qid2tap[ba->qid]; @@ -3282,8 +3272,7 @@ iwn_rx_compressed_ba(struct iwn_softc *s * firmware on response to a CMD_CALIB_CONFIG command (5000 only). */ static void -iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc, - struct iwn_rx_data *data) +iwn5000_rx_calib_results(struct iwn_softc *sc, struct iwn_rx_desc *desc) { struct iwn_phy_calib *calib = (struct iwn_phy_calib *)(desc + 1); int len, idx = -1; @@ -3297,7 +3286,6 @@ iwn5000_rx_calib_results(struct iwn_soft return; } len = (le32toh(desc->len) & 0x3fff) - 4; - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); switch (calib->code) { case IWN5000_PHY_CALIB_DC: @@ -3406,8 +3394,7 @@ iwn_stats_update(struct iwn_softc *sc, s * The latter is sent by the firmware after each received beacon. */ static void -iwn_rx_statistics(struct iwn_softc *sc, struct iwn_rx_desc *desc, - struct iwn_rx_data *data) +iwn_rx_statistics(struct iwn_softc *sc, struct iwn_rx_desc *desc) { struct iwn_ops *ops = &sc->ops; struct ieee80211com *ic = &sc->sc_ic; @@ -3427,8 +3414,6 @@ iwn_rx_statistics(struct iwn_softc *sc, return; } - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - DPRINTF(sc, IWN_DEBUG_CALIBRATE | IWN_DEBUG_STATS, "%s: received statistics, cmd %d, len %d\n", __func__, desc->type, le16toh(desc->len)); @@ -3857,7 +3842,7 @@ iwn_notif_intr(struct iwn_softc *sc) switch (desc->type) { case IWN_RX_PHY: - iwn_rx_phy(sc, desc, data); + iwn_rx_phy(sc, desc); break; case IWN_RX_DONE: /* 4965AGN only. */ @@ -3868,7 +3853,7 @@ iwn_notif_intr(struct iwn_softc *sc) case IWN_RX_COMPRESSED_BA: /* A Compressed BlockAck has been received. */ - iwn_rx_compressed_ba(sc, desc, data); + iwn_rx_compressed_ba(sc, desc); break; case IWN_TX_DONE: @@ -3878,7 +3863,7 @@ iwn_notif_intr(struct iwn_softc *sc) case IWN_RX_STATISTICS: case IWN_BEACON_STATISTICS: - iwn_rx_statistics(sc, desc, data); + iwn_rx_statistics(sc, desc); break; case IWN_BEACON_MISSED: @@ -3887,8 +3872,6 @@ iwn_notif_intr(struct iwn_softc *sc) (struct iwn_beacon_missed *)(desc + 1); int misses; - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); misses = le32toh(miss->consecutive); DPRINTF(sc, IWN_DEBUG_STATE, @@ -3916,8 +3899,6 @@ iwn_notif_intr(struct iwn_softc *sc) (struct iwn_ucode_info *)(desc + 1); /* The microcontroller is ready. */ - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); DPRINTF(sc, IWN_DEBUG_RESET, "microcode alive notification version=%d.%d " "subtype=%x alive=%x\n", uc->major, uc->minor, @@ -3944,9 +3925,6 @@ iwn_notif_intr(struct iwn_softc *sc) * noted. However, we handle this in iwn_intr as we * get both the enable/disble intr. */ - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); - uint32_t *status = (uint32_t *)(desc + 1); DPRINTF(sc, IWN_DEBUG_INTR | IWN_DEBUG_STATE, "state changed to %x\n", @@ -3955,9 +3933,6 @@ iwn_notif_intr(struct iwn_softc *sc) } case IWN_START_SCAN: { - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); - struct iwn_start_scan *scan = (struct iwn_start_scan *)(desc + 1); DPRINTF(sc, IWN_DEBUG_ANY, @@ -3968,8 +3943,6 @@ iwn_notif_intr(struct iwn_softc *sc) #endif case IWN_STOP_SCAN: { - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); #ifdef IWN_DEBUG struct iwn_stop_scan *scan = (struct iwn_stop_scan *)(desc + 1); @@ -3985,7 +3958,7 @@ iwn_notif_intr(struct iwn_softc *sc) break; } case IWN5000_CALIBRATION_RESULT: - iwn5000_rx_calib_results(sc, desc, data); + iwn5000_rx_calib_results(sc, desc); break; case IWN5000_CALIBRATION_DONE: From owner-svn-src-all@freebsd.org Tue Mar 28 22:32:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3CE8D23A34; Tue, 28 Mar 2017 22:32: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 843F4B5E; Tue, 28 Mar 2017 22:32: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 v2SMWBgV023934; Tue, 28 Mar 2017 22:32:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SMWBQk023933; Tue, 28 Mar 2017 22:32:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282232.v2SMWBQk023933@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 22:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316115 - head/lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 22:32:12 -0000 Author: ngie Date: Tue Mar 28 22:32:11 2017 New Revision: 316115 URL: https://svnweb.freebsd.org/changeset/base/316115 Log: libcam: use __func__ instead of hardcoding the function name as `func_name` MFC after: 3 days Tested with: `cam_device_copy(NULL, NULL)` // ;).. Sponsored by: Dell EMC Isilon Modified: head/lib/libcam/camlib.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Tue Mar 28 22:31:48 2017 (r316114) +++ head/lib/libcam/camlib.c Tue Mar 28 22:32:11 2017 (r316115) @@ -114,7 +114,6 @@ 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; @@ -122,7 +121,7 @@ cam_get_device(const char *path, char *d if (path == NULL) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: device pathname was NULL", func_name); + "%s: device pathname was NULL", __func__); return(-1); } @@ -145,7 +144,7 @@ cam_get_device(const char *path, char *d if (*tmpstr == '\0') { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: no text after slash", func_name); + "%s: no text after slash", __func__); free(newpath); return(-1); } @@ -174,7 +173,7 @@ cam_get_device(const char *path, char *d if (strlen(tmpstr) < 2) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: must have both device name and unit number", - func_name); + __func__); free(newpath); return(-1); } @@ -186,7 +185,7 @@ cam_get_device(const char *path, char *d if (isdigit(*tmpstr)) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: device name cannot begin with a number", - func_name); + __func__); free(newpath); return(-1); } @@ -198,7 +197,7 @@ cam_get_device(const char *path, char *d */ if (!isdigit(tmpstr[strlen(tmpstr) - 1])) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: unable to find device unit number", func_name); + "%s: unable to find device unit number", __func__); free(newpath); return(-1); } @@ -270,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, sizeof(cam_errbuf), - "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, - func_name, strerror(errno)); + "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, + __func__, strerror(errno)); return(NULL); } @@ -292,7 +290,7 @@ cam_open_btl(path_id_t path_id, target_i ccb.cdm.matches = (struct dev_match_result *)malloc(bufsize); if (ccb.cdm.matches == NULL) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: couldn't malloc match buffer", func_name); + "%s: couldn't malloc match buffer", __func__); close(fd); return(NULL); } @@ -305,7 +303,7 @@ cam_open_btl(path_id_t path_id, target_i sizeof(struct dev_match_pattern)); if (ccb.cdm.patterns == NULL) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: couldn't malloc pattern buffer", func_name); + "%s: couldn't malloc pattern buffer", __func__); free(ccb.cdm.matches); ccb.cdm.matches = NULL; close(fd); @@ -329,7 +327,7 @@ cam_open_btl(path_id_t path_id, target_i if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: CAMIOCOMMAND ioctl failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + "%s: %s", __func__, __func__, strerror(errno)); goto btl_bailout; } @@ -341,7 +339,7 @@ cam_open_btl(path_id_t path_id, target_i && (ccb.cdm.status != CAM_DEV_MATCH_MORE))) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: CAM error %#x, CDM error %d " - "returned from XPT_DEV_MATCH ccb", func_name, + "returned from XPT_DEV_MATCH ccb", __func__, ccb.ccb_h.status, ccb.cdm.status); goto btl_bailout; } @@ -350,14 +348,14 @@ cam_open_btl(path_id_t path_id, target_i snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: CDM reported more than one" " passthrough device at %d:%d:%jx!!\n", - func_name, path_id, target_id, (uintmax_t)target_lun); + __func__, path_id, target_id, (uintmax_t)target_lun); goto btl_bailout; } if (ccb.cdm.num_matches == 0) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: no passthrough device found at" - " %d:%d:%jx", func_name, path_id, target_id, + " %d:%d:%jx", __func__, path_id, target_id, (uintmax_t)target_lun); goto btl_bailout; } @@ -383,7 +381,7 @@ cam_open_btl(path_id_t path_id, target_i default: snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: asked for a peripheral match, but" - " got a bus or device match", func_name); + " got a bus or device match", __func__); goto btl_bailout; break; /* NOTREACHED */ } @@ -417,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,8 +423,8 @@ cam_lookup_pass(const char *dev_name, in */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: couldn't open %s\n%s: %s", func_name, XPT_DEVICE, - func_name, strerror(errno)); + "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, + __func__, strerror(errno)); return(NULL); } @@ -456,11 +453,11 @@ 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, sizeof(cam_errbuf), "%s: CAMGETPASSTHRU ioctl failed\n" - "%s: %s%s", func_name, func_name, strerror(errno), + "%s: %s%s", __func__, __func__, strerror(errno), (errno == ENOENT) ? tmpstr : ""); close(fd); @@ -478,7 +475,7 @@ cam_lookup_pass(const char *dev_name, in if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: device %s%d does not exist!", - func_name, dev_name, unit); + __func__, dev_name, unit); return(NULL); } @@ -498,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; @@ -510,7 +506,7 @@ cam_real_open_device(const char *path, i sizeof(struct cam_device))) == NULL) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: device structure malloc" - " failed\n%s: %s", func_name, func_name, + " failed\n%s: %s", __func__, __func__, strerror(errno)); return(NULL); } @@ -541,7 +537,7 @@ cam_real_open_device(const char *path, i if ((fd = open(path, flags)) < 0) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: couldn't open passthrough device %s\n" - "%s: %s", func_name, path, func_name, + "%s: %s", __func__, path, __func__, strerror(errno)); goto crod_bailout; } @@ -569,7 +565,7 @@ cam_real_open_device(const char *path, i */ snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: CAMGETPASSTHRU ioctl failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } @@ -581,7 +577,7 @@ cam_real_open_device(const char *path, i */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: passthrough device does not exist!", func_name); + "%s: passthrough device does not exist!", __func__); goto crod_bailout; } @@ -596,7 +592,7 @@ cam_real_open_device(const char *path, i if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: Path Inquiry CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } strlcpy(device->sim_name, ccb.cpi.dev_name, sizeof(device->sim_name)); @@ -611,7 +607,7 @@ cam_real_open_device(const char *path, i if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: Get Device Type CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } device->pd_type = SID_TYPE(&ccb.cgd.inq_data); @@ -635,7 +631,7 @@ cam_real_open_device(const char *path, i if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { snprintf(cam_errbuf, sizeof(cam_errbuf), "%s: Get Transfer Settings CCB failed\n" - "%s: %s", func_name, func_name, strerror(errno)); + "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; } if (ccb.cts.transport == XPORT_SPI) { @@ -712,19 +708,18 @@ 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, sizeof(cam_errbuf), - "%s: device is NULL", func_name); + "%s: device is NULL", __func__); return (NULL); } newdev = malloc(sizeof(struct cam_device)); if (newdev == NULL) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: couldn't malloc CAM device structure", func_name); + "%s: couldn't malloc CAM device structure", __func__); return (NULL); } @@ -739,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, sizeof(cam_errbuf), - "%s: source device struct was NULL", func_name); + "%s: source device struct was NULL", __func__); return; } if (dst == NULL) { snprintf(cam_errbuf, sizeof(cam_errbuf), - "%s: destination device struct was NULL", func_name); + "%s: destination device struct was NULL", __func__); return; } From owner-svn-src-all@freebsd.org Tue Mar 28 22:40:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E47D23B92; Tue, 28 Mar 2017 22:40:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90084E02; Tue, 28 Mar 2017 22:40:52 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SMepBW024333; Tue, 28 Mar 2017 22:40:51 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SMep1K024332; Tue, 28 Mar 2017 22:40:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201703282240.v2SMep1K024332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 28 Mar 2017 22:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316116 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 22:40:52 -0000 Author: avos Date: Tue Mar 28 22:40:51 2017 New Revision: 316116 URL: https://svnweb.freebsd.org/changeset/base/316116 Log: iwn: remove unneeded cast. Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Tue Mar 28 22:32:11 2017 (r316115) +++ head/sys/dev/iwn/if_iwn.c Tue Mar 28 22:40:51 2017 (r316116) @@ -2994,7 +2994,7 @@ iwn_rx_done(struct iwn_softc *sc, struct struct iwn_ops *ops = &sc->ops; struct ieee80211com *ic = &sc->sc_ic; struct iwn_rx_ring *ring = &sc->rxq; - struct ieee80211_frame *wh; + struct ieee80211_frame_min *wh; struct ieee80211_node *ni; struct mbuf *m, *m1; struct iwn_rx_stat *stat; @@ -3096,9 +3096,9 @@ iwn_rx_done(struct iwn_softc *sc, struct m->m_pkthdr.len = m->m_len = len; /* Grab a reference to the source node. */ - wh = mtod(m, struct ieee80211_frame *); + wh = mtod(m, struct ieee80211_frame_min *); if (len >= sizeof(struct ieee80211_frame_min)) - ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); + ni = ieee80211_find_rxnode(ic, wh); else ni = NULL; nf = (ni != NULL && ni->ni_vap->iv_state == IEEE80211_S_RUN && @@ -3130,7 +3130,7 @@ iwn_rx_done(struct iwn_softc *sc, struct if (sc->sc_beacon_wait) { uint8_t type, subtype; /* NB: Re-assign wh */ - wh = mtod(m, struct ieee80211_frame *); + wh = mtod(m, struct ieee80211_frame_min *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; /* From owner-svn-src-all@freebsd.org Tue Mar 28 23:02:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18DC7D20712; Tue, 28 Mar 2017 23:02:43 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC9DF1DFC; Tue, 28 Mar 2017 23:02:42 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SN2fom036443; Tue, 28 Mar 2017 23:02:42 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SN2fLQ036442; Tue, 28 Mar 2017 23:02:41 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201703282302.v2SN2fLQ036442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Tue, 28 Mar 2017 23:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316117 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 23:02:43 -0000 Author: grembo (ports committer) Date: Tue Mar 28 23:02:41 2017 New Revision: 316117 URL: https://svnweb.freebsd.org/changeset/base/316117 Log: In r289137 the legacy_aliases compatibility shims for ata were removed, also remove a leftover define used for implementing them. Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D6726 Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Mar 28 22:40:51 2017 (r316116) +++ head/sys/cam/ata/ata_da.c Tue Mar 28 23:02:41 2017 (r316117) @@ -774,10 +774,6 @@ static void adashutdown(void *arg, int static void adasuspend(void *arg); static void adaresume(void *arg); -#ifndef ADA_DEFAULT_LEGACY_ALIASES -#define ADA_DEFAULT_LEGACY_ALIASES 1 -#endif - #ifndef ADA_DEFAULT_TIMEOUT #define ADA_DEFAULT_TIMEOUT 30 /* Timeout in seconds */ #endif From owner-svn-src-all@freebsd.org Tue Mar 28 23:39:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69EEDD20F82; Tue, 28 Mar 2017 23:39:12 +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 36F612F63; Tue, 28 Mar 2017 23:39:12 +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 v2SNdBP1049191; Tue, 28 Mar 2017 23:39:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SNdBjw049190; Tue, 28 Mar 2017 23:39:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703282339.v2SNdBjw049190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 28 Mar 2017 23:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316118 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 23:39:12 -0000 Author: np Date: Tue Mar 28 23:39:11 2017 New Revision: 316118 URL: https://svnweb.freebsd.org/changeset/base/316118 Log: cxgbe/iw_cxgbe: T6 has no limit on the amount of memory that can be registered in one ib_reg_phys_mr. Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c Modified: head/sys/dev/cxgbe/iw_cxgbe/mem.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/mem.c Tue Mar 28 23:02:41 2017 (r316117) +++ head/sys/dev/cxgbe/iw_cxgbe/mem.c Tue Mar 28 23:39:11 2017 (r316118) @@ -47,11 +47,14 @@ __FBSDID("$FreeBSD$"); #define C4IW_MAX_INLINE_SIZE 96 static int -mr_exceeds_hw_limits(struct c4iw_dev *dev __unused, u64 length) +mr_exceeds_hw_limits(struct c4iw_dev *dev, u64 length) { - return (length >= 8*1024*1024*1024ULL); + return ((is_t4(dev->rdev.adap) || + is_t5(dev->rdev.adap)) && + length >= 8*1024*1024*1024ULL); } + static int write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data) { From owner-svn-src-all@freebsd.org Tue Mar 28 23:56:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBD29D233C3; Tue, 28 Mar 2017 23:56: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 9C9CE1BB4; Tue, 28 Mar 2017 23:56: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 v2SNu25Q057037; Tue, 28 Mar 2017 23:56:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SNu2Hv057034; Tue, 28 Mar 2017 23:56:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282356.v2SNu2Hv057034@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 23:56:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316119 - in head/sys/boot: arm/uboot efi/boot1 efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 23:56:04 -0000 Author: ngie Date: Tue Mar 28 23:56:02 2017 New Revision: 316119 URL: https://svnweb.freebsd.org/changeset/base/316119 Log: self_reloc.c: Pass -Wno-error=maybe-uninitialized to gcc versions greater than 4.2.1 self_reloc.c doesn't initialize `rel` in all cases in the C code, however, the value might be initialized properly on the stack in the assembly code. For right now (because this doesn't seem to be breaking anything and my initializing the stack value could break something since it's called from assembly code) disable the warning for self_reloc.c. More investigation should be done to determine the appropriate response to this warning (either intialize the value or find a smarter way to deal with the warning). A long MFC timeout is being set for this change to allow a better solution for the issue to be developed in that time period. MFC after: 2 months Reported by: Jenkins (FreeBSD-head-amd64-gcc job) Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Tue Mar 28 23:39:11 2017 (r316118) +++ head/sys/boot/arm/uboot/Makefile Tue Mar 28 23:56:02 2017 (r316119) @@ -15,6 +15,10 @@ UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code SRCS= start.S conf.c self_reloc.c vers.c +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 +CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized +.endif + .if !defined(LOADER_NO_DISK_SUPPORT) LOADER_DISK_SUPPORT?= yes .else Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Mar 28 23:39:11 2017 (r316118) +++ head/sys/boot/efi/boot1/Makefile Tue Mar 28 23:56:02 2017 (r316119) @@ -37,6 +37,10 @@ CFLAGS+= -DSKEIN_LOOP=111 .PATH: ${.CURDIR}/../../../crypto/skein .endif +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 +CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized +.endif + CFLAGS+= -I. CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Mar 28 23:39:11 2017 (r316118) +++ head/sys/boot/efi/loader/Makefile Tue Mar 28 23:56:02 2017 (r316119) @@ -35,6 +35,10 @@ CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 +CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized +.endif + # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead From owner-svn-src-all@freebsd.org Wed Mar 29 01:21:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 01:32:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 02:20:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 02:21:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 03:28:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8DE2D22E2A; Wed, 29 Mar 2017 03:28:10 +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 7210F2FDD; Wed, 29 Mar 2017 03:28:10 +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 v2T3S9Tm042270; Wed, 29 Mar 2017 03:28:09 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T3S91r042269; Wed, 29 Mar 2017 03:28:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201703290328.v2T3S91r042269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 29 Mar 2017 03:28:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r316124 - vendor/libpcap/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 03:28:10 -0000 Author: delphij Date: Wed Mar 29 03:28:09 2017 New Revision: 316124 URL: https://svnweb.freebsd.org/changeset/base/316124 Log: Apply vendor revision 470df104c6f55f6d6f390df7448d8eb65c7642b9: From: Guy Harris Subject: [PATCH] Fix compilation if INET6 isn't defined. Addresses GitHub issue #541, but differently from the pull request (it defines gen_gateway() with a function prototype rather than using a pre-prototype-style definition). Modified: vendor/libpcap/dist/gencode.c Modified: vendor/libpcap/dist/gencode.c ============================================================================== --- vendor/libpcap/dist/gencode.c Wed Mar 29 02:21:05 2017 (r316123) +++ vendor/libpcap/dist/gencode.c Wed Mar 29 03:28:09 2017 (r316124) @@ -523,7 +523,8 @@ static struct block *gen_host6(compiler_ struct in6_addr *, int, int, int); #endif #ifndef INET6 -static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int); +static struct block *gen_gateway(compiler_state_t *, const u_char *, + bpf_u_int32 **, int, int); #endif static struct block *gen_ipfrag(compiler_state_t *); static struct block *gen_portatom(compiler_state_t *, int, bpf_int32); @@ -690,7 +691,9 @@ pcap_compile(pcap_t *p, struct bpf_progr } initchunks(&cstate); cstate.no_optimize = 0; +#ifdef INET6 cstate.ai = NULL; +#endif cstate.ic.root = NULL; cstate.ic.cur_mark = 0; cstate.bpf_pcap = p; @@ -4902,11 +4905,8 @@ gen_host6(compiler_state_t *cstate, stru #ifndef INET6 static struct block * -gen_gateway(eaddr, alist, proto, dir) - const u_char *eaddr; - bpf_u_int32 **alist; - int proto; - int dir; +gen_gateway(compiler_state_t *cstate, const u_char *eaddr, bpf_u_int32 **alist, + int proto, int dir) { struct block *b0, *b1, *tmp; @@ -6470,7 +6470,7 @@ gen_scode(compiler_state_t *cstate, cons alist = pcap_nametoaddr(name); if (alist == NULL || *alist == NULL) bpf_error(cstate, "unknown host '%s'", name); - b = gen_gateway(eaddr, alist, proto, dir); + b = gen_gateway(cstate, eaddr, alist, proto, dir); free(eaddr); return b; #else From owner-svn-src-all@freebsd.org Wed Mar 29 03:36:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 706BBD2322F; Wed, 29 Mar 2017 03:36:27 +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 21B9F3CC9; Wed, 29 Mar 2017 03:36:27 +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 v2T3aQxl046087; Wed, 29 Mar 2017 03:36:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T3aQgF046086; Wed, 29 Mar 2017 03:36:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201703290336.v2T3aQgF046086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 29 Mar 2017 03:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316125 - head/contrib/libpcap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 03:36:27 -0000 Author: delphij Date: Wed Mar 29 03:36:26 2017 New Revision: 316125 URL: https://svnweb.freebsd.org/changeset/base/316125 Log: MFV r316124: Fix build when WITHOUT_INET6. Reported by: Randy Westlund MFC after: 3 days Modified: head/contrib/libpcap/gencode.c Directory Properties: head/contrib/libpcap/ (props changed) Modified: head/contrib/libpcap/gencode.c ============================================================================== --- head/contrib/libpcap/gencode.c Wed Mar 29 03:28:09 2017 (r316124) +++ head/contrib/libpcap/gencode.c Wed Mar 29 03:36:26 2017 (r316125) @@ -525,7 +525,8 @@ static struct block *gen_host6(compiler_ struct in6_addr *, int, int, int); #endif #ifndef INET6 -static struct block *gen_gateway(const u_char *, bpf_u_int32 **, int, int); +static struct block *gen_gateway(compiler_state_t *, const u_char *, + bpf_u_int32 **, int, int); #endif static struct block *gen_ipfrag(compiler_state_t *); static struct block *gen_portatom(compiler_state_t *, int, bpf_int32); @@ -692,7 +693,9 @@ pcap_compile(pcap_t *p, struct bpf_progr } initchunks(&cstate); cstate.no_optimize = 0; +#ifdef INET6 cstate.ai = NULL; +#endif cstate.ic.root = NULL; cstate.ic.cur_mark = 0; cstate.bpf_pcap = p; @@ -4904,11 +4907,8 @@ gen_host6(compiler_state_t *cstate, stru #ifndef INET6 static struct block * -gen_gateway(eaddr, alist, proto, dir) - const u_char *eaddr; - bpf_u_int32 **alist; - int proto; - int dir; +gen_gateway(compiler_state_t *cstate, const u_char *eaddr, bpf_u_int32 **alist, + int proto, int dir) { struct block *b0, *b1, *tmp; @@ -6472,7 +6472,7 @@ gen_scode(compiler_state_t *cstate, cons alist = pcap_nametoaddr(name); if (alist == NULL || *alist == NULL) bpf_error(cstate, "unknown host '%s'", name); - b = gen_gateway(eaddr, alist, proto, dir); + b = gen_gateway(cstate, eaddr, alist, proto, dir); free(eaddr); return b; #else From owner-svn-src-all@freebsd.org Wed Mar 29 07:31:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 08:00:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 08:00:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 08:01:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 08:02:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 08:39:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E993FD227E3; Wed, 29 Mar 2017 08:39:47 +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 C15EF651CE; Wed, 29 Mar 2017 08:39: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 v2T8cV17066871; Wed, 29 Mar 2017 08:38:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T8cVww066870; Wed, 29 Mar 2017 08:38:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290838.v2T8cVww066870@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:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316131 - head/lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 08:39:48 -0000 Author: ngie Date: Wed Mar 29 08:38:31 2017 New Revision: 316131 URL: https://svnweb.freebsd.org/changeset/base/316131 Log: Fix up r316081 by using nitems(cam_errbuf) instead of sizeof(cam_errbuf) Part of my original reasoning as far as converting the snprintf calls was to permit switching over from char[] to wchar_t[] in the future, as well as futureproof in case cam_errbuf's size was ever changed. Unfortunately, my approach was bugged because it conflated the number of items with the size of the buffer, instead of the number of elements being a fixed size != 1 byte. Use nitems(..) instead which counts the quantity of items of a specific type, as opposed to an unqualified sizeof(..) (which assumes that the number of characters is equal to the buffer size). MFC after: 2 months Noted by: cem Sponsored by: Dell EMC Isilon Modified: head/lib/libcam/camlib.c Modified: head/lib/libcam/camlib.c ============================================================================== --- head/lib/libcam/camlib.c Wed Mar 29 08:02:12 2017 (r316130) +++ head/lib/libcam/camlib.c Wed Mar 29 08:38:31 2017 (r316131) @@ -120,7 +120,7 @@ cam_get_device(const char *path, char *d int i; if (path == NULL) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: device pathname was NULL", __func__); return(-1); } @@ -143,7 +143,7 @@ cam_get_device(const char *path, char *d } if (*tmpstr == '\0') { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: no text after slash", __func__); free(newpath); return(-1); @@ -171,7 +171,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: must have both device name and unit number", __func__); free(newpath); @@ -183,7 +183,7 @@ cam_get_device(const char *path, char *d * has probably given us all numbers. Point out the error. */ if (isdigit(*tmpstr)) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: device name cannot begin with a number", __func__); free(newpath); @@ -196,7 +196,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: unable to find device unit number", __func__); free(newpath); return(-1); @@ -272,7 +272,7 @@ cam_open_btl(path_id_t path_id, target_i int fd, bufsize; if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, __func__, strerror(errno)); return(NULL); @@ -289,7 +289,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: couldn't malloc match buffer", __func__); close(fd); return(NULL); @@ -302,7 +302,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: couldn't malloc pattern buffer", __func__); free(ccb.cdm.matches); ccb.cdm.matches = NULL; @@ -325,7 +325,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: CAMIOCOMMAND ioctl failed\n" "%s: %s", __func__, __func__, strerror(errno)); goto btl_bailout; @@ -337,7 +337,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: CAM error %#x, CDM error %d " "returned from XPT_DEV_MATCH ccb", __func__, ccb.ccb_h.status, ccb.cdm.status); @@ -345,7 +345,7 @@ cam_open_btl(path_id_t path_id, target_i } if (ccb.cdm.status == CAM_DEV_MATCH_MORE) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: CDM reported more than one" " passthrough device at %d:%d:%jx!!\n", __func__, path_id, target_id, (uintmax_t)target_lun); @@ -353,7 +353,7 @@ cam_open_btl(path_id_t path_id, target_i } if (ccb.cdm.num_matches == 0) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: no passthrough device found at" " %d:%d:%jx", __func__, path_id, target_id, (uintmax_t)target_lun); @@ -379,7 +379,7 @@ cam_open_btl(path_id_t path_id, target_i break; /* NOTREACHED */ } default: - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: asked for a peripheral match, but" " got a bus or device match", __func__); goto btl_bailout; @@ -422,7 +422,7 @@ cam_lookup_pass(const char *dev_name, in * passthrough device. */ if ((fd = open(XPT_DEVICE, O_RDWR)) < 0) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: couldn't open %s\n%s: %s", __func__, XPT_DEVICE, __func__, strerror(errno)); return(NULL); @@ -455,7 +455,7 @@ cam_lookup_pass(const char *dev_name, in "your kernel\n%s: or %s%d doesn't exist", __func__, __func__, dev_name, unit); } - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: CAMGETPASSTHRU ioctl failed\n" "%s: %s%s", __func__, __func__, strerror(errno), (errno == ENOENT) ? tmpstr : ""); @@ -473,7 +473,7 @@ cam_lookup_pass(const char *dev_name, in * the device the user gave us. */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: device %s%d does not exist!", __func__, dev_name, unit); return(NULL); @@ -504,7 +504,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: device structure malloc" " failed\n%s: %s", __func__, __func__, strerror(errno)); @@ -535,7 +535,7 @@ cam_real_open_device(const char *path, i device->given_unit_number = given_unit_number; if ((fd = open(path, flags)) < 0) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: couldn't open passthrough device %s\n" "%s: %s", __func__, path, __func__, strerror(errno)); @@ -563,7 +563,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: CAMGETPASSTHRU ioctl failed\n" "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; @@ -576,7 +576,7 @@ cam_real_open_device(const char *path, i * the device the user gave us. */ if (ccb.cgdl.status == CAM_GDEVLIST_ERROR) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: passthrough device does not exist!", __func__); goto crod_bailout; } @@ -590,7 +590,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: Path Inquiry CCB failed\n" "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; @@ -605,7 +605,7 @@ 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, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: Get Device Type CCB failed\n" "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; @@ -629,7 +629,7 @@ cam_real_open_device(const char *path, i ccb.cts.type = CTS_TYPE_CURRENT_SETTINGS; if (ioctl(fd, CAMIOCOMMAND, &ccb) == -1) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: Get Transfer Settings CCB failed\n" "%s: %s", __func__, __func__, strerror(errno)); goto crod_bailout; @@ -711,14 +711,14 @@ cam_device_dup(struct cam_device *device struct cam_device *newdev; if (device == NULL) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: device is NULL", __func__); return (NULL); } newdev = malloc(sizeof(struct cam_device)); if (newdev == NULL) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: couldn't malloc CAM device structure", __func__); return (NULL); } @@ -736,13 +736,13 @@ cam_device_copy(struct cam_device *src, { if (src == NULL) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: source device struct was NULL", __func__); return; } if (dst == NULL) { - snprintf(cam_errbuf, sizeof(cam_errbuf), + snprintf(cam_errbuf, nitems(cam_errbuf), "%s: destination device struct was NULL", __func__); return; } From owner-svn-src-all@freebsd.org Wed Mar 29 08:55:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E519D2307B; Wed, 29 Mar 2017 08:55:20 +0000 (UTC) (envelope-from prvs=25439209a=roger.pau@citrix.com) Received: from SMTP.EU.CITRIX.COM (smtp.ctxuk.citrix.com [185.25.65.24]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "mail.citrix.com", Issuer "DigiCert SHA2 Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 172BC35C5; Wed, 29 Mar 2017 08:55:18 +0000 (UTC) (envelope-from prvs=25439209a=roger.pau@citrix.com) X-IronPort-AV: E=Sophos;i="5.36,240,1486425600"; d="scan'208";a="43320535" Date: Wed, 29 Mar 2017 09:55:04 +0100 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Ngie Cooper CC: , , Subject: Re: svn commit: r316106 - head/sys/boot/zfs Message-ID: <20170329085504.iiyfg4mybclkbyti@dhcp-3-128.uk.xensource.com> References: <201703282039.v2SKdONV074149@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <201703282039.v2SKdONV074149@repo.freebsd.org> User-Agent: NeoMutt/20170306 (1.8.0) X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 08:55:20 -0000 On Tue, Mar 28, 2017 at 08:39:24PM +0000, Ngie Cooper wrote: > Author: ngie > Date: Tue Mar 28 20:39:24 2017 > New Revision: 316106 > URL: https://svnweb.freebsd.org/changeset/base/316106 > > Log: > 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. > > MFC after: 3 days > Reported by: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/boot/zfs/zfsimpl.c > > Modified: head/sys/boot/zfs/zfsimpl.c > ============================================================================== > --- head/sys/boot/zfs/zfsimpl.c Tue Mar 28 20:34:02 2017 (r316105) > +++ head/sys/boot/zfs/zfsimpl.c Tue Mar 28 20:39:24 2017 (r316106) > @@ -494,7 +494,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) Just a nit, but IMHO it would be clearer to use read_func, read_helper or some more descriptive name since you where already changing this. Roger. From owner-svn-src-all@freebsd.org Wed Mar 29 09:30:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3C84D23A33; Wed, 29 Mar 2017 09:30:04 +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 B8FC2674AD; Wed, 29 Mar 2017 09:30: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 v2T9U3Hx087584; Wed, 29 Mar 2017 09:30:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2T9U3x9087583; Wed, 29 Mar 2017 09:30:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703290930.v2T9U3x9087583@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 09:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316132 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 09:30:05 -0000 Author: ngie Date: Wed Mar 29 09:30:03 2017 New Revision: 316132 URL: https://svnweb.freebsd.org/changeset/base/316132 Log: Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... This is being done to make it easier to change in the future--this action might be needed sooner rather than later because of gcc 6.3.0 bailing, stating that there is negative free space left (deficit) in the boot2 bootloader. MFC after: 2 months Sponsored by: Dell EMC Isilon Modified: head/sys/boot/i386/boot2/Makefile Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Wed Mar 29 08:38:31 2017 (r316131) +++ head/sys/boot/i386/boot2/Makefile Wed Mar 29 09:30:03 2017 (r316132) @@ -66,10 +66,12 @@ boot1.out: boot1.o CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ boot2.h sio.o +BOOT2SIZE= 7680 + boot2: boot2.ld - @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=7680 conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ From owner-svn-src-all@freebsd.org Wed Mar 29 10:24:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 051FED22A73; Wed, 29 Mar 2017 10:24:50 +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 C8FDC6CD43; Wed, 29 Mar 2017 10:24:49 +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 v2TAOmK1012097; Wed, 29 Mar 2017 10:24:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TAOmqv012096; Wed, 29 Mar 2017 10:24:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201703291024.v2TAOmqv012096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 29 Mar 2017 10:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316133 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 10:24:50 -0000 Author: ae Date: Wed Mar 29 10:24:48 2017 New Revision: 316133 URL: https://svnweb.freebsd.org/changeset/base/316133 Log: Fix bug in r308972 that leads to panic when non-compressed IPComp packet is received. Reported by: Denis Ahrens MFC after: 3 days Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Wed Mar 29 09:30:03 2017 (r316132) +++ head/sys/netipsec/key.c Wed Mar 29 10:24:48 2017 (r316133) @@ -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-all@freebsd.org Wed Mar 29 10:59:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 11:03:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 14:46:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E3ED23F6C; Wed, 29 Mar 2017 14:46:27 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 722F63CA2; Wed, 29 Mar 2017 14:46:27 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TEkQIF020808; Wed, 29 Mar 2017 14:46:26 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TEkQ3v020805; Wed, 29 Mar 2017 14:46:26 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201703291446.v2TEkQ3v020805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 29 Mar 2017 14:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316136 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 14:46:27 -0000 Author: bde Date: Wed Mar 29 14:46:26 2017 New Revision: 316136 URL: https://svnweb.freebsd.org/changeset/base/316136 Log: The switch to kernel terminal context needs to update more than the cursor position. Especially the screen size, and potentially everything except the input state and attributes. Do this by changing the cursor position setting method to a general syncing method. Use proper constructors instead of copying to create kernel terminal contexts. We really want clones and not new instances, but there is no method for cloning and there is nothing in the active instance that needs to be cloned exactly. Add proper destructors for kernel terminal contexts. I doubt that the destructor code has every been reached, but if it was then it leaked the memory of the clones. Remove freeing of statically allocated memory for the non-kernel terminal context for the same terminal as the kernel. This is in the nearly unreachable code. This used to not happen because delicate context swapping made the user context use the dynamic memory and kernel context the static memory. I didn't restore this swapping since it would have been unnatural to have all kernel contexts except 1 dynamic. The constructor for terminal context has bad layering for reasons related to the bug. It has to return static memory early before malloc() works. Callers also can't allocate memory until after the first constructor selects an emulator and tells upper layers the size of its context. After that, the cloning hack required the cloning code to allocate the memory, but for all other constructors it would be better for the terminal layer to allocate and deallocate the memory in all cases. Zero the memory when allocating terminal contexts dynamically. Modified: head/sys/dev/syscons/scterm-teken.c head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/scterm-teken.c ============================================================================== --- head/sys/dev/syscons/scterm-teken.c Wed Mar 29 11:03:08 2017 (r316135) +++ head/sys/dev/syscons/scterm-teken.c Wed Mar 29 14:46:26 2017 (r316136) @@ -62,7 +62,7 @@ static sc_term_default_attr_t scteken_de static sc_term_clear_t scteken_clear; static sc_term_input_t scteken_input; static sc_term_fkeystr_t scteken_fkeystr; -static sc_term_set_cursor_t scteken_set_cursor; +static sc_term_sync_t scteken_sync; static void scteken_nop(void); typedef struct { @@ -89,7 +89,7 @@ static sc_term_sw_t sc_term_scteken = { (sc_term_notify_t *)scteken_nop, scteken_input, scteken_fkeystr, - scteken_set_cursor, + scteken_sync, }; SCTERM_MODULE(scteken, sc_term_scteken); @@ -219,7 +219,7 @@ scteken_clear(scr_stat *scp) teken_stat *ts = scp->ts; sc_move_cursor(scp, 0, 0); - scteken_set_cursor(scp, 0, 0); + scteken_sync(scp); sc_vtb_clear(&scp->vtb, scp->sc->scr_map[0x20], scteken_te_to_sc_attr(teken_get_curattr(&ts->ts_teken)) << 8); @@ -284,13 +284,16 @@ scteken_fkeystr(scr_stat *scp, int c) } static void -scteken_set_cursor(scr_stat *scp, int col, int row) +scteken_sync(scr_stat *scp) { teken_stat *ts = scp->ts; teken_pos_t tp; - tp.tp_col = col; - tp.tp_row = row; + tp.tp_col = scp->xsize; + tp.tp_row = scp->ysize; + teken_set_winsize_noreset(&ts->ts_teken, &tp); + tp.tp_col = scp->xpos; + tp.tp_row = scp->ypos; teken_set_cursor(&ts->ts_teken, &tp); } Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Wed Mar 29 11:03:08 2017 (r316135) +++ head/sys/dev/syscons/syscons.c Wed Mar 29 14:46:26 2017 (r316136) @@ -567,8 +567,9 @@ sc_attach_unit(int unit, int flags) /* assert(sc_console->ts != NULL); */ oldts = sc_console->ts; for (i = 0; i <= mp_maxid; i++) { - ts = malloc(sc_console->tsw->te_size, M_DEVBUF, M_WAITOK); - bcopy(oldts, ts, sc_console->tsw->te_size); + ts = malloc(sc_console->tsw->te_size, M_DEVBUF, + M_WAITOK | M_ZERO); + (*sc_console->tsw->te_init)(sc_console, &ts, SC_TE_COLD_INIT); sc_console->ts = ts; (*sc_console->tsw->te_default_attr)(sc_console, sc_kattrtab[i], SC_KERNEL_CONS_REV_ATTR); @@ -1705,6 +1706,9 @@ sc_cninit(struct consdev *cp) static void sc_cnterm(struct consdev *cp) { + void *ts; + int i; + /* we are not the kernel console any more, release everything */ if (sc_console_unit < 0) @@ -1715,6 +1719,12 @@ sc_cnterm(struct consdev *cp) sccnupdate(sc_console); #endif + for (i = 0; i <= mp_maxid; i++) { + ts = kernel_console_ts[i]; + kernel_console_ts[i] = NULL; + (*sc_console->tsw->te_term)(sc_console, &ts); + free(ts, M_DEVBUF); + } scterm(sc_console_unit, SC_KERNEL_CONSOLE); sc_console_unit = -1; sc_console = NULL; @@ -1977,11 +1987,11 @@ sc_cnputc(struct consdev *cd, int c) ts = kernel_console_ts[PCPU_GET(cpuid)]; if (ts != NULL) { scp->ts = ts; - (*scp->tsw->te_set_cursor)(scp, scp->xpos, scp->ypos); + (*scp->tsw->te_sync)(scp); } sc_puts(scp, buf, 1); scp->ts = oldts; - (*scp->tsw->te_set_cursor)(scp, scp->xpos, scp->ypos); + (*scp->tsw->te_sync)(scp); } s = spltty(); /* block sckbdevent and scrn_timer */ @@ -3196,7 +3206,7 @@ scinit(int unit, int flags) scp->xpos = col; scp->ypos = row; scp->cursor_pos = scp->cursor_oldpos = row*scp->xsize + col; - (*scp->tsw->te_set_cursor)(scp, col, row); + (*scp->tsw->te_sync)(scp); /* Sync BIOS cursor shape to s/w (sc only). */ if (bios_value.cursor_end < scp->font_size) @@ -3312,12 +3322,11 @@ scterm(int unit, int flags) scp = sc_get_stat(sc->dev[0]); if (scp->tsw) (*scp->tsw->te_term)(scp, &scp->ts); - if (scp->ts != NULL) - free(scp->ts, M_DEVBUF); mtx_destroy(&sc->video_mtx); /* clear the structure */ if (!(flags & SC_KERNEL_CONSOLE)) { + free(scp->ts, M_DEVBUF); /* XXX: We need delete_dev() for this */ free(sc->dev, M_DEVBUF); #if 0 Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Wed Mar 29 11:03:08 2017 (r316135) +++ head/sys/dev/syscons/syscons.h Wed Mar 29 14:46:26 2017 (r316136) @@ -394,7 +394,7 @@ typedef void sc_term_notify_t(scr_stat * #define SC_TE_NOTIFY_VTSWITCH_OUT 1 typedef int sc_term_input_t(scr_stat *scp, int c, struct tty *tp); typedef const char *sc_term_fkeystr_t(scr_stat *scp, int c); -typedef void sc_term_set_cursor_t(scr_stat *scp, int col, int row); +typedef void sc_term_sync_t(scr_stat *scp); typedef struct sc_term_sw { LIST_ENTRY(sc_term_sw) link; @@ -413,7 +413,7 @@ typedef struct sc_term_sw { sc_term_notify_t *te_notify; sc_term_input_t *te_input; sc_term_fkeystr_t *te_fkeystr; - sc_term_set_cursor_t *te_set_cursor; + sc_term_sync_t *te_sync; } sc_term_sw_t; #define SCTERM_MODULE(name, sw) \ From owner-svn-src-all@freebsd.org Wed Mar 29 14:57:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 14:58:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:25:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:28:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6D65D23C12; Wed, 29 Mar 2017 15:28:52 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id AA9F465BDD; Wed, 29 Mar 2017 15:28:52 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from dhcp-10-248-121-82.eduroam.wireless.private.cam.ac.uk (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 3C9384E6EC; Wed, 29 Mar 2017 15:28:15 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: svn commit: r316119 - in head/sys/boot: arm/uboot efi/boot1 efi/loader From: Andrew Turner In-Reply-To: <201703282356.v2SNu2Hv057034@repo.freebsd.org> Date: Wed, 29 Mar 2017 16:28:14 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <08FA2B39-CF4A-4BDD-8A3A-44FA69F708F4@fubar.geek.nz> References: <201703282356.v2SNu2Hv057034@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3259) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:28:53 -0000 > On 29 Mar 2017, at 00:56, Ngie Cooper wrote: >=20 > Author: ngie > Date: Tue Mar 28 23:56:02 2017 > New Revision: 316119 > URL: https://svnweb.freebsd.org/changeset/base/316119 >=20 > Log: > self_reloc.c: Pass -Wno-error=3Dmaybe-uninitialized to gcc versions = greater than 4.2.1 >=20 > self_reloc.c doesn't initialize `rel` in all cases in the C code, = however, the value > might be initialized properly on the stack in the assembly code. The code does initialise rel as the loader will have either a DT_REL or = DT_RELA entry, however the compiler doesn=E2=80=99t know this. The asm = code shouldn=E2=80=99t be setting any stack variables as it calls = self_reloc so would need to know the stack layout. This may change = depending on the compiler used, and any flags passed to it. >=20 > For right now (because this doesn't seem to be breaking anything and = my initializing > the stack value could break something since it's called from assembly = code) disable > the warning for self_reloc.c. More investigation should be done to = determine the > appropriate response to this warning (either intialize the value or = find a smarter > way to deal with the warning). The proper solution is to initialise it. If the values incorrect it will = access invalid memory, however as it=E2=80=99s parsing its own = relocation tables it will be safe, if they are wrong there are bigger = problems & the rest of the loader is unlikely to succeed. Andrew From owner-svn-src-all@freebsd.org Wed Mar 29 15:34:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:39:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:39:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:40:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:41:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:43:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:43:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:43:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:44:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:45:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:45:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3798ED207B4; Wed, 29 Mar 2017 15:45:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04C663B3C; Wed, 29 Mar 2017 15:45:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TFjKhs046429; Wed, 29 Mar 2017 15:45:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TFjKaC046428; Wed, 29 Mar 2017 15:45:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703291545.v2TFjKaC046428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 29 Mar 2017 15:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316150 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 15:45:21 -0000 Author: emaste Date: Wed Mar 29 15:45:19 2017 New Revision: 316150 URL: https://svnweb.freebsd.org/changeset/base/316150 Log: makefs: free specfile structure once it has been applied NetBSD revs: walk.c 1.21 Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Wed Mar 29 15:45:04 2017 (r316149) +++ head/usr.sbin/makefs/walk.c Wed Mar 29 15:45:19 2017 (r316150) @@ -333,6 +333,7 @@ apply_specfile(const char *specfile, con /* merge in the changes */ apply_specdir(dir, root, parent, speconly); + free_nodes(root); } static void From owner-svn-src-all@freebsd.org Wed Mar 29 15:45:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:56:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:56:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:57:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 15:58:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:02:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:02:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:03:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:04:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:04:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:10:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:12:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:13:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:14:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:14:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:15:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:16:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:16:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 16:17:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 17:11:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 17:12:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 18:19:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CAAD245E6 for ; Wed, 29 Mar 2017 18:19:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9172E91 for ; Wed, 29 Mar 2017 18:19:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id e75so98890426itd.1 for ; Wed, 29 Mar 2017 11:19:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=T5gHE+91qv9j62SNsW0hwYg4VzwEc/gEJl51Wdu9Uxk=; b=RYyCorqKm61rWvgWny5j1M7NXzGCRvcLyIm2j69l/ls2ZmNbVnTfXau2AKSs7Tst81 +iPBJpZZLtftrjt8hdqPaUeaLGbXZ3FAj74qQc4xolNw6e2TVODiZ0bqVKod9DjQDN0T IcLfwXepT2869eDCIxxCRP0fSFsFogkHomZCg5uGIg7SqhMjShNLbQH7OugWn9y44v6o DW8Coc9QYyg4itX9W1aPMWBQHi6yXL36CbrBDXDihT1lH/RLQ1U7oZmyKdSliKwMW0Ym t8uOX9dzitbJYeeCbiyuKF/tH8BEseUMGeVju5JHsNfAPgwfx6kNRzfKEtKm0oazdF/4 OL+w== 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=T5gHE+91qv9j62SNsW0hwYg4VzwEc/gEJl51Wdu9Uxk=; b=O/i8RKzbObSOiQso2Pz2IopOstMA/HuDoafLVewgMbdiXQhjWKwaT93AYJm17yjjdQ RalMCwjinrFnNcoUjiUA1ZUGQ8lNP36Fxkie3T/BJWChPutNKTm5uQD8yV5h8AynGgrw QrYTB0n3uTIUc/3rfvyeeSpSqpd0lS/3qrmHjhtnWrrZCtisE/VzlZ9r7Xf+SS+g6Q+i mGkgIs2xJ1Mm44AqEUvLvFCG2QbswvRqri1XCYzR5Fs6LBENyU3OJFgiLdCvqb+HEE8f FiVuAB3LwiaqBXMOkVdVbPsBb4u/9WvZD94/67+rTRvDQ0pohCx+84UTLqdWl/X7/CtK VonA== X-Gm-Message-State: AFeK/H0sCMqhHFkGZsd2ywJE27XcskN0pxXXEC2MMeaLM64qzKgBohPfkg06OK1EficGue0jBQrV3gnE338DJA== X-Received: by 10.36.44.14 with SMTP id i14mr2527372iti.103.1490811552515; Wed, 29 Mar 2017 11:19:12 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 11:19:12 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:a045:c633:4156:d07c] In-Reply-To: <201703290930.v2T9U3x9087583@repo.freebsd.org> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> From: Warner Losh Date: Wed, 29 Mar 2017 12:19:12 -0600 X-Google-Sender-Auth: GhZHb_Pxw3so4uBOGX3cw07oG58 Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 18:19:14 -0000 On Wed, Mar 29, 2017 at 3:30 AM, Ngie Cooper wrote: > Author: ngie > Date: Wed Mar 29 09:30:03 2017 > New Revision: 316132 > URL: https://svnweb.freebsd.org/changeset/base/316132 > > Log: > Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... > > This is being done to make it easier to change in the future--this action might be > needed sooner rather than later because of gcc 6.3.0 bailing, stating that there > is negative free space left (deficit) in the boot2 bootloader. This number is never, ever ever going to change. Don't even put that on the list of things that are possible to fix gcc 6.3 bloated code generation. You must fix the compiler, pass it the right options, or it will remain unsupported. There's a fixed slot it slides into. While it is in theory possible to increase it, it really isn't practical to increase it because so many things just know its size and offset. Warner > MFC after: 2 months > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/boot/i386/boot2/Makefile > > Modified: head/sys/boot/i386/boot2/Makefile > ============================================================================== > --- head/sys/boot/i386/boot2/Makefile Wed Mar 29 08:38:31 2017 (r316131) > +++ head/sys/boot/i386/boot2/Makefile Wed Mar 29 09:30:03 2017 (r316132) > @@ -66,10 +66,12 @@ boot1.out: boot1.o > CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ > boot2.h sio.o > > +BOOT2SIZE= 7680 > + > boot2: boot2.ld > - @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ > + @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ > echo "$$x bytes available"; test $$x -ge 0 > - ${DD} if=${.ALLSRC} of=${.TARGET} obs=7680 conv=osync > + ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync > > boot2.ld: boot2.ldr boot2.bin ${BTXKERN} > btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ > From owner-svn-src-all@freebsd.org Wed Mar 29 18:35:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD454D24C4E; Wed, 29 Mar 2017 18:35:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA78B16C0; Wed, 29 Mar 2017 18:35:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TIZKjJ016888; Wed, 29 Mar 2017 18:35:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TIZKD2016887; Wed, 29 Mar 2017 18:35:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201703291835.v2TIZKD2016887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 29 Mar 2017 18:35:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316171 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 18:35:22 -0000 Author: imp Date: Wed Mar 29 18:35:20 2017 New Revision: 316171 URL: https://svnweb.freebsd.org/changeset/base/316171 Log: xfsread inlined uses more space, so remove the inline tag. This doesn't help clang, but buys us another 32 bytes for gcc 4.2.1. It also eliminates a warning from gcc 6.3.0 that says inlining this would be unhelpful. Modified: head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Wed Mar 29 17:11:41 2017 (r316170) +++ head/sys/boot/i386/boot2/boot2.c Wed Mar 29 18:35:20 2017 (r316171) @@ -143,7 +143,7 @@ strcmp(const char *s1, const char *s2) #define UFS_SMALL_CGBASE #include "ufsread.c" -static inline int +static int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { From owner-svn-src-all@freebsd.org Wed Mar 29 19:25:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99885D241B8; Wed, 29 Mar 2017 19:25:32 +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 695A1E28; Wed, 29 Mar 2017 19:25:32 +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 v2TJPVaG036825; Wed, 29 Mar 2017 19:25:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TJPV3O036824; Wed, 29 Mar 2017 19:25:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201703291925.v2TJPV3O036824@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 19:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316172 - head/sys/dev/cxgbe/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:25:32 -0000 Author: np Date: Wed Mar 29 19:25:31 2017 New Revision: 316172 URL: https://svnweb.freebsd.org/changeset/base/316172 Log: cxgbe: Don't call t4_edc_err_read for errors not related to the EDCs. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Mar 29 18:35:20 2017 (r316171) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Mar 29 19:25:31 2017 (r316172) @@ -4332,7 +4332,8 @@ static void mem_intr_handler(struct adap if (v & F_ECC_CE_INT_CAUSE) { u32 cnt = G_ECC_CECNT(t4_read_reg(adapter, cnt_addr)); - t4_edc_err_read(adapter, idx); + if (idx <= MEM_EDC1) + t4_edc_err_read(adapter, idx); t4_write_reg(adapter, cnt_addr, V_ECC_CECNT(M_ECC_CECNT)); CH_WARN_RATELIMIT(adapter, From owner-svn-src-all@freebsd.org Wed Mar 29 19:25:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Wed Mar 29 19:30:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8F1CD242E5; Wed, 29 Mar 2017 19:30:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A889C853; Wed, 29 Mar 2017 19:30:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TJUMnk037082; Wed, 29 Mar 2017 19:30:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TJUMMK037081; Wed, 29 Mar 2017 19:30:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201703291930.v2TJUMMK037081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 29 Mar 2017 19:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316174 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:30:23 -0000 Author: markj Date: Wed Mar 29 19:30:22 2017 New Revision: 316174 URL: https://svnweb.freebsd.org/changeset/base/316174 Log: Remove an unneeded g_mirror_destroy_provider() call. The worker thread will destroy the mirror provider as part of its teardown sequence. The call made sense in the initial revision of gmirror, but became unnecessary in r137248. Tested by: pho (part of a larger diff) MFC afteR: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Mar 29 19:25:42 2017 (r316173) +++ head/sys/geom/mirror/g_mirror.c Wed Mar 29 19:30:22 2017 (r316174) @@ -2475,11 +2475,8 @@ g_mirror_update_device(struct g_mirror_s if (g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) == 0 && g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_NEW) == 0) { /* - * No active disks or no disks at all, - * so destroy device. + * No usable disks, so destroy the device. */ - if (sc->sc_provider != NULL) - g_mirror_destroy_provider(sc); sc->sc_flags |= G_MIRROR_DEVICE_FLAG_DESTROY; break; } else if (g_mirror_ndisks(sc, From owner-svn-src-all@freebsd.org Wed Mar 29 19:35:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5320CD24627; Wed, 29 Mar 2017 19:35:55 +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 1D0AC3E8; Wed, 29 Mar 2017 19:35:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id w11so3459502itb.0; Wed, 29 Mar 2017 12:35:55 -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=9d68qLsy5PoFrPox4ycuFsNPW44NrkIoMQgkDVaOK00=; b=QNB2Rr/sk6fWhwug9zgNj3MFh3B3E3eJjJhGPSUmrldW9Q3Qza7nrLpVv+POKv+wrU EWhMbFvjrcua4tUcj4WLpTqKFN5NEShfNLs24suFl17EbjVJg7XZjag3wgwTyr1ZWSGN gZdz1m/IGf/mlSptPMihZOC8eOtrMIzu82t3/qW7n7LkUiKdi6hD+WBNneEntGWGFEZ3 AgB81ZckhUCHIG7ncX9UjnGFXVi9y2nbop0WmgVCGwSFZ0D0kf7M1KKTsZMd3PSscmHf 1ix3Cvv9QtVT+Iege2wEzWs9BKZINe2r7+OBFA3d70CG+8AI8Er384411VeaXbIEhqwl k2RA== 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=9d68qLsy5PoFrPox4ycuFsNPW44NrkIoMQgkDVaOK00=; b=LJv8Y+qL4ceziG8E4u9hoSjPIRVKVx6XUoe+wxV8fPKAwFxsp4MTf+NkVJo6tNOEt8 /6f4OamCJ9XMf7G0fO+fibuht4DBOkdMkXU5PLv8gN9EoSdDn1y0CkDiDzD0pTPa5GAQ xueo0s6U7ydkwKBrnXqKyTfEu4yqaOwdNyjx/uz39nbmtpir6qgyEdBvjhvnqz+xFzut 0vxU0KwJE+/Ih8S7gwv8n+rWHNJW2bX7DgMdlbxIQnE33d+AMLNCmi0IwoqLcNNevb4d uqTX3EOdqqx5aBM5N/8LcVrCp60UmMQGBj8d2rJrkfiaGWdh3nAMYnp5Nx9aqlK09ohg Yuzw== X-Gm-Message-State: AFeK/H0Mw2WUslw5ZJfUQy2Ax6Oky7ZJjFfcUqiWEH3SMXCz9BnBuk9Kp/0zWSnhLwIm/wNUbyHG0XZWRb42Dg== X-Received: by 10.36.0.198 with SMTP id 189mr109840ita.82.1490816154204; Wed, 29 Mar 2017 12:35:54 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.209 with HTTP; Wed, 29 Mar 2017 12:35:33 -0700 (PDT) In-Reply-To: <201612192028.uBJKSRs4056590@repo.freebsd.org> References: <201612192028.uBJKSRs4056590@repo.freebsd.org> From: Ed Maste Date: Wed, 29 Mar 2017 15:35:33 -0400 X-Google-Sender-Auth: IrYGhEjHJagt2Ey6deYwi9cpCT8 Message-ID: Subject: Re: svn commit: r310295 - in head/sys: conf dev/bhnd/nvram modules/bhnd To: "Landon J. Fuller" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:35:55 -0000 On 19 December 2016 at 15:28, Landon J. Fuller wrote: > Author: landonf > Date: Mon Dec 19 20:28:27 2016 > New Revision: 310295 > URL: https://svnweb.freebsd.org/changeset/base/310295 > > Log: > bhnd(4): NVRAM device path support. > > Implements bhnd_nvram_store support for parsing and operating over NVRAM > device paths, and device path aliases, as well as tracking per-path NVRAM > variable writes. > @@ -871,13 +881,45 @@ bhnd_nvram_sprom_getvar(struct bhnd_nvra > if ((var->flags & BHND_NVRAM_VF_IGNALL1) && all_bits_set) > return (ENOENT); > > + /* Provide value wrapper */ > + return (bhnd_nvram_val_init(val, var->fmt, inp, ilen, var->type, > + BHND_NVRAM_VAL_BORROW_DATA)); > + return (error); > +} The extra return here seems odd; Coverity picked it up as CID 1373118. From owner-svn-src-all@freebsd.org Wed Mar 29 19:39:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B039CD247B1; Wed, 29 Mar 2017 19:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D726C1D; Wed, 29 Mar 2017 19:39:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TJd7X3041467; Wed, 29 Mar 2017 19:39:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TJd75n041466; Wed, 29 Mar 2017 19:39:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201703291939.v2TJd75n041466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 29 Mar 2017 19:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316175 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:39:08 -0000 Author: markj Date: Wed Mar 29 19:39:07 2017 New Revision: 316175 URL: https://svnweb.freebsd.org/changeset/base/316175 Log: Avoid sleeping when the mirror I/O queue is non-empty. A request may be queued while the queue lock is dropped when the mirror is being destroyed. The corresponding wakeup would be lost, possibly resulting in an apparent hang of the mirror worker thread. Tested by: pho (part of a larger patch) MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Mar 29 19:30:22 2017 (r316174) +++ head/sys/geom/mirror/g_mirror.c Wed Mar 29 19:39:07 2017 (r316175) @@ -1917,6 +1917,10 @@ g_mirror_worker(void *arg) kproc_exit(0); } mtx_lock(&sc->sc_queue_mtx); + if (bioq_first(&sc->sc_queue) != NULL) { + mtx_unlock(&sc->sc_queue_mtx); + continue; + } } sx_xunlock(&sc->sc_lock); /* From owner-svn-src-all@freebsd.org Wed Mar 29 19:59:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94C3DD24DED; Wed, 29 Mar 2017 19:59:17 +0000 (UTC) (envelope-from rwatson@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 5F394911; Wed, 29 Mar 2017 19:59:17 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TJw1KQ049418; Wed, 29 Mar 2017 19:58:01 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TJw0hT049410; Wed, 29 Mar 2017 19:58:00 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703291958.v2TJw0hT049410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 29 Mar 2017 19:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316176 - in head/sys: conf modules/dtrace modules/dtrace/dtaudit security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:59:17 -0000 Author: rwatson Date: Wed Mar 29 19:58:00 2017 New Revision: 316176 URL: https://svnweb.freebsd.org/changeset/base/316176 Log: Add an experimental DTrace audit provider, which allows users of DTrace to instrument security event auditing rather than relying on conventional BSM trail files or audit pipes: - Add a set of per-event 'commit' probes, which provide access to particular auditable events at the time of commit in system-call return. These probes gain access to audit data via the in-kernel audit_record data structure, providing convenient access to system-call arguments and return values in a single probe. - Add a set of per-event 'bsm' probes, which provide access to particular auditable events at the time of BSM record generation in the audit worker thread. These probes have access to the in-kernel audit_record data structure and BSM representation as would be written to a trail file or audit pipe -- i.e., asynchronously in the audit worker thread. DTrace probe arguments consist of the name of the audit event (to support future mechanisms of instrumenting multiple events via a single probe -- e.g., using classes), a pointer to the in-kernel audit record, and an optional pointer to the BSM data and its length. For human convenience, upper-case audit event names (AUE_...) are converted to lower case in DTrace. DTrace scripts can now cause additional audit-based data to be collected on system calls, and inspect internal and BSM representations of the data. They do not affect data captured in the audit trail or audit pipes configured in the system. auditd(8) must be configured and running in order to provide a database of event information, as well as other audit configuration parameters (e.g., to capture command-line arguments or environmental variables) for the provider to operate. Reviewed by: gnn, jonathan, markj Sponsored by: DARPA, AFRL MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D10149 Added: head/sys/modules/dtrace/dtaudit/ head/sys/modules/dtrace/dtaudit/Makefile (contents, props changed) head/sys/security/audit/audit_dtrace.c (contents, props changed) Modified: head/sys/conf/files head/sys/modules/dtrace/Makefile head/sys/security/audit/audit.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h head/sys/security/audit/audit_worker.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Mar 29 19:39:07 2017 (r316175) +++ head/sys/conf/files Wed Mar 29 19:58:00 2017 (r316176) @@ -4593,6 +4593,7 @@ security/audit/audit.c optional audit security/audit/audit_arg.c optional audit security/audit/audit_bsm.c optional audit security/audit/audit_bsm_klib.c optional audit +security/audit/audit_dtrace.c optional dtaudit audit | dtraceall audit compile-with "${CDDL_C}" security/audit/audit_pipe.c optional audit security/audit/audit_syscalls.c standard security/audit/audit_trigger.c optional audit Modified: head/sys/modules/dtrace/Makefile ============================================================================== --- head/sys/modules/dtrace/Makefile Wed Mar 29 19:39:07 2017 (r316175) +++ head/sys/modules/dtrace/Makefile Wed Mar 29 19:58:00 2017 (r316176) @@ -2,7 +2,8 @@ .include "Makefile.inc" -SUBDIR= dtmalloc \ +SUBDIR= dtaudit \ + dtmalloc \ dtnfscl \ dtrace \ dtraceall \ Added: head/sys/modules/dtrace/dtaudit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtrace/dtaudit/Makefile Wed Mar 29 19:58:00 2017 (r316176) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +SYSDIR?= ${.CURDIR}/../../.. + +.PATH: ${SYSDIR}/security/audit + +KMOD= dtaudit +SRCS= audit_dtrace.c \ + vnode_if.h + +CFLAGS+= -I${SYSDIR}/cddl/compat/opensolaris \ + -I${SYSDIR}/cddl/contrib/opensolaris/uts/common \ + -I${SYSDIR} + +.include + +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Wed Mar 29 19:39:07 2017 (r316175) +++ head/sys/security/audit/audit.c Wed Mar 29 19:58:00 2017 (r316176) @@ -1,8 +1,13 @@ /*- * Copyright (c) 1999-2005 Apple Inc. - * Copyright (c) 2006-2007 Robert N. M. Watson + * Copyright (c) 2006-2007, 2016 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -162,6 +167,20 @@ struct cv audit_watermark_cv; static struct cv audit_fail_cv; /* + * Optional DTrace audit provider support: function pointers for preselection + * and commit events. + */ +#ifdef KDTRACE_HOOKS +void *(*dtaudit_hook_preselect)(au_id_t auid, au_event_t event, + au_class_t class); +int (*dtaudit_hook_commit)(struct kaudit_record *kar, au_id_t auid, + au_event_t event, au_class_t class, int sorf); +void (*dtaudit_hook_bsm)(struct kaudit_record *kar, au_id_t auid, + au_event_t event, au_class_t class, int sorf, + void *bsm_data, size_t bsm_lenlen); +#endif + +/* * Kernel audit information. This will store the current audit address * or host information that the kernel will use when it's generating * audit records. This data is modified by the A_GET{SET}KAUDIT auditon(2) @@ -410,6 +429,10 @@ audit_commit(struct kaudit_record *ar, i if (ar == NULL) return; + ar->k_ar.ar_errno = error; + ar->k_ar.ar_retval = retval; + nanotime(&ar->k_ar.ar_endtime); + /* * Decide whether to commit the audit record by checking the error * value from the system call and using the appropriate audit mask. @@ -461,8 +484,21 @@ audit_commit(struct kaudit_record *ar, i if (audit_pipe_preselect(auid, event, class, sorf, ar->k_ar_commit & AR_PRESELECT_TRAIL) != 0) ar->k_ar_commit |= AR_PRESELECT_PIPE; +#ifdef KDTRACE_HOOKS + /* + * Expose the audit record to DTrace, both to allow the "commit" probe + * to fire if it's desirable, and also to allow a decision to be made + * about later firing with BSM in the audit worker. + */ + if (dtaudit_hook_commit != NULL) { + if (dtaudit_hook_commit(ar, auid, event, class, sorf) != 0) + ar->k_ar_commit |= AR_PRESELECT_DTRACE; + } +#endif + if ((ar->k_ar_commit & (AR_PRESELECT_TRAIL | AR_PRESELECT_PIPE | - AR_PRESELECT_USER_TRAIL | AR_PRESELECT_USER_PIPE)) == 0) { + AR_PRESELECT_USER_TRAIL | AR_PRESELECT_USER_PIPE | + AR_PRESELECT_DTRACE)) == 0) { mtx_lock(&audit_mtx); audit_pre_q_len--; mtx_unlock(&audit_mtx); @@ -470,10 +506,6 @@ audit_commit(struct kaudit_record *ar, i return; } - ar->k_ar.ar_errno = error; - ar->k_ar.ar_retval = retval; - nanotime(&ar->k_ar.ar_endtime); - /* * Note: it could be that some records initiated while audit was * enabled should still be committed? @@ -510,9 +542,13 @@ void audit_syscall_enter(unsigned short code, struct thread *td) { struct au_mask *aumask; +#ifdef KDTRACE_HOOKS + void *dtaudit_state; +#endif au_class_t class; au_event_t event; au_id_t auid; + int record_needed; KASSERT(td->td_ar == NULL, ("audit_syscall_enter: td->td_ar != NULL")); KASSERT((td->td_pflags & TDP_AUDITREC) == 0, @@ -544,8 +580,8 @@ audit_syscall_enter(unsigned short code, aumask = &td->td_ucred->cr_audit.ai_mask; /* - * Allocate an audit record, if preselection allows it, and store in - * the thread for later use. + * Determine whether trail or pipe preselection would like an audit + * record allocated for this system call. */ class = au_event_class(event); if (au_preselect(event, class, aumask, AU_PRS_BOTH)) { @@ -566,13 +602,51 @@ audit_syscall_enter(unsigned short code, cv_wait(&audit_fail_cv, &audit_mtx); panic("audit_failing_stop: thread continued"); } - td->td_ar = audit_new(event, td); - if (td->td_ar != NULL) - td->td_pflags |= TDP_AUDITREC; + record_needed = 1; } else if (audit_pipe_preselect(auid, event, class, AU_PRS_BOTH, 0)) { + record_needed = 1; + } else { + record_needed = 0; + } + + /* + * After audit trails and pipes have made their policy choices, DTrace + * may request that records be generated as well. This is a slightly + * complex affair, as the DTrace audit provider needs the audit + * framework to maintain some state on the audit record, which has not + * been allocated at the point where the decision has to be made. + * This hook must run even if we are not changing the decision, as + * DTrace may want to stick event state onto a record we were going to + * produce due to the trail or pipes. The event state returned by the + * DTrace provider must be safe without locks held between here and + * below -- i.e., dtaudit_state must must refer to stable memory. + */ +#ifdef KDTRACE_HOOKS + dtaudit_state = NULL; + if (dtaudit_hook_preselect != NULL) { + dtaudit_state = dtaudit_hook_preselect(auid, event, class); + if (dtaudit_state != NULL) + record_needed = 1; + } +#endif + + /* + * If a record is required, allocate it and attach it to the thread + * for use throughout the system call. Also attach DTrace state if + * required. + * + * XXXRW: If we decide to reference count the evname_elem underlying + * dtaudit_state, we will need to free here if no record is allocated + * or allocatable. + */ + if (record_needed) { td->td_ar = audit_new(event, td); - if (td->td_ar != NULL) + if (td->td_ar != NULL) { td->td_pflags |= TDP_AUDITREC; +#ifdef KDTRACE_HOOKS + td->td_ar->k_dtaudit_state = dtaudit_state; +#endif + } } else td->td_ar = NULL; } Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Wed Mar 29 19:39:07 2017 (r316175) +++ head/sys/security/audit/audit_bsm_klib.c Wed Mar 29 19:58:00 2017 (r316176) @@ -362,6 +362,35 @@ au_evnamemap_foreach(au_evnamemap_callba EVNAMEMAP_WUNLOCK(); } +#ifdef KDTRACE_HOOKS +/* + * Look up an event-to-name mapping table entry by event number. As evname + * elements are stable in memory, we can return the pointer without the table + * lock held -- but the caller will need to lock the element mutex before + * accessing element fields. + * + * NB: the event identifier in elements is stable and can be read without + * holding the evname_elem lock. + */ +struct evname_elem * +au_evnamemap_lookup(au_event_t event) +{ + struct evname_list *enl; + struct evname_elem *ene; + + EVNAMEMAP_RLOCK(); + enl = &evnamemap_hash[event % EVNAMEMAP_HASH_TABLE_SIZE]; + LIST_FOREACH(ene, &enl->enl_head, ene_entry) { + if (ene->ene_event == event) + goto out; + } + ene = NULL; +out: + EVNAMEMAP_RUNLOCK(); + return (ene); +} +#endif /* !KDTRACE_HOOKS */ + /* * Convert sysctl names and present arguments to events. */ Added: head/sys/security/audit/audit_dtrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/audit/audit_dtrace.c Wed Mar 29 19:58:00 2017 (r316176) @@ -0,0 +1,532 @@ +/*- + * Copyright (c) 2016 Robert N. M. Watson + * 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 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +/*- + * Audit DTrace provider: allow DTrace to request that audit records be + * generated for various audit events, and then expose those records (in + * various forms) to probes. The model is that each event type has two + * probes, which use the event's name to create the probe: + * + * - "commit" passes the kernel-internal (unserialised) kaudit_record + * synchronously (from the originating thread) of the record as we prepare + * to "commit" the record to the audit queue. + * + * - "bsm" also passes generated BSM, and executes asynchronously in the audit + * worker thread, once it has been extracted from the audit queue. This is + * the point at which an audit record would be enqueued to the trail on + * disk, or to pipes. + * + * These probes support very different goals. The former executes in the + * thread originating the record, making it easier to correlate other DTrace + * probe activity with the event described in the record. The latter gives + * access to BSM-formatted events (at a cost) allowing DTrace to extract BSM + * directly an alternative mechanism to the formal audit trail and audit + * pipes. + * + * To generate names for numeric event IDs, userspace will push the contents + * of /etc/security/audit_event into the kernel during audit setup, much as it + * does /etc/security/audit_class. We then create the probes for each of + * those mappings. If one (or both) of the probes are enabled, then we cause + * a record to be generated (as both normal audit preselection and audit pipes + * do), and catch it on the way out during commit. There are suitable hook + * functions in the audit code that this provider can register to catch + * various events in the audit-record life cycle. + * + * Further ponderings: + * + * - How do we want to handle events for which there are not names -- perhaps + * a catch-all probe for those events without mappings? + * + * - Should the evname code really be present even if DTrace isn't loaded...? + * Right now, we arrange that it is so that userspace can usefully maintain + * the list in case DTrace is later loaded (and to prevent userspace + * confusion). + * + * - Should we add an additional set of audit:class::commit probes that use + * event class names to match broader categories of events as specified in + * /etc/security/event_class? + * + * - If we pursue that last point, we will want to pass the name of the event + * into the probe explicitly (e.g., as arg0), since it would no longer be + * available as the probe function name. + */ + +static int dtaudit_unload(void); +static void dtaudit_getargdesc(void *, dtrace_id_t, void *, + dtrace_argdesc_t *); +static void dtaudit_provide(void *, dtrace_probedesc_t *); +static void dtaudit_destroy(void *, dtrace_id_t, void *); +static void dtaudit_enable(void *, dtrace_id_t, void *); +static void dtaudit_disable(void *, dtrace_id_t, void *); +static void dtaudit_load(void *); + +static dtrace_pattr_t dtaudit_attr = { +{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, +{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, +{ DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, +}; + +/* + * Strings for the "module" and "name" portions of the probe. The name of the + * audit event will be the "function" portion of the probe. All dtaudit + * probes therefore take the form audit:event::commit. + */ +static char *dtaudit_module_str = "event"; +static char *dtaudit_name_commit_str = "commit"; +static char *dtaudit_name_bsm_str = "bsm"; + +static dtrace_pops_t dtaudit_pops = { + .dtps_provide = dtaudit_provide, + .dtps_provide_module = NULL, + .dtps_enable = dtaudit_enable, + .dtps_disable = dtaudit_disable, + .dtps_suspend = NULL, + .dtps_resume = NULL, + .dtps_getargdesc = dtaudit_getargdesc, + .dtps_getargval = NULL, + .dtps_usermode = NULL, + .dtps_destroy = dtaudit_destroy +}; + +static dtrace_provider_id_t dtaudit_id; + +/* + * Because looking up entries in the event-to-name mapping is quite expensive, + * maintain a global flag tracking whether any dtaudit probes are enabled. If + * not, don't bother doing all that work whenever potential queries about + * events turn up during preselection or commit. + */ +static uint_t dtaudit_probes_enabled; + +/* + * Check dtaudit policy for the event to see whether this is an event we would + * like to preselect (i.e., cause an audit record to be generated for). To + * minimise probe effect when not used at all, we not only check for the probe + * on the individual event, but also a global flag indicating that at least + * one probe is enabled, before acquiring locks, searching lists, etc. + * + * If the event is selected, return an evname_elem reference to be stored in + * the audit record, which we can use later to avoid further lookups. The + * contents of the evname_elem must be sufficiently stable so as to not risk + * race conditions here. + * + * Currently, we take an interest only in the 'event' argument, but in the + * future might want to support other types of record selection tied to + * additional probe types (e.g., event clases). + * + * XXXRW: Should we have a catch-all probe here for events without registered + * names? + */ +static void * +dtaudit_preselect(au_id_t auid, au_event_t event, au_class_t class) +{ + struct evname_elem *ene; + int probe_enabled; + + /* + * NB: Lockless reads here may return a slightly stale value; this is + * considered better than acquiring a lock, however. + */ + if (!dtaudit_probes_enabled) + return (NULL); + ene = au_evnamemap_lookup(event); + if (ene == NULL) + return (NULL); + + /* + * See if either of the two probes for the audit event are enabled. + * + * NB: Lock also not acquired here -- but perhaps it wouldn't matter + * given that we've already used the list lock above? + * + * XXXRW: Alternatively, au_evnamemap_lookup() could return these + * values while holding the list lock...? + */ + probe_enabled = ene->ene_commit_probe_enabled || + ene->ene_bsm_probe_enabled; + if (!probe_enabled) + return (NULL); + return ((void *)ene); +} + +/* + * Commit probe pre-BSM. Fires the probe but also checks to see if we should + * ask the audit framework to call us again with BSM arguments in the audit + * worker thread. + * + * XXXRW: Should we have a catch-all probe here for events without registered + * names? + */ +static int +dtaudit_commit(struct kaudit_record *kar, au_id_t auid, au_event_t event, + au_class_t class, int sorf) +{ + char ene_name_lower[EVNAMEMAP_NAME_SIZE]; + struct evname_elem *ene; + int i; + + ene = (struct evname_elem *)kar->k_dtaudit_state; + if (ene == NULL) + return (0); + + /* + * Process a possibly registered commit probe. + */ + if (ene->ene_commit_probe_enabled) { + /* + * XXXRW: Lock ene to provide stability to the name string. A + * bit undesirable! We may want another locking strategy + * here. At least we don't run the DTrace probe under the + * lock. + * + * XXXRW: We provide the struct audit_record pointer -- but + * perhaps should provide the kaudit_record pointer? + */ + EVNAME_LOCK(ene); + for (i = 0; i < sizeof(ene_name_lower); i++) + ene_name_lower[i] = tolower(ene->ene_name[i]); + EVNAME_UNLOCK(ene); + dtrace_probe(ene->ene_commit_probe_id, + (uintptr_t)ene_name_lower, (uintptr_t)&kar->k_ar, 0, 0, 0); + } + + /* + * Return the state of the BSM probe to the caller. + */ + return (ene->ene_bsm_probe_enabled); +} + +/* + * Commit probe post-BSM. + * + * XXXRW: Should we have a catch-all probe here for events without registered + * names? + */ +static void +dtaudit_bsm(struct kaudit_record *kar, au_id_t auid, au_event_t event, + au_class_t class, int sorf, void *bsm_data, size_t bsm_len) +{ + char ene_name_lower[EVNAMEMAP_NAME_SIZE]; + struct evname_elem *ene; + int i; + + ene = (struct evname_elem *)kar->k_dtaudit_state; + if (ene == NULL) + return; + if (!(ene->ene_bsm_probe_enabled)) + return; + + /* + * XXXRW: Lock ene to provide stability to the name string. A bit + * undesirable! We may want another locking strategy here. At least + * we don't run the DTrace probe under the lock. + * + * XXXRW: We provide the struct audit_record pointer -- but perhaps + * should provide the kaudit_record pointer? + */ + EVNAME_LOCK(ene); + for (i = 0; i < sizeof(ene_name_lower); i++) + ene_name_lower[i] = tolower(ene->ene_name[i]); + EVNAME_UNLOCK(ene); + dtrace_probe(ene->ene_bsm_probe_id, (uintptr_t)ene_name_lower, + (uintptr_t)&kar->k_ar, (uintptr_t)bsm_data, (uintptr_t)bsm_len, + 0); +} + +/* + * A very simple provider: argument types are identical across all probes: the + * kaudit_record, plus a BSM pointer and length. + */ +static void +dtaudit_getargdesc(void *arg, dtrace_id_t id, void *parg, + dtrace_argdesc_t *desc) +{ + struct evname_elem *ene; + const char *p; + + ene = (struct evname_elem *)parg; + p = NULL; + switch (desc->dtargd_ndx) { + case 0: + /* Audit event name. */ + p = "char *"; + break; + + case 1: + /* In-kernel audit record. */ + p = "struct audit_record *"; + break; + + case 2: + /* BSM data, if present. */ + if (id == ene->ene_bsm_probe_id) + p = "const void *"; + else + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + + case 3: + /* BSM length, if present. */ + if (id == ene->ene_bsm_probe_id) + p = "size_t"; + else + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + + default: + desc->dtargd_ndx = DTRACE_ARGNONE; + break; + } + if (p != NULL) + strlcpy(desc->dtargd_native, p, sizeof(desc->dtargd_native)); +} + +/* + * Callback from the event-to-name mapping code when performing + * evname_foreach(). Note that we may update the entry, so the foreach code + * must have a write lock. However, as the synchronisation model is private + * to the evname code, we cannot easily assert it here. + * + * XXXRW: How do we want to handle event rename / collision issues here -- + * e.g., if userspace was using a name to point to one event number, and then + * changes it so that the name points at another? For now, paper over this by + * skipping event numbers that are already registered, and likewise skipping + * names that are already registered. However, this could lead to confusing + * behaviour so possibly needs to be resolved in the longer term. + */ +static void +dtaudit_au_evnamemap_callback(struct evname_elem *ene) +{ + char ene_name_lower[EVNAMEMAP_NAME_SIZE]; + int i; + + /* + * DTrace, by convention, has lower-case probe names. However, the + * in-kernel event-to-name mapping table must maintain event-name case + * as submitted by userspace. Create a temporary lower-case version + * here, away from the fast path, to use when exposing the event name + * to DTrace as part of the name of a probe. + * + * NB: Convert the entire array, including the terminating nul, + * because these strings are short and it's more work not to. If they + * become long, we might feel more guilty about this sloppiness! + */ + for (i = 0; i < sizeof(ene_name_lower); i++) + ene_name_lower[i] = tolower(ene->ene_name[i]); + + /* + * Don't register a new probe if this event number already has an + * associated commit probe -- or if another event has already + * registered this name. + * + * XXXRW: There is an argument that if multiple numeric events match + * a single name, they should all be exposed to the same named probe. + * In particular, we should perhaps use a probe ID returned by this + * lookup and just stick that in the saved probe ID? + */ + if ((ene->ene_commit_probe_id == 0) && + (dtrace_probe_lookup(dtaudit_id, dtaudit_module_str, + ene_name_lower, dtaudit_name_commit_str) == 0)) { + + /* + * Create the commit probe. + * + * NB: We don't declare any extra stack frames because stack() + * will just return the path to the audit commit code, which + * is not really interesting anyway. + * + * We pass in the pointer to the evnam_elem entry so that we + * can easily change its enabled flag in the probe + * enable/disable interface. + */ + ene->ene_commit_probe_id = dtrace_probe_create(dtaudit_id, + dtaudit_module_str, ene_name_lower, + dtaudit_name_commit_str, 0, ene); + } + + /* + * Don't register a new probe if this event number already has an + * associated bsm probe -- or if another event has already + * registered this name. + * + * XXXRW: There is an argument that if multiple numeric events match + * a single name, they should all be exposed to the same named probe. + * In particular, we should perhaps use a probe ID returned by this + * lookup and just stick that in the saved probe ID? + */ + if ((ene->ene_bsm_probe_id == 0) && + (dtrace_probe_lookup(dtaudit_id, dtaudit_module_str, + ene_name_lower, dtaudit_name_bsm_str) == 0)) { + + /* + * Create the bsm probe. + * + * NB: We don't declare any extra stack frames because stack() + * will just return the path to the audit commit code, which + * is not really interesting anyway. + * + * We pass in the pointer to the evnam_elem entry so that we + * can easily change its enabled flag in the probe + * enable/disable interface. + */ + ene->ene_bsm_probe_id = dtrace_probe_create(dtaudit_id, + dtaudit_module_str, ene_name_lower, dtaudit_name_bsm_str, + 0, ene); + } +} + +static void +dtaudit_provide(void *arg, dtrace_probedesc_t *desc) +{ + + /* + * Walk all registered number-to-name mapping entries, and ensure each + * is properly registered. + */ + au_evnamemap_foreach(dtaudit_au_evnamemap_callback); +} + +static void +dtaudit_destroy(void *arg, dtrace_id_t id, void *parg) +{ +} + +static void +dtaudit_enable(void *arg, dtrace_id_t id, void *parg) +{ + struct evname_elem *ene; + + ene = parg; + KASSERT(ene->ene_commit_probe_id == id || ene->ene_bsm_probe_id == id, + ("%s: probe ID mismatch (%u, %u != %u)", __func__, + ene->ene_commit_probe_id, ene->ene_bsm_probe_id, id)); + + if (id == ene->ene_commit_probe_id) + ene->ene_commit_probe_enabled = 1; + else + ene->ene_bsm_probe_enabled = 1; + refcount_acquire(&dtaudit_probes_enabled); +} + +static void +dtaudit_disable(void *arg, dtrace_id_t id, void *parg) +{ + struct evname_elem *ene; + + ene = parg; + KASSERT(ene->ene_commit_probe_id == id || ene->ene_bsm_probe_id == id, + ("%s: probe ID mismatch (%u, %u != %u)", __func__, + ene->ene_commit_probe_id, ene->ene_bsm_probe_id, id)); + + if (id == ene->ene_commit_probe_id) + ene->ene_commit_probe_enabled = 0; + else + ene->ene_bsm_probe_enabled = 0; + (void)refcount_release(&dtaudit_probes_enabled); +} + +static void +dtaudit_load(void *dummy) +{ + + if (dtrace_register("audit", &dtaudit_attr, DTRACE_PRIV_USER, NULL, + &dtaudit_pops, NULL, &dtaudit_id) != 0) + return; + dtaudit_hook_preselect = dtaudit_preselect; + dtaudit_hook_commit = dtaudit_commit; + dtaudit_hook_bsm = dtaudit_bsm; +} + +static int +dtaudit_unload(void) +{ + int error; + + dtaudit_hook_preselect = NULL; + dtaudit_hook_commit = NULL; + dtaudit_hook_bsm = NULL; + if ((error = dtrace_unregister(dtaudit_id)) != 0) + return (error); + return (0); +} + +static int +dtaudit_modevent(module_t mod __unused, int type, void *data __unused) +{ + int error = 0; + + switch (type) { + case MOD_LOAD: + case MOD_UNLOAD: + case MOD_SHUTDOWN: + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + +SYSINIT(dtaudit_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, dtaudit_load, + NULL); +SYSUNINIT(dtaudit_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, + dtaudit_unload, NULL); + +DEV_MODULE(dtaudit, dtaudit_modevent, NULL); +MODULE_VERSION(dtaudit, 1); +MODULE_DEPEND(dtaudit, dtrace, 1, 1, 1); +MODULE_DEPEND(dtaudit, opensolaris, 1, 1, 1); Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Wed Mar 29 19:39:07 2017 (r316175) +++ head/sys/security/audit/audit_private.h Wed Mar 29 19:58:00 2017 (r316176) @@ -94,6 +94,8 @@ extern int audit_arge; #define AR_PRESELECT_USER_TRAIL 0x00004000U #define AR_PRESELECT_USER_PIPE 0x00008000U +#define AR_PRESELECT_DTRACE 0x00010000U + /* * Audit data is generated as a stream of struct audit_record structures, * linked by struct kaudit_record, and contain storage for possible audit so @@ -323,6 +325,9 @@ struct kaudit_record { void *k_udata; /* User data. */ u_int k_ulen; /* User data length. */ struct uthread *k_uthread; /* Audited thread. */ +#ifdef KDTRACE_HOOKS + void *k_dtaudit_state; +#endif TAILQ_ENTRY(kaudit_record) k_q; }; TAILQ_HEAD(kaudit_queue, kaudit_record); @@ -379,7 +384,7 @@ extern int audit_in_failure; * Audit event-to-name mapping structure, maintained in audit_bsm_klib.c. It * appears in this header so that the DTrace audit provider can dereference * instances passed back in the au_evname_foreach() callbacks. Safe access to - * its fields rquires holding ene_lock (after it is visible in the global + * its fields requires holding ene_lock (after it is visible in the global * table). * * Locking: @@ -393,6 +398,16 @@ struct evname_elem { char ene_name[EVNAMEMAP_NAME_SIZE]; /* (l) */ LIST_ENTRY(evname_elem) ene_entry; /* (m) */ struct mtx ene_lock; + +#ifdef KDTRACE_HOOKS + /* DTrace probe IDs; 0 if not yet registered. */ + uint32_t ene_commit_probe_id; /* (M) */ + uint32_t ene_bsm_probe_id; /* (M) */ + + /* Flags indicating if the probes enabled or not. */ + int ene_commit_probe_enabled; /* (M) */ + int ene_bsm_probe_enabled; /* (M) */ +#endif }; #define EVNAME_LOCK(ene) mtx_lock(&(ene)->ene_lock) @@ -403,6 +418,21 @@ struct evname_elem { */ typedef void (*au_evnamemap_callback_t)(struct evname_elem *ene); +/* + * DTrace audit provider (dtaudit) hooks -- to be set non-NULL when the audit + * provider is loaded and ready to be called into. + */ +#ifdef KDTRACE_HOOKS +extern void *(*dtaudit_hook_preselect)(au_id_t auid, au_event_t event, + au_class_t class); +extern int (*dtaudit_hook_commit)(struct kaudit_record *kar, + au_id_t auid, au_event_t event, au_class_t class, + int sorf); +extern void (*dtaudit_hook_bsm)(struct kaudit_record *kar, au_id_t auid, + au_event_t event, au_class_t class, int sorf, + void *bsm_data, size_t bsm_len); +#endif /* !KDTRACE_HOOKS */ + #include #include #include @@ -425,6 +455,9 @@ au_class_t au_event_class(au_event_t ev void au_evnamemap_init(void); void au_evnamemap_insert(au_event_t event, const char *name); void au_evnamemap_foreach(au_evnamemap_callback_t callback); +#ifdef KDTRACE_HOOKS +struct evname_elem *au_evnamemap_lookup(au_event_t event); +#endif int au_event_name(au_event_t event, char *name); au_event_t audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg); au_event_t audit_flags_and_error_to_openevent(int oflags, int error); Modified: head/sys/security/audit/audit_worker.c ============================================================================== --- head/sys/security/audit/audit_worker.c Wed Mar 29 19:39:07 2017 (r316175) +++ head/sys/security/audit/audit_worker.c Wed Mar 29 19:58:00 2017 (r316176) @@ -1,8 +1,13 @@ /*- * Copyright (c) 1999-2008 Apple Inc. - * Copyright (c) 2006-2008 Robert N. M. Watson + * Copyright (c) 2006-2008, 2016 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -362,7 +367,8 @@ audit_worker_process_record(struct kaudi if (!(ar->k_ar_commit & AR_COMMIT_KERNEL) || ((ar->k_ar_commit & AR_PRESELECT_PIPE) == 0 && - (ar->k_ar_commit & AR_PRESELECT_TRAIL) == 0)) + (ar->k_ar_commit & AR_PRESELECT_TRAIL) == 0 && + (ar->k_ar_commit & AR_PRESELECT_DTRACE) == 0)) goto out; auid = ar->k_ar.ar_subj_auid; @@ -399,6 +405,17 @@ audit_worker_process_record(struct kaudi ar->k_ar_commit & AR_PRESELECT_TRAIL, bsm->data, bsm->len); +#ifdef KDTRACE_HOOKS + /* + * Version of the dtaudit commit hook that accepts BSM. + */ + if (ar->k_ar_commit & AR_PRESELECT_DTRACE) { + if (dtaudit_hook_bsm != NULL) + dtaudit_hook_bsm(ar, auid, event, class, sorf, + bsm->data, bsm->len); + } +#endif + kau_free(bsm); out: if (locked) From owner-svn-src-all@freebsd.org Wed Mar 29 20:49:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0885ED24F8C; Wed, 29 Mar 2017 20:49:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D76C21E57; Wed, 29 Mar 2017 20:49:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TKnfsD070708; Wed, 29 Mar 2017 20:49:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TKnfwg070702; Wed, 29 Mar 2017 20:49:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703292049.v2TKnfwg070702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 29 Mar 2017 20:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316177 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 20:49:43 -0000 Author: emaste Date: Wed Mar 29 20:49:41 2017 New Revision: 316177 URL: https://svnweb.freebsd.org/changeset/base/316177 Log: makefs: sync with NetBSD This is a collection of minor changes as diff reduction against NetBSD. NetBSD revs: cd9660.c 1.39 cd9660.h 1.19 makefs.c 1.34 Obtained from: NetBSD Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/cd9660.c head/usr.sbin/makefs/cd9660.h head/usr.sbin/makefs/makefs.c head/usr.sbin/makefs/makefs.h head/usr.sbin/makefs/walk.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Wed Mar 29 19:58:00 2017 (r316176) +++ head/usr.sbin/makefs/cd9660.c Wed Mar 29 20:49:41 2017 (r316177) @@ -162,6 +162,7 @@ static cd9660node *cd9660_create_directo cd9660node *, cd9660node *); static cd9660node *cd9660_create_special_directory(iso9660_disk *, u_char, cd9660node *); +static int cd9660_add_generic_bootimage(iso9660_disk *, const char *); /* @@ -2159,7 +2160,7 @@ cd9660_create_special_directory(iso9660_ return temp; } -int +static int cd9660_add_generic_bootimage(iso9660_disk *diskStructure, const char *bootimage) { struct stat stbuf; Modified: head/usr.sbin/makefs/cd9660.h ============================================================================== --- head/usr.sbin/makefs/cd9660.h Wed Mar 29 19:58:00 2017 (r316176) +++ head/usr.sbin/makefs/cd9660.h Wed Mar 29 20:49:41 2017 (r316177) @@ -322,7 +322,6 @@ void cd9660_time_915(unsigned char *, /*** Boot Functions ***/ int cd9660_write_generic_bootimage(FILE *); -int cd9660_add_generic_bootimage(iso9660_disk *, const char *); int cd9660_write_boot(iso9660_disk *, FILE *); int cd9660_add_boot_disk(iso9660_disk *, const char *); int cd9660_eltorito_add_boot_option(iso9660_disk *, const char *, Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Wed Mar 29 19:58:00 2017 (r316176) +++ head/usr.sbin/makefs/makefs.c Wed Mar 29 20:49:41 2017 (r316177) @@ -84,7 +84,6 @@ struct stat stampst; static fstype_t *get_fstype(const char *); static int get_tstamp(const char *, struct stat *); static void usage(fstype_t *, fsinfo_t *); -int main(int, char *[]); int main(int argc, char *argv[]) Modified: head/usr.sbin/makefs/makefs.h ============================================================================== --- head/usr.sbin/makefs/makefs.h Wed Mar 29 19:58:00 2017 (r316176) +++ head/usr.sbin/makefs/makefs.h Wed Mar 29 20:49:41 2017 (r316177) @@ -186,7 +186,7 @@ DECLARE_FUN(cd9660); extern u_int debug; extern int dupsok; extern struct timespec start_time; -extern struct stat stampst; +extern struct stat stampst; /* * If -x is specified, we want to exclude nodes which do not appear Modified: head/usr.sbin/makefs/walk.c ============================================================================== --- head/usr.sbin/makefs/walk.c Wed Mar 29 19:58:00 2017 (r316176) +++ head/usr.sbin/makefs/walk.c Wed Mar 29 20:49:41 2017 (r316177) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -50,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include "makefs.h" #include "mtree.h" From owner-svn-src-all@freebsd.org Wed Mar 29 21:04:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10941D24430; Wed, 29 Mar 2017 21:04:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2117EA5; Wed, 29 Mar 2017 21:04:40 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TL4dSv078508; Wed, 29 Mar 2017 21:04:39 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TL4d32078507; Wed, 29 Mar 2017 21:04:39 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201703292104.v2TL4d32078507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Mar 2017 21:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316178 - head/usr.sbin/rrenumd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:04:41 -0000 Author: cem Date: Wed Mar 29 21:04:39 2017 New Revision: 316178 URL: https://svnweb.freebsd.org/changeset/base/316178 Log: rrenumd(8): Fix a trivial Coverity warning Coverity warns that it is invalid to access following struct members by accessing the current struct member pointer plus one. Assuming the compilers aren't abusing this kind of UB yet, this cleanup isn't a functional change. Reported by: Coverity CID: 1368713 Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/rrenumd/parser.y Modified: head/usr.sbin/rrenumd/parser.y ============================================================================== --- head/usr.sbin/rrenumd/parser.y Wed Mar 29 20:49:41 2017 (r316177) +++ head/usr.sbin/rrenumd/parser.y Wed Mar 29 21:04:39 2017 (r316178) @@ -336,8 +336,8 @@ match_prefix_definition: struct icmp6_router_renum *irr; struct rr_pco_match *rpm; - irr = (struct icmp6_router_renum *)&ple_cur.pl_irr; - rpm = (struct rr_pco_match *)(irr + 1); + irr = &ple_cur.pl_irr; + rpm = &ple_cur.pl_rpm; memset(rpm, 0, sizeof(*rpm)); rpm->rpm_code = $1; From owner-svn-src-all@freebsd.org Wed Mar 29 21:27:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4823BD24C10; Wed, 29 Mar 2017 21:27:30 +0000 (UTC) (envelope-from cem@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 0AF52A82; Wed, 29 Mar 2017 21:27:29 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TLQE5M087163; Wed, 29 Mar 2017 21:26:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TLQEhP087162; Wed, 29 Mar 2017 21:26:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201703292126.v2TLQEhP087162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Mar 2017 21:26:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316179 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:27:30 -0000 Author: cem Date: Wed Mar 29 21:26:13 2017 New Revision: 316179 URL: https://svnweb.freebsd.org/changeset/base/316179 Log: t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflow msgsnd's msgsz argument is the size of the message following the 'long' message type. Don't include the message type in the size of the message when invoking msgsnd(2). Reported by: Coverity CID: 1368712 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Wed Mar 29 21:04:39 2017 (r316178) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Wed Mar 29 21:26:13 2017 (r316179) @@ -234,7 +234,7 @@ ATF_TC_BODY(msgsnd_nonblock, tc) for (;;) { errno = 0; - rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); + rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); if (rv == -1 && errno == EAGAIN) _exit(EXIT_SUCCESS); From owner-svn-src-all@freebsd.org Wed Mar 29 21:29:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4EFCD24CBB; Wed, 29 Mar 2017 21:29:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A61EC59; Wed, 29 Mar 2017 21:29:22 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TLTLWd087290; Wed, 29 Mar 2017 21:29:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TLTLkG087289; Wed, 29 Mar 2017 21:29:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201703292129.v2TLTLkG087289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Mar 2017 21:29:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316180 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:29:22 -0000 Author: cem Date: Wed Mar 29 21:29:21 2017 New Revision: 316180 URL: https://svnweb.freebsd.org/changeset/base/316180 Log: Follow-up to r316179: More of the same Reported by: Coverity CIDs: 1368705, 1368706, 1368707, 1368710 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Wed Mar 29 21:26:13 2017 (r316179) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Wed Mar 29 21:29:21 2017 (r316180) @@ -98,7 +98,7 @@ ATF_TC_BODY(msgsnd_block, tc) */ for (;;) { - if (msgsnd(id, &msg, sizeof(struct msg), 0) < 0) + if (msgsnd(id, &msg, sizeof(msg.buf), 0) < 0) _exit(EXIT_FAILURE); } } @@ -140,7 +140,7 @@ ATF_TC_BODY(msgsnd_count, tc) for (;;) { errno = 0; - rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); + rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); if (rv == 0) { i++; @@ -184,12 +184,12 @@ ATF_TC_BODY(msgsnd_err, tc) errno = 0; ATF_REQUIRE_ERRNO(EFAULT, msgsnd(id, (void *)-1, - sizeof(struct msg), IPC_NOWAIT) == -1); + sizeof(msg.buf), IPC_NOWAIT) == -1); errno = 0; ATF_REQUIRE_ERRNO(EINVAL, msgsnd(-1, &msg, - sizeof(struct msg), IPC_NOWAIT) == -1); + sizeof(msg.buf), IPC_NOWAIT) == -1); errno = 0; @@ -200,7 +200,7 @@ ATF_TC_BODY(msgsnd_err, tc) msg.mtype = 0; ATF_REQUIRE_ERRNO(EINVAL, msgsnd(id, &msg, - sizeof(struct msg), IPC_NOWAIT) == -1); + sizeof(msg.buf), IPC_NOWAIT) == -1); ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0); } @@ -299,7 +299,7 @@ ATF_TC_BODY(msgsnd_perm, tc) errno = 0; - if (msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT) == 0) + if (msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT) == 0) _exit(EXIT_FAILURE); if (errno != EACCES) From owner-svn-src-all@freebsd.org Wed Mar 29 21:29:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27F65D24D22; Wed, 29 Mar 2017 21:29:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0678AD55; Wed, 29 Mar 2017 21:29:43 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id DB50510A7B9; Wed, 29 Mar 2017 17:29:34 -0400 (EDT) From: John Baldwin To: Ngie Cooper Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 Date: Wed, 29 Mar 2017 14:27:59 -0700 Message-ID: <7448826.asYms2TLO2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201703290930.v2T9U3x9087583@repo.freebsd.org> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 29 Mar 2017 17:29:34 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:29:44 -0000 On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote: > Author: ngie > Date: Wed Mar 29 09:30:03 2017 > New Revision: 316132 > URL: https://svnweb.freebsd.org/changeset/base/316132 > > Log: > Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... > > This is being done to make it easier to change in the future--this action might be > needed sooner rather than later because of gcc 6.3.0 bailing, stating that there > is negative free space left (deficit) in the boot2 bootloader. > > MFC after: 2 months > Sponsored by: Dell EMC Isilon This can't be changed. It's baked into the BSD disklabel format. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Mar 29 21:31:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79FCAD24DC0; Wed, 29 Mar 2017 21:31:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 474391AF; Wed, 29 Mar 2017 21:31:46 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TLVjaq090191; Wed, 29 Mar 2017 21:31:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TLVjBr090190; Wed, 29 Mar 2017 21:31:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201703292131.v2TLVjBr090190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 29 Mar 2017 21:31:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316181 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:31:46 -0000 Author: cem Date: Wed Mar 29 21:31:45 2017 New Revision: 316181 URL: https://svnweb.freebsd.org/changeset/base/316181 Log: t_msgctl: Fix the same msgsnd() misuse as t_msgsnd msgsnd(2)'s msgsz argument does not describe the full structure, only the message component. Reported by: Coverity CIDs: 1368703, 1368711 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Wed Mar 29 21:29:21 2017 (r316180) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Wed Mar 29 21:31:45 2017 (r316181) @@ -203,7 +203,7 @@ ATF_TC_BODY(msgctl_pid, tc) if (pid == 0) { - (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); + (void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); _exit(EXIT_SUCCESS); } @@ -314,7 +314,7 @@ ATF_TC_BODY(msgctl_time, tc) t = time(NULL); (void)memset(&msgds, 0, sizeof(struct msqid_ds)); - (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); + (void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); (void)msgctl(id, IPC_STAT, &msgds); if (llabs(t - msgds.msg_stime) > 1) From owner-svn-src-all@freebsd.org Wed Mar 29 21:36:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76852D24006; Wed, 29 Mar 2017 21:36:13 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 3FC2E785; Wed, 29 Mar 2017 21:36:13 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 19FBD273B4; Wed, 29 Mar 2017 21:36:05 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id v2TLa5XK046813; Wed, 29 Mar 2017 21:36:05 GMT (envelope-from phk@phk.freebsd.dk) To: John Baldwin cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 In-reply-to: <7448826.asYms2TLO2@ralph.baldwin.cx> From: "Poul-Henning Kamp" References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <46811.1490823365.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Wed, 29 Mar 2017 21:36:05 +0000 Message-ID: <46812.1490823365@critter.freebsd.dk> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:36:13 -0000 -------- In message <7448826.asYms2TLO2@ralph.baldwin.cx>, John Baldwin writes: >On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote: >> Log: >> Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i3= 86/zfsboot/... >> = >> This is being done to make it easier to change in the future--this ac= tion might be >> needed sooner rather than later because of gcc 6.3.0 bailing, stating= that there >> is negative free space left (deficit) in the boot2 bootloader. >> = >> MFC after: 2 months >> Sponsored by: Dell EMC Isilon > >This can't be changed. It's baked into the BSD disklabel format. No it is not, it is baked into FFS, and for UFS2 0, 8, 64 and 256K works. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-svn-src-all@freebsd.org Wed Mar 29 21:55:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57269D24468 for ; Wed, 29 Mar 2017 21:55:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22a.google.com (mail-it0-x22a.google.com [IPv6:2607:f8b0:4001:c0b::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10FB07D3 for ; Wed, 29 Mar 2017 21:55:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id 190so64822745itm.0 for ; Wed, 29 Mar 2017 14:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5KhmQ6OQ86+YMJZOg+r5DUy4A7nKsF+HlZX4dH/z13Q=; b=nnTGvz8ctdCwFr2OaaFbemrso3Z9yO+pPTlfuBEon1/5BJJY8Kv+yfSMv6Q6MlFK7t 09d13LYKegWYWN9LiPUmVWhf9/wONcwLII7YYTCVmeGQEtnrNYIgPolJCA9ZC/Ocu9LE Bp1r1kwVwDGFuvqLCz5WQeIwKjkL2yBPRjAse07JloHrPnmpQQ/NbfxVd5kDyVNQpZcC 6Dniumf0kpLXIgXu9yNksbK7z3sLe1g9DafEdaPz/ytgt65uBHU50zbFFF8o0wpsk6V9 MfvNhyQ03bLMIwSvW9NjRs9TDlkzgLgflGDC3kSebCOqaTLsmmpRUW5DLHzGG/kdCAI8 cVFQ== 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=5KhmQ6OQ86+YMJZOg+r5DUy4A7nKsF+HlZX4dH/z13Q=; b=NmkCyVj0HLEZQWI9FmayVe8sP4mbUQZ1nUV7+zVJ4fGOQENe3xJfwgXFdq0wFatxe2 WFJ1XI47hig89alHIifh0IwHofSAd9GaIoo5nba+4N0RTczD0B7ARkPa9XcPfY/XlrJp Qhi1Y/5V7URndQsOHNBtt0ZVu/SUxJDGzQD18nkmjrznGNdzfkz/j8/JuuseT47mX6Bc XsnXodJrn76zna+w53HhbA/CxU1Eudz9YanVJ8jeiHvcM86U4TrXukeFXWOTworer/5D R6PWRxEGg3k07og28QsSnSvJ5GPZUO82CZVukMe+ubAu4h0LE5wMss5LQ6iLUUmoxq7y hjQg== X-Gm-Message-State: AFeK/H3mBcTEWDfHqNiI14+L/DKYDyHw33Op5O2BQ9Pnn1dEBI3LBY2Eg1bllBVlxc9R1kJkgO5QdDPwffJ2jg== X-Received: by 10.36.131.201 with SMTP id d192mr753425ite.60.1490824549316; Wed, 29 Mar 2017 14:55:49 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 14:55:48 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:a045:c633:4156:d07c] In-Reply-To: <46812.1490823365@critter.freebsd.dk> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> From: Warner Losh Date: Wed, 29 Mar 2017 15:55:48 -0600 X-Google-Sender-Auth: 6Otl0OE4bE7CC-cRdzqyeboBoIU Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Poul-Henning Kamp Cc: John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 21:55:50 -0000 On Wed, Mar 29, 2017 at 3:36 PM, Poul-Henning Kamp wrote: > -------- > In message <7448826.asYms2TLO2@ralph.baldwin.cx>, John Baldwin writes: >>On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote: > >>> Log: >>> Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... >>> >>> This is being done to make it easier to change in the future--this action might be >>> needed sooner rather than later because of gcc 6.3.0 bailing, stating that there >>> is negative free space left (deficit) in the boot2 bootloader. >>> >>> MFC after: 2 months >>> Sponsored by: Dell EMC Isilon >> >>This can't be changed. It's baked into the BSD disklabel format. > > No it is not, it is baked into FFS, and for UFS2 0, 8, 64 and 256K works. Technically, this is correct. Practically, I'm not sure we can ever really change it. There are too many tools, scripts, etc that just know it's 8k, even though most UFS2 systems start 64k into the volume. UFS1 systems are still around, and there the limit is a hard limit. And if we grow it, we run the risk of corrupting data beyond the 8k area we've traditionally used for this. So the constants are easy enough to change and it seems like it might be OK. However, doing it in a safe, anti-foot-shooting way will be the real elbow grease should someone seriously contemplate the change, especially since the foot-shooting involved has the potential for filesystem corruption... But gcc 6.3 likely just needs a little TLC experimenting with its different code generation flags... Warner From owner-svn-src-all@freebsd.org Wed Mar 29 22:13:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98FC4D24A90; Wed, 29 Mar 2017 22:13:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id B871084E; Wed, 29 Mar 2017 22:13:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Warner Losh , Poul-Henning Kamp Cc: John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> From: Jung-uk Kim Message-ID: Date: Wed, 29 Mar 2017 18:13:05 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dPDir1hwWEaXiXdl6lf46os4jIEP8hw0B" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 22:13:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dPDir1hwWEaXiXdl6lf46os4jIEP8hw0B Content-Type: multipart/mixed; boundary="uHRVEnkA3PMOjXCxlvWMHo3Hq4lbgtp3f"; protected-headers="v1" From: Jung-uk Kim To: Warner Losh , Poul-Henning Kamp Cc: John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> In-Reply-To: --uHRVEnkA3PMOjXCxlvWMHo3Hq4lbgtp3f Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 03/29/2017 17:55, Warner Losh wrote: > On Wed, Mar 29, 2017 at 3:36 PM, Poul-Henning Kamp = wrote: >> -------- >> In message <7448826.asYms2TLO2@ralph.baldwin.cx>, John Baldwin writes:= >>> On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote: >> >>>> Log: >>>> Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot= /i386/zfsboot/... >>>> >>>> This is being done to make it easier to change in the future--this= action might be >>>> needed sooner rather than later because of gcc 6.3.0 bailing, stat= ing that there >>>> is negative free space left (deficit) in the boot2 bootloader. >>>> >>>> MFC after: 2 months >>>> Sponsored by: Dell EMC Isilon >>> >>> This can't be changed. It's baked into the BSD disklabel format. >> >> No it is not, it is baked into FFS, and for UFS2 0, 8, 64 and 256K wor= ks. >=20 > Technically, this is correct. Practically, I'm not sure we can ever > really change it. There are too many tools, scripts, etc that just > know it's 8k, even though most UFS2 systems start 64k into the volume. > UFS1 systems are still around, and there the limit is a hard limit. > And if we grow it, we run the risk of corrupting data beyond the 8k > area we've traditionally used for this. >=20 > So the constants are easy enough to change and it seems like it might > be OK. However, doing it in a safe, anti-foot-shooting way will be the > real elbow grease should someone seriously contemplate the change, > especially since the foot-shooting involved has the potential for > filesystem corruption... >=20 > But gcc 6.3 likely just needs a little TLC experimenting with its > different code generation flags... Interestingly, we had the same discussion eons ago. http://docs.freebsd.org/cgi/mid.cgi?200509081418.47794.jkim FYI... Jung-uk Kim --uHRVEnkA3PMOjXCxlvWMHo3Hq4lbgtp3f-- --dPDir1hwWEaXiXdl6lf46os4jIEP8hw0B Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAljcMXYACgkQfJ+WJvzb 8UbRqwf+Onk9PYlWob5k8yCwrH9t3suOj2e47vUK3z3vVzMQLs7e6mvs1LZiLbaT +QS4LWlAleYh76x6wNqZQkI5hcQJBgsTWT7OSrUcARhHN5Pq1r32wUVVd+u4Nm8B hX5QDG4Lyt0rLFLTDVvEyjG3n1XlTgWFHQphrrm9+0pMF1Dw/1XZcB8EFkpoA/q1 P08F6meWB657O1lIi3aZUQ+GLnWsokAyZUv1NYtyOAGXheFSbY5Bhru03Kntmph0 H7zX5mmkClzBGqU9FHLQvqUmQfsbAhQgpD+sw/y7aj0G93NZp3Uwd5MsHqhCe/C4 xN5jz2riKfoh30ogOglFymt8KX1/yA== =k+UZ -----END PGP SIGNATURE----- --dPDir1hwWEaXiXdl6lf46os4jIEP8hw0B-- From owner-svn-src-all@freebsd.org Wed Mar 29 22:14:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3E62D24B20; Wed, 29 Mar 2017 22:14:32 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp001.me.com (st13p35im-asmtp001.me.com [17.164.199.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9DE2A11; Wed, 29 Mar 2017 22:14:32 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp001.me.com by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0ONL00L00K533M00@st13p35im-asmtp001.me.com>; Wed, 29 Mar 2017 22:14:11 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1490825651; bh=XoYj0W5a7xJTA/g4mEsH+Uf5RUNBBc7mP+vKoVJTvaU=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=g8j1EGTHzkEQDhsKiK8AL98FJu3hGTLzXaE1Vj8F4RtkOHpZSao3qE8UPnYP+Jtyg EeS2DOIM/g2oTHVV8YMsbkGMEMlr3QL4dpnAYDlH25TU8oyEcECB2iPvukgXMsikQ9 hKzeQc9wJUA21BxQ+1xivZZ16G+6jF74p3s/17aC+E1oanDFG5cO3wa4ofpggjdUC7 jWpiaqiIgW+Iq+phwLNuPzS0QNF4OfnGL8GI/yeX+kz8b53LHoJBFKLms/+PHrn/bS cztUM7l2RWWfQSKW+g3t8eI5fZwLjzHq4mbKyJHhDWqYNYYnW9xIeVkeOi4V4hKsD9 VEVjMvZOPBBgQ== Received: from icloud.com ([127.0.0.1]) by st13p35im-asmtp001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0ONL00CNEKFJRM20@st13p35im-asmtp001.me.com>; Wed, 29 Mar 2017 22:14:10 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-29_17:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=8 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1703290186 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 From: Toomas Soome In-reply-to: Date: Thu, 30 Mar 2017 01:14:06 +0300 Cc: Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> To: Warner Losh X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 22:14:32 -0000 > On 30. m=C3=A4rts 2017, at 0:55, Warner Losh wrote: >=20 > On Wed, Mar 29, 2017 at 3:36 PM, Poul-Henning Kamp = wrote: >> -------- >> In message <7448826.asYms2TLO2@ralph.baldwin.cx>, John Baldwin = writes: >>> On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote: >>=20 >>>> Log: >>>> Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to = sys/boot/i386/zfsboot/... >>>>=20 >>>> This is being done to make it easier to change in the future--this = action might be >>>> needed sooner rather than later because of gcc 6.3.0 bailing, = stating that there >>>> is negative free space left (deficit) in the boot2 bootloader. >>>>=20 >>>> MFC after: 2 months >>>> Sponsored by: Dell EMC Isilon >>>=20 >>> This can't be changed. It's baked into the BSD disklabel format. >>=20 >> No it is not, it is baked into FFS, and for UFS2 0, 8, 64 and 256K = works. >=20 > Technically, this is correct. Practically, I'm not sure we can ever > really change it. There are too many tools, scripts, etc that just > know it's 8k, even though most UFS2 systems start 64k into the volume. > UFS1 systems are still around, and there the limit is a hard limit. > And if we grow it, we run the risk of corrupting data beyond the 8k > area we've traditionally used for this. >=20 > So the constants are easy enough to change and it seems like it might > be OK. However, doing it in a safe, anti-foot-shooting way will be the > real elbow grease should someone seriously contemplate the change, > especially since the foot-shooting involved has the potential for > filesystem corruption... >=20 > But gcc 6.3 likely just needs a little TLC experimenting with its > different code generation flags... >=20 > Warner >=20 One thing is - for now we know the boot2 has not changed and we do not = really expect it to change in large scale anyhow. Second thing, yes the build process needs to be tested etc, and if = needed we can issue statement which compiler we support or not. And finally - if the space limit is really-really on the way and no = other way, then the alternate is to use freebsd-boot partition - nothing = new about it. rgds, toomas From owner-svn-src-all@freebsd.org Wed Mar 29 22:33:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6BCFD23495; Wed, 29 Mar 2017 22:33:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59A30197D; Wed, 29 Mar 2017 22:33:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TMXvT8015377; Wed, 29 Mar 2017 22:33:57 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TMXvot015371; Wed, 29 Mar 2017 22:33:57 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703292233.v2TMXvot015371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 29 Mar 2017 22:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316182 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 22:33:59 -0000 Author: rwatson Date: Wed Mar 29 22:33:56 2017 New Revision: 316182 URL: https://svnweb.freebsd.org/changeset/base/316182 Log: Hook up new audit event identifiers for various non-Orange Book/CAPP system calls supported by OpenBSM 1.2-alpha5. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/syscalls.master head/sys/kern/init_sysent.c head/sys/kern/syscalls.master head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar 29 21:31:45 2017 (r316181) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Mar 29 22:33:56 2017 (r316182) @@ -1139,7 +1139,7 @@ int freebsd10_freebsd32_pipe(struct thre #define FREEBSD32_SYS_AUE_ofreebsd32_sigprocmask AUE_SIGPROCMASK #define FREEBSD32_SYS_AUE_ofreebsd32_sigpending AUE_SIGPENDING #define FREEBSD32_SYS_AUE_freebsd32_sigaltstack AUE_SIGALTSTACK -#define FREEBSD32_SYS_AUE_freebsd32_ioctl AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ioctl AUE_IOCTL #define FREEBSD32_SYS_AUE_freebsd32_execve AUE_EXECVE #define FREEBSD32_SYS_AUE_ofreebsd32_fstat AUE_FSTAT #define FREEBSD32_SYS_AUE_ofreebsd32_getpagesize AUE_NULL @@ -1148,7 +1148,7 @@ int freebsd10_freebsd32_pipe(struct thre #define FREEBSD32_SYS_AUE_freebsd32_getitimer AUE_GETITIMER #define FREEBSD32_SYS_AUE_freebsd32_fcntl AUE_FCNTL #define FREEBSD32_SYS_AUE_freebsd32_select AUE_SELECT -#define FREEBSD32_SYS_AUE_ofreebsd32_sigreturn AUE_NULL +#define FREEBSD32_SYS_AUE_ofreebsd32_sigreturn AUE_SIGRETURN #define FREEBSD32_SYS_AUE_ofreebsd32_sigvec AUE_O_SIGVEC #define FREEBSD32_SYS_AUE_ofreebsd32_sigblock AUE_O_SIGBLOCK #define FREEBSD32_SYS_AUE_ofreebsd32_sigsetmask AUE_O_SIGSETMASK @@ -1194,48 +1194,48 @@ int freebsd10_freebsd32_pipe(struct thre #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_nanosleep AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2 AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_lio_listio AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_AIO_READ +#define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_AIO_WRITE +#define FREEBSD32_SYS_AUE_freebsd32_lio_listio AUE_LIO_LISTIO #define FREEBSD32_SYS_AUE_freebsd32_lutimes AUE_LUTIMES #define FREEBSD32_SYS_AUE_freebsd32_preadv AUE_PREADV #define FREEBSD32_SYS_AUE_freebsd32_pwritev AUE_PWRITEV #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_fhstatfs AUE_FHSTATFS #define FREEBSD32_SYS_AUE_freebsd32_modstat AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_kldstat AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_return AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_suspend AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_error AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_aio_read AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_aio_write AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_return AUE_AIO_RETURN +#define FREEBSD32_SYS_AUE_freebsd32_aio_suspend AUE_AIO_SUSPEND +#define FREEBSD32_SYS_AUE_freebsd32_aio_error AUE_AIO_ERROR +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_aio_read AUE_AIO_READ +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_aio_write AUE_AIO_WRITE +#define FREEBSD32_SYS_AUE_freebsd6_freebsd32_lio_listio AUE_LIO_LISTIO #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sendfile AUE_SENDFILE #define FREEBSD32_SYS_AUE_freebsd32_jail AUE_JAIL #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigaction AUE_SIGACTION #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_sigreturn AUE_SIGRETURN #define FREEBSD32_SYS_AUE_freebsd32_sigtimedwait AUE_SIGWAIT #define FREEBSD32_SYS_AUE_freebsd32_sigwaitinfo AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_waitcomplete AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_waitcomplete AUE_AIO_WAITCOMPLETE +#define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_nmount AUE_NMOUNT #define FREEBSD32_SYS_AUE_freebsd32_sendfile AUE_SENDFILE -#define FREEBSD32_SYS_AUE_freebsd32_ksem_init AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_ksem_open AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ksem_init AUE_SEMINIT +#define FREEBSD32_SYS_AUE_freebsd32_ksem_open AUE_SEMOPEN #define FREEBSD32_SYS_AUE_freebsd32_sigaction AUE_SIGACTION #define FREEBSD32_SYS_AUE_freebsd32_sigreturn AUE_SIGRETURN #define FREEBSD32_SYS_AUE_freebsd32_getcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_setcontext AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_swapcontext AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_ksem_timedwait AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ksem_timedwait AUE_SEMWAIT #define FREEBSD32_SYS_AUE_freebsd32_thr_suspend AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_umtx_op AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_kmq_open AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_kmq_setattr AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_kmq_timedreceive AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_kmq_timedsend AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_kmq_notify AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_aio_fsync AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_thr_new AUE_THR_NEW +#define FREEBSD32_SYS_AUE_freebsd32_kmq_open AUE_MQ_OPEN +#define FREEBSD32_SYS_AUE_freebsd32_kmq_setattr AUE_MQ_SETATTR +#define FREEBSD32_SYS_AUE_freebsd32_kmq_timedreceive AUE_MQ_TIMEDRECEIVE +#define FREEBSD32_SYS_AUE_freebsd32_kmq_timedsend AUE_MQ_TIMEDSEND +#define FREEBSD32_SYS_AUE_freebsd32_kmq_notify AUE_MQ_NOTIFY +#define FREEBSD32_SYS_AUE_freebsd32_aio_fsync AUE_AIO_FSYNC #define FREEBSD32_SYS_AUE_freebsd32_pread AUE_PREAD #define FREEBSD32_SYS_AUE_freebsd32_pwrite AUE_PWRITE #define FREEBSD32_SYS_AUE_freebsd32_mmap AUE_MMAP @@ -1256,23 +1256,23 @@ int freebsd10_freebsd32_pipe(struct thre #define FREEBSD32_SYS_AUE_freebsd32_fexecve AUE_FEXECVE #define FREEBSD32_SYS_AUE_freebsd32_fstatat AUE_FSTATAT #define FREEBSD32_SYS_AUE_freebsd32_futimesat AUE_FUTIMESAT -#define FREEBSD32_SYS_AUE_freebsd32_jail_get AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_jail_set AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_jail_get AUE_JAIL_GET +#define FREEBSD32_SYS_AUE_freebsd32_jail_set AUE_JAIL_SET #define FREEBSD32_SYS_AUE_freebsd32_semctl AUE_SEMCTL #define FREEBSD32_SYS_AUE_freebsd32_msgctl AUE_MSGCTL #define FREEBSD32_SYS_AUE_freebsd32_shmctl AUE_SHMCTL #define FREEBSD32_SYS_AUE_freebsd32_pselect AUE_SELECT -#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_POSIX_FALLOCATE +#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_POSIX_FADVISE #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 -#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_POSIX_FALLOCATE +#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_POSIX_FADVISE #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 #define FREEBSD32_SYS_AUE_freebsd32_cap_ioctls_limit AUE_CAP_IOCTLS_LIMIT #define FREEBSD32_SYS_AUE_freebsd32_cap_ioctls_get AUE_CAP_IOCTLS_GET -#define FREEBSD32_SYS_AUE_freebsd32_aio_mlock AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL -#define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_aio_mlock AUE_AIO_MLOCK +#define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_PROCCTL +#define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_PROCCTL #define FREEBSD32_SYS_AUE_freebsd32_ppoll AUE_POLL #define FREEBSD32_SYS_AUE_freebsd32_futimens AUE_FUTIMES #define FREEBSD32_SYS_AUE_freebsd32_utimensat AUE_FUTIMESAT Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Mar 29 21:31:45 2017 (r316181) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Mar 29 22:33:56 2017 (r316182) @@ -106,7 +106,7 @@ struct sysent freebsd32_sysent[] = { { AS(acct_args), (sy_call_t *)sys_acct, AUE_ACCT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 51 = acct */ { compat(0,freebsd32_sigpending), AUE_SIGPENDING, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = old freebsd32_sigpending */ { AS(freebsd32_sigaltstack_args), (sy_call_t *)freebsd32_sigaltstack, AUE_SIGALTSTACK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = freebsd32_sigaltstack */ - { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = freebsd32_ioctl */ + { AS(freebsd32_ioctl_args), (sy_call_t *)freebsd32_ioctl, AUE_IOCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = freebsd32_ioctl */ { AS(reboot_args), (sy_call_t *)sys_reboot, AUE_REBOOT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 55 = reboot */ { AS(revoke_args), (sy_call_t *)sys_revoke, AUE_REVOKE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 56 = revoke */ { AS(symlink_args), (sy_call_t *)sys_symlink, AUE_SYMLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 57 = symlink */ @@ -155,7 +155,7 @@ struct sysent freebsd32_sysent[] = { { AS(getpriority_args), (sy_call_t *)sys_getpriority, AUE_GETPRIORITY, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 100 = getpriority */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 101 = obsolete osend */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 102 = obsolete orecv */ - { compat(AS(ofreebsd32_sigreturn_args),freebsd32_sigreturn), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 103 = old freebsd32_sigreturn */ + { compat(AS(ofreebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 103 = old freebsd32_sigreturn */ { AS(bind_args), (sy_call_t *)sys_bind, AUE_BIND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 104 = bind */ { AS(setsockopt_args), (sy_call_t *)sys_setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 105 = setsockopt */ { AS(listen_args), (sy_call_t *)sys_listen, AUE_LISTEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 106 = listen */ @@ -307,9 +307,9 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ - { AS(freebsd32_aio_read_args), (sy_call_t *)freebsd32_aio_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = freebsd32_aio_read */ - { AS(freebsd32_aio_write_args), (sy_call_t *)freebsd32_aio_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 256 = freebsd32_aio_write */ - { AS(freebsd32_lio_listio_args), (sy_call_t *)freebsd32_lio_listio, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 257 = freebsd32_lio_listio */ + { AS(freebsd32_aio_read_args), (sy_call_t *)freebsd32_aio_read, AUE_AIO_READ, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = freebsd32_aio_read */ + { AS(freebsd32_aio_write_args), (sy_call_t *)freebsd32_aio_write, AUE_AIO_WRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 256 = freebsd32_aio_write */ + { AS(freebsd32_lio_listio_args), (sy_call_t *)freebsd32_lio_listio, AUE_LIO_LISTIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 257 = freebsd32_lio_listio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 258 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 259 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 260 = nosys */ @@ -366,13 +366,13 @@ struct sysent freebsd32_sysent[] = { { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 311 = setresuid */ { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = obsolete signanosleep */ - { AS(freebsd32_aio_return_args), (sy_call_t *)freebsd32_aio_return, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 314 = freebsd32_aio_return */ - { AS(freebsd32_aio_suspend_args), (sy_call_t *)freebsd32_aio_suspend, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 315 = freebsd32_aio_suspend */ - { AS(aio_cancel_args), (sy_call_t *)sys_aio_cancel, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 316 = aio_cancel */ - { AS(freebsd32_aio_error_args), (sy_call_t *)freebsd32_aio_error, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 317 = freebsd32_aio_error */ - { compat6(AS(freebsd6_freebsd32_aio_read_args),freebsd32_aio_read), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 318 = freebsd6 freebsd32_aio_read */ - { compat6(AS(freebsd6_freebsd32_aio_write_args),freebsd32_aio_write), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 319 = freebsd6 freebsd32_aio_write */ - { compat6(AS(freebsd6_freebsd32_lio_listio_args),freebsd32_lio_listio), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 320 = freebsd6 freebsd32_lio_listio */ + { AS(freebsd32_aio_return_args), (sy_call_t *)freebsd32_aio_return, AUE_AIO_RETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 314 = freebsd32_aio_return */ + { AS(freebsd32_aio_suspend_args), (sy_call_t *)freebsd32_aio_suspend, AUE_AIO_SUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 315 = freebsd32_aio_suspend */ + { AS(aio_cancel_args), (sy_call_t *)sys_aio_cancel, AUE_AIO_CANCEL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 316 = aio_cancel */ + { AS(freebsd32_aio_error_args), (sy_call_t *)freebsd32_aio_error, AUE_AIO_ERROR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 317 = freebsd32_aio_error */ + { compat6(AS(freebsd6_freebsd32_aio_read_args),freebsd32_aio_read), AUE_AIO_READ, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 318 = freebsd6 freebsd32_aio_read */ + { compat6(AS(freebsd6_freebsd32_aio_write_args),freebsd32_aio_write), AUE_AIO_WRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 319 = freebsd6 freebsd32_aio_write */ + { compat6(AS(freebsd6_freebsd32_lio_listio_args),freebsd32_lio_listio), AUE_LIO_LISTIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 320 = freebsd6 freebsd32_lio_listio */ { 0, (sy_call_t *)sys_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 323 = obsolete thr_wakeup */ @@ -399,23 +399,23 @@ struct sysent freebsd32_sysent[] = { { compat4(AS(freebsd4_freebsd32_sigreturn_args),freebsd32_sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 344 = freebsd4 freebsd32_sigreturn */ { AS(freebsd32_sigtimedwait_args), (sy_call_t *)freebsd32_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 345 = freebsd32_sigtimedwait */ { AS(freebsd32_sigwaitinfo_args), (sy_call_t *)freebsd32_sigwaitinfo, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 346 = freebsd32_sigwaitinfo */ - { AS(__acl_get_file_args), (sy_call_t *)sys___acl_get_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = __acl_get_file */ - { AS(__acl_set_file_args), (sy_call_t *)sys___acl_set_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = __acl_set_file */ - { AS(__acl_get_fd_args), (sy_call_t *)sys___acl_get_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 349 = __acl_get_fd */ - { AS(__acl_set_fd_args), (sy_call_t *)sys___acl_set_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 350 = __acl_set_fd */ - { AS(__acl_delete_file_args), (sy_call_t *)sys___acl_delete_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = __acl_delete_file */ - { AS(__acl_delete_fd_args), (sy_call_t *)sys___acl_delete_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 352 = __acl_delete_fd */ - { AS(__acl_aclcheck_file_args), (sy_call_t *)sys___acl_aclcheck_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = __acl_aclcheck_file */ - { AS(__acl_aclcheck_fd_args), (sy_call_t *)sys___acl_aclcheck_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */ + { AS(__acl_get_file_args), (sy_call_t *)sys___acl_get_file, AUE_ACL_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = __acl_get_file */ + { AS(__acl_set_file_args), (sy_call_t *)sys___acl_set_file, AUE_ACL_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = __acl_set_file */ + { AS(__acl_get_fd_args), (sy_call_t *)sys___acl_get_fd, AUE_ACL_GET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 349 = __acl_get_fd */ + { AS(__acl_set_fd_args), (sy_call_t *)sys___acl_set_fd, AUE_ACL_SET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 350 = __acl_set_fd */ + { AS(__acl_delete_file_args), (sy_call_t *)sys___acl_delete_file, AUE_ACL_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = __acl_delete_file */ + { AS(__acl_delete_fd_args), (sy_call_t *)sys___acl_delete_fd, AUE_ACL_DELETE_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 352 = __acl_delete_fd */ + { AS(__acl_aclcheck_file_args), (sy_call_t *)sys___acl_aclcheck_file, AUE_ACL_CHECK_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = __acl_aclcheck_file */ + { AS(__acl_aclcheck_fd_args), (sy_call_t *)sys___acl_aclcheck_fd, AUE_ACL_CHECK_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */ { AS(extattrctl_args), (sy_call_t *)sys_extattrctl, AUE_EXTATTRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 355 = extattrctl */ { AS(extattr_set_file_args), (sy_call_t *)sys_extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)sys_extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)sys_extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = extattr_delete_file */ - { AS(freebsd32_aio_waitcomplete_args), (sy_call_t *)freebsd32_aio_waitcomplete, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 359 = freebsd32_aio_waitcomplete */ + { AS(freebsd32_aio_waitcomplete_args), (sy_call_t *)freebsd32_aio_waitcomplete, AUE_AIO_WAITCOMPLETE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 359 = freebsd32_aio_waitcomplete */ { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ - { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = freebsd32_kevent */ + { AS(freebsd32_kevent_args), (sy_call_t *)freebsd32_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = freebsd32_kevent */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = __cap_get_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = __cap_set_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = __cap_get_fd */ @@ -426,7 +426,7 @@ struct sysent freebsd32_sysent[] = { { AS(extattr_set_fd_args), (sy_call_t *)sys_extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 371 = extattr_set_fd */ { AS(extattr_get_fd_args), (sy_call_t *)sys_extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 372 = extattr_get_fd */ { AS(extattr_delete_fd_args), (sy_call_t *)sys_extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 373 = extattr_delete_fd */ - { AS(__setugid_args), (sy_call_t *)sys___setugid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = __setugid */ + { AS(__setugid_args), (sy_call_t *)sys___setugid, AUE_SETUGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = __setugid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nfsclnt */ { AS(eaccess_args), (sy_call_t *)sys_eaccess, AUE_EACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 376 = eaccess */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 377 = afs_syscall */ @@ -477,18 +477,18 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_setcontext_args), (sy_call_t *)freebsd32_setcontext, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 422 = freebsd32_setcontext */ { AS(freebsd32_swapcontext_args), (sy_call_t *)freebsd32_swapcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = freebsd32_swapcontext */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 424 = swapoff */ - { AS(__acl_get_link_args), (sy_call_t *)sys___acl_get_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = __acl_get_link */ - { AS(__acl_set_link_args), (sy_call_t *)sys___acl_set_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = __acl_set_link */ - { AS(__acl_delete_link_args), (sy_call_t *)sys___acl_delete_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = __acl_delete_link */ - { AS(__acl_aclcheck_link_args), (sy_call_t *)sys___acl_aclcheck_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */ + { AS(__acl_get_link_args), (sy_call_t *)sys___acl_get_link, AUE_ACL_GET_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = __acl_get_link */ + { AS(__acl_set_link_args), (sy_call_t *)sys___acl_set_link, AUE_ACL_SET_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = __acl_set_link */ + { AS(__acl_delete_link_args), (sy_call_t *)sys___acl_delete_link, AUE_ACL_DELETE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = __acl_delete_link */ + { AS(__acl_aclcheck_link_args), (sy_call_t *)sys___acl_aclcheck_link, AUE_ACL_CHECK_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */ { AS(sigwait_args), (sy_call_t *)sys_sigwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 429 = sigwait */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 430 = thr_create; */ - { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */ + { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_THR_EXIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */ { AS(thr_self_args), (sy_call_t *)sys_thr_self, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 432 = thr_self */ - { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */ + { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_THR_KILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 434 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 435 = nosys */ - { AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ + { AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_JAIL_ATTACH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ { AS(extattr_list_fd_args), (sy_call_t *)sys_extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 437 = extattr_list_fd */ { AS(extattr_list_file_args), (sy_call_t *)sys_extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 438 = extattr_list_file */ { AS(extattr_list_link_args), (sy_call_t *)sys_extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 439 = extattr_list_link */ @@ -507,7 +507,7 @@ struct sysent freebsd32_sysent[] = { { AS(setaudit_addr_args), (sy_call_t *)sys_setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 452 = setaudit_addr */ { AS(auditctl_args), (sy_call_t *)sys_auditctl, AUE_AUDITCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 453 = auditctl */ { AS(freebsd32_umtx_op_args), (sy_call_t *)freebsd32_umtx_op, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 454 = freebsd32_umtx_op */ - { AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = freebsd32_thr_new */ + { AS(freebsd32_thr_new_args), (sy_call_t *)freebsd32_thr_new, AUE_THR_NEW, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = freebsd32_thr_new */ { AS(sigqueue_args), (sy_call_t *)sys_sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = sigqueue */ { AS(freebsd32_kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = freebsd32_kmq_open */ { AS(freebsd32_kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 458 = freebsd32_kmq_setattr */ @@ -517,7 +517,7 @@ struct sysent freebsd32_sysent[] = { { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */ - { AS(freebsd32_aio_fsync_args), (sy_call_t *)freebsd32_aio_fsync, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 465 = freebsd32_aio_fsync */ + { AS(freebsd32_aio_fsync_args), (sy_call_t *)freebsd32_aio_fsync, AUE_AIO_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 465 = freebsd32_aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ @@ -542,7 +542,7 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_truncate_args), (sy_call_t *)freebsd32_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = freebsd32_truncate */ { AS(freebsd32_ftruncate_args), (sy_call_t *)freebsd32_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 480 = freebsd32_ftruncate */ #endif - { AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ + { AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_THR_KILL2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ { AS(shm_open_args), (sy_call_t *)sys_shm_open, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = shm_open */ { AS(shm_unlink_args), (sy_call_t *)sys_shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */ { AS(cpuset_args), (sy_call_t *)sys_cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */ @@ -571,9 +571,9 @@ struct sysent freebsd32_sysent[] = { { AS(unlinkat_args), (sy_call_t *)sys_unlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 503 = unlinkat */ { AS(posix_openpt_args), (sy_call_t *)sys_posix_openpt, AUE_POSIX_OPENPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 504 = posix_openpt */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 505 = gssd_syscall */ - { AS(freebsd32_jail_get_args), (sy_call_t *)freebsd32_jail_get, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 506 = freebsd32_jail_get */ - { AS(freebsd32_jail_set_args), (sy_call_t *)freebsd32_jail_set, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 507 = freebsd32_jail_set */ - { AS(jail_remove_args), (sy_call_t *)sys_jail_remove, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 508 = jail_remove */ + { AS(freebsd32_jail_get_args), (sy_call_t *)freebsd32_jail_get, AUE_JAIL_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 506 = freebsd32_jail_get */ + { AS(freebsd32_jail_set_args), (sy_call_t *)freebsd32_jail_set, AUE_JAIL_SET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 507 = freebsd32_jail_set */ + { AS(jail_remove_args), (sy_call_t *)sys_jail_remove, AUE_JAIL_REMOVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 508 = jail_remove */ { AS(closefrom_args), (sy_call_t *)sys_closefrom, AUE_CLOSEFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 509 = closefrom */ { AS(freebsd32_semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 510 = freebsd32_semctl */ { AS(freebsd32_msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 511 = freebsd32_msgctl */ @@ -588,20 +588,20 @@ struct sysent freebsd32_sysent[] = { { AS(pdgetpid_args), (sy_call_t *)sys_pdgetpid, AUE_PDGETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait4 */ { AS(freebsd32_pselect_args), (sy_call_t *)freebsd32_pselect, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 522 = freebsd32_pselect */ - { AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */ - { AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */ + { AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_GETLOGINCLASS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */ + { AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_SETLOGINCLASS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */ { AS(rctl_get_racct_args), (sy_call_t *)sys_rctl_get_racct, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_racct */ { AS(rctl_get_rules_args), (sy_call_t *)sys_rctl_get_rules, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 526 = rctl_get_rules */ { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ #ifdef PAD64_REQUIRED - { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ - { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #else - { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ - { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #endif { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 533 = cap_rights_limit */ @@ -614,11 +614,11 @@ struct sysent freebsd32_sysent[] = { { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */ { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 542 = pipe2 */ - { AS(freebsd32_aio_mlock_args), (sy_call_t *)freebsd32_aio_mlock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 543 = freebsd32_aio_mlock */ + { AS(freebsd32_aio_mlock_args), (sy_call_t *)freebsd32_aio_mlock, AUE_AIO_MLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 543 = freebsd32_aio_mlock */ #ifdef PAD64_REQUIRED - { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ + { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_PROCCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ #else - { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ + { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_PROCCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ #endif { AS(freebsd32_ppoll_args), (sy_call_t *)freebsd32_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = freebsd32_ppoll */ { AS(freebsd32_futimens_args), (sy_call_t *)freebsd32_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = freebsd32_futimens */ Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Mar 29 21:31:45 2017 (r316181) +++ head/sys/compat/freebsd32/syscalls.master Wed Mar 29 22:33:56 2017 (r316182) @@ -145,7 +145,7 @@ 53 AUE_SIGALTSTACK STD { int freebsd32_sigaltstack( \ struct sigaltstack32 *ss, \ struct sigaltstack32 *oss); } -54 AUE_NULL STD { int freebsd32_ioctl(int fd, uint32_t com, \ +54 AUE_IOCTL STD { int freebsd32_ioctl(int fd, uint32_t com, \ struct md_ioctl32 *data); } 55 AUE_REBOOT NOPROTO { int reboot(int opt); } 56 AUE_REVOKE NOPROTO { int revoke(char *path); } @@ -218,7 +218,7 @@ 100 AUE_GETPRIORITY NOPROTO { int getpriority(int which, int who); } 101 AUE_NULL OBSOL osend 102 AUE_NULL OBSOL orecv -103 AUE_NULL COMPAT { int freebsd32_sigreturn( \ +103 AUE_SIGRETURN COMPAT { int freebsd32_sigreturn( \ struct ia32_sigcontext3 *sigcntxp); } 104 AUE_BIND NOPROTO { int bind(int s, caddr_t name, \ int namelen); } @@ -312,8 +312,8 @@ 160 AUE_LGETFH UNIMPL lgetfh 161 AUE_NFS_GETFH NOPROTO { int getfh(char *fname, \ struct fhandle *fhp); } -162 AUE_NULL OBSOL getdomainname -163 AUE_NULL OBSOL setdomainname +162 AUE_SYSCTL OBSOL getdomainname +163 AUE_SYSCTL OBSOL setdomainname 164 AUE_NULL OBSOL uname 165 AUE_SYSARCH STD { int freebsd32_sysarch(int op, char *parms); } 166 AUE_RTPRIO NOPROTO { int rtprio(int function, pid_t pid, \ @@ -477,14 +477,14 @@ 250 AUE_MINHERIT NOPROTO { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK NOPROTO { int rfork(int flags); } -252 AUE_NULL OBSOL openbsd_poll +252 AUE_POLL OBSOL openbsd_poll 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } 254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } -255 AUE_NULL STD { int freebsd32_aio_read( \ +255 AUE_AIO_READ STD { int freebsd32_aio_read( \ struct aiocb32 *aiocbp); } -256 AUE_NULL STD { int freebsd32_aio_write( \ +256 AUE_AIO_WRITE STD { int freebsd32_aio_write( \ struct aiocb32 *aiocbp); } -257 AUE_NULL STD { int freebsd32_lio_listio(int mode, \ +257 AUE_LIO_LISTIO STD { int freebsd32_lio_listio(int mode, \ struct aiocb32 * const *acb_list, \ int nent, struct sigevent32 *sig); } 258 AUE_NULL UNIMPL nosys @@ -565,20 +565,20 @@ 312 AUE_SETRESGID NOPROTO { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_NULL STD { int freebsd32_aio_return( \ +314 AUE_AIO_RETURN STD { int freebsd32_aio_return( \ struct aiocb32 *aiocbp); } -315 AUE_NULL STD { int freebsd32_aio_suspend( \ +315 AUE_AIO_SUSPEND STD { int freebsd32_aio_suspend( \ struct aiocb32 * const * aiocbp, int nent, \ const struct timespec32 *timeout); } -316 AUE_NULL NOPROTO { int aio_cancel(int fd, \ +316 AUE_AIO_CANCEL NOPROTO { int aio_cancel(int fd, \ struct aiocb *aiocbp); } -317 AUE_NULL STD { int freebsd32_aio_error( \ +317 AUE_AIO_ERROR STD { int freebsd32_aio_error( \ struct aiocb32 *aiocbp); } -318 AUE_NULL COMPAT6 { int freebsd32_aio_read( \ +318 AUE_AIO_READ COMPAT6 { int freebsd32_aio_read( \ struct oaiocb32 *aiocbp); } -319 AUE_NULL COMPAT6 { int freebsd32_aio_write( \ +319 AUE_AIO_WRITE COMPAT6 { int freebsd32_aio_write( \ struct oaiocb32 *aiocbp); } -320 AUE_NULL COMPAT6 { int freebsd32_lio_listio(int mode, \ +320 AUE_LIO_LISTIO COMPAT6 { int freebsd32_lio_listio(int mode, \ struct oaiocb32 * const *acb_list, \ int nent, struct osigevent32 *sig); } 321 AUE_NULL NOPROTO { int yield(void); } @@ -626,21 +626,21 @@ const struct timespec *timeout); } 346 AUE_NULL STD { int freebsd32_sigwaitinfo(const sigset_t *set, \ siginfo_t *info); } -347 AUE_NULL NOPROTO { int __acl_get_file(const char *path, \ +347 AUE_ACL_GET_FILE NOPROTO { int __acl_get_file(const char *path, \ acl_type_t type, struct acl *aclp); } -348 AUE_NULL NOPROTO { int __acl_set_file(const char *path, \ +348 AUE_ACL_SET_FILE NOPROTO { int __acl_set_file(const char *path, \ acl_type_t type, struct acl *aclp); } -349 AUE_NULL NOPROTO { int __acl_get_fd(int filedes, \ +349 AUE_ACL_GET_FD NOPROTO { int __acl_get_fd(int filedes, \ acl_type_t type, struct acl *aclp); } -350 AUE_NULL NOPROTO { int __acl_set_fd(int filedes, \ +350 AUE_ACL_SET_FD NOPROTO { int __acl_set_fd(int filedes, \ acl_type_t type, struct acl *aclp); } -351 AUE_NULL NOPROTO { int __acl_delete_file(const char *path, \ +351 AUE_ACL_DELETE_FILE NOPROTO { int __acl_delete_file(const char *path, \ acl_type_t type); } -352 AUE_NULL NOPROTO { int __acl_delete_fd(int filedes, \ +352 AUE_ACL_DELETE_FD NOPROTO { int __acl_delete_fd(int filedes, \ acl_type_t type); } -353 AUE_NULL NOPROTO { int __acl_aclcheck_file(const char *path, \ +353 AUE_ACL_CHECK_FILE NOPROTO { int __acl_aclcheck_file(const char *path, \ acl_type_t type, struct acl *aclp); } -354 AUE_NULL NOPROTO { int __acl_aclcheck_fd(int filedes, \ +354 AUE_ACL_CHECK_FD NOPROTO { int __acl_aclcheck_fd(int filedes, \ acl_type_t type, struct acl *aclp); } 355 AUE_EXTATTRCTL NOPROTO { int extattrctl(const char *path, int cmd, \ const char *filename, int attrnamespace, \ @@ -656,7 +656,7 @@ 358 AUE_EXTATTR_DELETE_FILE NOPROTO { int extattr_delete_file( \ const char *path, int attrnamespace, \ const char *attrname); } -359 AUE_NULL STD { int freebsd32_aio_waitcomplete( \ +359 AUE_AIO_WAITCOMPLETE STD { int freebsd32_aio_waitcomplete( \ struct aiocb32 **aiocbp, \ struct timespec32 *timeout); } 360 AUE_GETRESUID NOPROTO { int getresuid(uid_t *ruid, uid_t *euid, \ @@ -664,7 +664,7 @@ 361 AUE_GETRESGID NOPROTO { int getresgid(gid_t *rgid, gid_t *egid, \ gid_t *sgid); } 362 AUE_KQUEUE NOPROTO { int kqueue(void); } -363 AUE_NULL STD { int freebsd32_kevent(int fd, \ +363 AUE_KEVENT STD { int freebsd32_kevent(int fd, \ const struct kevent32 *changelist, \ int nchanges, \ struct kevent32 *eventlist, int nevents, \ @@ -685,7 +685,7 @@ 373 AUE_EXTATTR_DELETE_FD NOPROTO { int extattr_delete_fd(int fd, \ int attrnamespace, \ const char *attrname); } -374 AUE_NULL NOPROTO { int __setugid(int flag); } +374 AUE_SETUGID NOPROTO { int __setugid(int flag); } 375 AUE_NULL UNIMPL nfsclnt 376 AUE_EACCESS NOPROTO { int eaccess(char *path, int amode); } 377 AUE_NULL UNIMPL afs_syscall @@ -721,19 +721,19 @@ 398 AUE_FHSTATFS NOPROTO { int fhstatfs(const struct fhandle *u_fhp, \ struct statfs *buf); } 399 AUE_NULL UNIMPL nosys -400 AUE_NULL NOSTD|NOPROTO { int ksem_close(semid_t id); } -401 AUE_NULL NOSTD|NOPROTO { int ksem_post(semid_t id); } -402 AUE_NULL NOSTD|NOPROTO { int ksem_wait(semid_t id); } -403 AUE_NULL NOSTD|NOPROTO { int ksem_trywait(semid_t id); } -404 AUE_NULL NOSTD { int freebsd32_ksem_init(semid_t *idp, \ +400 AUE_SEMCLOSE NOSTD|NOPROTO { int ksem_close(semid_t id); } +401 AUE_SEMPOST NOSTD|NOPROTO { int ksem_post(semid_t id); } +402 AUE_SEMWAIT NOSTD|NOPROTO { int ksem_wait(semid_t id); } +403 AUE_SEMTRYWAIT NOSTD|NOPROTO { int ksem_trywait(semid_t id); } +404 AUE_SEMINIT NOSTD { int freebsd32_ksem_init(semid_t *idp, \ unsigned int value); } -405 AUE_NULL NOSTD { int freebsd32_ksem_open(semid_t *idp, \ +405 AUE_SEMOPEN NOSTD { int freebsd32_ksem_open(semid_t *idp, \ const char *name, int oflag, \ mode_t mode, unsigned int value); } -406 AUE_NULL NOSTD|NOPROTO { int ksem_unlink(const char *name); } -407 AUE_NULL NOSTD|NOPROTO { int ksem_getvalue(semid_t id, \ +406 AUE_SEMUNLINK NOSTD|NOPROTO { int ksem_unlink(const char *name); } +407 AUE_SEMGETVALUE NOSTD|NOPROTO { int ksem_getvalue(semid_t id, \ int *val); } -408 AUE_NULL NOSTD|NOPROTO { int ksem_destroy(semid_t id); } +408 AUE_SEMDESTROY NOSTD|NOPROTO { int ksem_destroy(semid_t id); } 409 AUE_NULL UNIMPL __mac_get_pid 410 AUE_NULL UNIMPL __mac_get_link 411 AUE_NULL UNIMPL __mac_set_link @@ -765,23 +765,23 @@ struct freebsd32_ucontext *oucp, \ const struct freebsd32_ucontext *ucp); } 424 AUE_SWAPOFF UNIMPL swapoff -425 AUE_NULL NOPROTO { int __acl_get_link(const char *path, \ +425 AUE_ACL_GET_LINK NOPROTO { int __acl_get_link(const char *path, \ acl_type_t type, struct acl *aclp); } -426 AUE_NULL NOPROTO { int __acl_set_link(const char *path, \ +426 AUE_ACL_SET_LINK NOPROTO { int __acl_set_link(const char *path, \ acl_type_t type, struct acl *aclp); } -427 AUE_NULL NOPROTO { int __acl_delete_link(const char *path, \ +427 AUE_ACL_DELETE_LINK NOPROTO { int __acl_delete_link(const char *path, \ acl_type_t type); } -428 AUE_NULL NOPROTO { int __acl_aclcheck_link(const char *path, \ +428 AUE_ACL_CHECK_LINK NOPROTO { int __acl_aclcheck_link(const char *path, \ acl_type_t type, struct acl *aclp); } 429 AUE_SIGWAIT NOPROTO { int sigwait(const sigset_t *set, \ int *sig); } -430 AUE_NULL UNIMPL thr_create; -431 AUE_NULL NOPROTO { void thr_exit(long *state); } +430 AUE_THR_CREATE UNIMPL thr_create; +431 AUE_THR_EXIT NOPROTO { void thr_exit(long *state); } 432 AUE_NULL NOPROTO { int thr_self(long *id); } -433 AUE_NULL NOPROTO { int thr_kill(long id, int sig); } +433 AUE_THR_KILL NOPROTO { int thr_kill(long id, int sig); } 434 AUE_NULL UNIMPL nosys 435 AUE_NULL UNIMPL nosys -436 AUE_NULL NOPROTO { int jail_attach(int jid); } +436 AUE_JAIL_ATTACH NOPROTO { int jail_attach(int jid); } 437 AUE_EXTATTR_LIST_FD NOPROTO { ssize_t extattr_list_fd(int fd, \ int attrnamespace, void *data, \ size_t nbytes); } @@ -792,7 +792,7 @@ const char *path, int attrnamespace, \ void *data, size_t nbytes); } 440 AUE_NULL UNIMPL kse_switchin -441 AUE_NULL NOSTD { int freebsd32_ksem_timedwait(semid_t id, \ +441 AUE_SEMWAIT NOSTD { int freebsd32_ksem_timedwait(semid_t id, \ const struct timespec32 *abstime); } 442 AUE_NULL STD { int freebsd32_thr_suspend( \ const struct timespec32 *timeout); } @@ -816,31 +816,31 @@ 454 AUE_NULL STD { int freebsd32_umtx_op(void *obj, int op,\ u_long val, void *uaddr, \ void *uaddr2); } -455 AUE_NULL STD { int freebsd32_thr_new( \ +455 AUE_THR_NEW STD { int freebsd32_thr_new( \ struct thr_param32 *param, \ int param_size); } 456 AUE_NULL NOPROTO { int sigqueue(pid_t pid, int signum, \ void *value); } -457 AUE_NULL NOSTD { int freebsd32_kmq_open( \ +457 AUE_MQ_OPEN NOSTD { int freebsd32_kmq_open( \ const char *path, int flags, mode_t mode, \ const struct mq_attr32 *attr); } -458 AUE_NULL NOSTD { int freebsd32_kmq_setattr(int mqd, \ +458 AUE_MQ_SETATTR NOSTD { int freebsd32_kmq_setattr(int mqd, \ const struct mq_attr32 *attr, \ struct mq_attr32 *oattr); } -459 AUE_NULL NOSTD { int freebsd32_kmq_timedreceive(int mqd, \ +459 AUE_MQ_TIMEDRECEIVE NOSTD { int freebsd32_kmq_timedreceive(int mqd, \ char *msg_ptr, size_t msg_len, \ unsigned *msg_prio, \ const struct timespec32 *abs_timeout); } -460 AUE_NULL NOSTD { int freebsd32_kmq_timedsend(int mqd, \ +460 AUE_MQ_TIMEDSEND NOSTD { int freebsd32_kmq_timedsend(int mqd, \ const char *msg_ptr, size_t msg_len,\ unsigned msg_prio, \ const struct timespec32 *abs_timeout);} -461 AUE_NULL NOSTD { int freebsd32_kmq_notify(int mqd, \ +461 AUE_MQ_NOTIFY NOSTD { int freebsd32_kmq_notify(int mqd, \ const struct sigevent32 *sigev); } -462 AUE_NULL NOPROTO|NOSTD { int kmq_unlink(const char *path); } +462 AUE_MQ_UNLINK NOPROTO|NOSTD { int kmq_unlink(const char *path); } 463 AUE_NULL NOPROTO { int abort2(const char *why, int nargs, void **args); } 464 AUE_NULL NOPROTO { int thr_set_name(long id, const char *name); } -465 AUE_NULL STD { int freebsd32_aio_fsync(int op, \ +465 AUE_AIO_FSYNC STD { int freebsd32_aio_fsync(int op, \ struct aiocb32 *aiocbp); } 466 AUE_RTPRIO NOPROTO { int rtprio_thread(int function, \ lwpid_t lwpid, struct rtprio *rtp); } @@ -848,14 +848,14 @@ 468 AUE_NULL UNIMPL nosys 469 AUE_NULL UNIMPL __getpath_fromfd 470 AUE_NULL UNIMPL __getpath_fromaddr -471 AUE_NULL NOPROTO|NOSTD { int sctp_peeloff(int sd, uint32_t name); } -472 AUE_NULL NOPROTO|NOSTD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ +471 AUE_SCTP_PEELOFF NOPROTO|NOSTD { int sctp_peeloff(int sd, uint32_t name); } +472 AUE_SCTP_GENERIC_SENDMSG NOPROTO|NOSTD { int sctp_generic_sendmsg(int sd, caddr_t msg, int mlen, \ caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -473 AUE_NULL NOPROTO|NOSTD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ +473 AUE_SCTP_GENERIC_SENDMSG_IOV NOPROTO|NOSTD { int sctp_generic_sendmsg_iov(int sd, struct iovec *iov, int iovlen, \ caddr_t to, __socklen_t tolen, \ struct sctp_sndrcvinfo *sinfo, int flags); } -474 AUE_NULL NOPROTO|NOSTD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ +474 AUE_SCTP_GENERIC_RECVMSG NOPROTO|NOSTD { int sctp_generic_recvmsg(int sd, struct iovec *iov, int iovlen, \ struct sockaddr * from, __socklen_t *fromlenaddr, \ struct sctp_sndrcvinfo *sinfo, int *msg_flags); } #ifdef PAD64_REQUIRED @@ -899,7 +899,7 @@ 480 AUE_FTRUNCATE STD { int freebsd32_ftruncate(int fd, \ uint32_t length1, uint32_t length2); } #endif -481 AUE_KILL NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } +481 AUE_THR_KILL2 NOPROTO { int thr_kill2(pid_t pid, long id, int sig); } 482 AUE_SHMOPEN NOPROTO { int shm_open(const char *path, int flags, \ mode_t mode); } 483 AUE_SHMUNLINK NOPROTO { int shm_unlink(const char *path); } @@ -961,11 +961,11 @@ 504 AUE_POSIX_OPENPT NOPROTO { int posix_openpt(int flags); } ; 505 is initialised by the kgssapi code, if present. 505 AUE_NULL UNIMPL gssd_syscall -506 AUE_NULL STD { int freebsd32_jail_get(struct iovec32 *iovp, \ +506 AUE_JAIL_GET STD { int freebsd32_jail_get(struct iovec32 *iovp, \ unsigned int iovcnt, int flags); } -507 AUE_NULL STD { int freebsd32_jail_set(struct iovec32 *iovp, \ +507 AUE_JAIL_SET STD { int freebsd32_jail_set(struct iovec32 *iovp, \ unsigned int iovcnt, int flags); } -508 AUE_NULL NOPROTO { int jail_remove(int jid); } +508 AUE_JAIL_REMOVE NOPROTO { int jail_remove(int jid); } 509 AUE_CLOSEFROM NOPROTO { int closefrom(int lowfd); } 510 AUE_SEMCTL NOSTD { int freebsd32_semctl(int semid, int semnum, \ int cmd, union semun32 *arg); } @@ -987,9 +987,9 @@ fd_set *ou, fd_set *ex, \ const struct timespec32 *ts, \ const sigset_t *sm); } -523 AUE_NULL NOPROTO { int getloginclass(char *namebuf, \ +523 AUE_GETLOGINCLASS NOPROTO { int getloginclass(char *namebuf, \ size_t namelen); } -524 AUE_NULL NOPROTO { int setloginclass(const char *namebuf); } +524 AUE_SETLOGINCLASS NOPROTO { int setloginclass(const char *namebuf); } 525 AUE_NULL NOPROTO { int rctl_get_racct(const void *inbufp, \ size_t inbuflen, void *outbufp, \ size_t outbuflen); } @@ -1006,11 +1006,11 @@ size_t inbuflen, void *outbufp, \ size_t outbuflen); } #ifdef PAD64_REQUIRED -530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd, \ +530 AUE_POSIX_FALLOCATE STD { int freebsd32_posix_fallocate(int fd, \ int pad, \ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2); } -531 AUE_NULL STD { int freebsd32_posix_fadvise(int fd, \ +531 AUE_POSIX_FADVISE STD { int freebsd32_posix_fadvise(int fd, \ int pad, \ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ @@ -1021,10 +1021,10 @@ struct wrusage32 *wrusage, \ siginfo_t *info); } #else -530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ +530 AUE_POSIX_FALLOCATE STD { int freebsd32_posix_fallocate(int fd,\ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2); } -531 AUE_NULL STD { int freebsd32_posix_fadvise(int fd, \ +531 AUE_POSIX_FADVISE STD { int freebsd32_posix_fadvise(int fd, \ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ int advice); } @@ -1058,14 +1058,14 @@ __socklen_t * __restrict anamelen, \ int flags); } 542 AUE_PIPE NOPROTO { int pipe2(int *fildes, int flags); } -543 AUE_NULL STD { int freebsd32_aio_mlock( \ +543 AUE_AIO_MLOCK STD { int freebsd32_aio_mlock( \ struct aiocb32 *aiocbp); } #ifdef PAD64_REQUIRED -544 AUE_NULL STD { int freebsd32_procctl(int idtype, int pad, \ +544 AUE_PROCCTL STD { int freebsd32_procctl(int idtype, int pad, \ uint32_t id1, uint32_t id2, int com, \ void *data); } #else -544 AUE_NULL STD { int freebsd32_procctl(int idtype, \ +544 AUE_PROCCTL STD { int freebsd32_procctl(int idtype, \ uint32_t id1, uint32_t id2, int com, \ void *data); } #endif Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Mar 29 21:31:45 2017 (r316181) +++ head/sys/kern/init_sysent.c Wed Mar 29 22:33:56 2017 (r316182) @@ -220,7 +220,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 172 = nosys */ { compat6(AS(freebsd6_pread_args),pread), AUE_PREAD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 173 = freebsd6 pread */ { compat6(AS(freebsd6_pwrite_args),pwrite), AUE_PWRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 174 = freebsd6 pwrite */ - { AS(setfib_args), (sy_call_t *)sys_setfib, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = setfib */ + { AS(setfib_args), (sy_call_t *)sys_setfib, AUE_SETFIB, NULL, 0, 0, 0, SY_THR_STATIC }, /* 175 = setfib */ { AS(ntp_adjtime_args), (sy_call_t *)sys_ntp_adjtime, AUE_NTP_ADJTIME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 176 = ntp_adjtime */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 177 = sfork */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 178 = getdescriptor */ @@ -300,9 +300,9 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ - { AS(aio_read_args), (sy_call_t *)sys_aio_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = aio_read */ - { AS(aio_write_args), (sy_call_t *)sys_aio_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 256 = aio_write */ - { AS(lio_listio_args), (sy_call_t *)sys_lio_listio, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 257 = lio_listio */ + { AS(aio_read_args), (sy_call_t *)sys_aio_read, AUE_AIO_READ, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = aio_read */ + { AS(aio_write_args), (sy_call_t *)sys_aio_write, AUE_AIO_WRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 256 = aio_write */ + { AS(lio_listio_args), (sy_call_t *)sys_lio_listio, AUE_LIO_LISTIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 257 = lio_listio */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 258 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 259 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 260 = nosys */ @@ -359,13 +359,13 @@ struct sysent sysent[] = { { AS(setresuid_args), (sy_call_t *)sys_setresuid, AUE_SETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 311 = setresuid */ { AS(setresgid_args), (sy_call_t *)sys_setresgid, AUE_SETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 312 = setresgid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = obsolete signanosleep */ - { AS(aio_return_args), (sy_call_t *)sys_aio_return, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 314 = aio_return */ - { AS(aio_suspend_args), (sy_call_t *)sys_aio_suspend, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 315 = aio_suspend */ - { AS(aio_cancel_args), (sy_call_t *)sys_aio_cancel, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 316 = aio_cancel */ - { AS(aio_error_args), (sy_call_t *)sys_aio_error, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 317 = aio_error */ - { compat6(AS(freebsd6_aio_read_args),aio_read), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 318 = freebsd6 aio_read */ - { compat6(AS(freebsd6_aio_write_args),aio_write), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 319 = freebsd6 aio_write */ - { compat6(AS(freebsd6_lio_listio_args),lio_listio), AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 320 = freebsd6 lio_listio */ + { AS(aio_return_args), (sy_call_t *)sys_aio_return, AUE_AIO_RETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 314 = aio_return */ + { AS(aio_suspend_args), (sy_call_t *)sys_aio_suspend, AUE_AIO_SUSPEND, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 315 = aio_suspend */ + { AS(aio_cancel_args), (sy_call_t *)sys_aio_cancel, AUE_AIO_CANCEL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 316 = aio_cancel */ + { AS(aio_error_args), (sy_call_t *)sys_aio_error, AUE_AIO_ERROR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 317 = aio_error */ + { compat6(AS(freebsd6_aio_read_args),aio_read), AUE_AIO_READ, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 318 = freebsd6 aio_read */ + { compat6(AS(freebsd6_aio_write_args),aio_write), AUE_AIO_WRITE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 319 = freebsd6 aio_write */ + { compat6(AS(freebsd6_lio_listio_args),lio_listio), AUE_LIO_LISTIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 320 = freebsd6 lio_listio */ { 0, (sy_call_t *)sys_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 321 = yield */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 322 = obsolete thr_sleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 323 = obsolete thr_wakeup */ @@ -392,23 +392,23 @@ struct sysent sysent[] = { { compat4(AS(freebsd4_sigreturn_args),sigreturn), AUE_SIGRETURN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 344 = freebsd4 sigreturn */ { AS(sigtimedwait_args), (sy_call_t *)sys_sigtimedwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 345 = sigtimedwait */ { AS(sigwaitinfo_args), (sy_call_t *)sys_sigwaitinfo, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 346 = sigwaitinfo */ - { AS(__acl_get_file_args), (sy_call_t *)sys___acl_get_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = __acl_get_file */ - { AS(__acl_set_file_args), (sy_call_t *)sys___acl_set_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = __acl_set_file */ - { AS(__acl_get_fd_args), (sy_call_t *)sys___acl_get_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 349 = __acl_get_fd */ - { AS(__acl_set_fd_args), (sy_call_t *)sys___acl_set_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 350 = __acl_set_fd */ - { AS(__acl_delete_file_args), (sy_call_t *)sys___acl_delete_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = __acl_delete_file */ - { AS(__acl_delete_fd_args), (sy_call_t *)sys___acl_delete_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 352 = __acl_delete_fd */ - { AS(__acl_aclcheck_file_args), (sy_call_t *)sys___acl_aclcheck_file, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = __acl_aclcheck_file */ - { AS(__acl_aclcheck_fd_args), (sy_call_t *)sys___acl_aclcheck_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */ + { AS(__acl_get_file_args), (sy_call_t *)sys___acl_get_file, AUE_ACL_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = __acl_get_file */ + { AS(__acl_set_file_args), (sy_call_t *)sys___acl_set_file, AUE_ACL_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = __acl_set_file */ + { AS(__acl_get_fd_args), (sy_call_t *)sys___acl_get_fd, AUE_ACL_GET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 349 = __acl_get_fd */ + { AS(__acl_set_fd_args), (sy_call_t *)sys___acl_set_fd, AUE_ACL_SET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 350 = __acl_set_fd */ + { AS(__acl_delete_file_args), (sy_call_t *)sys___acl_delete_file, AUE_ACL_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = __acl_delete_file */ + { AS(__acl_delete_fd_args), (sy_call_t *)sys___acl_delete_fd, AUE_ACL_DELETE_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 352 = __acl_delete_fd */ + { AS(__acl_aclcheck_file_args), (sy_call_t *)sys___acl_aclcheck_file, AUE_ACL_CHECK_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = __acl_aclcheck_file */ + { AS(__acl_aclcheck_fd_args), (sy_call_t *)sys___acl_aclcheck_fd, AUE_ACL_CHECK_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 354 = __acl_aclcheck_fd */ { AS(extattrctl_args), (sy_call_t *)sys_extattrctl, AUE_EXTATTRCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 355 = extattrctl */ { AS(extattr_set_file_args), (sy_call_t *)sys_extattr_set_file, AUE_EXTATTR_SET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = extattr_set_file */ { AS(extattr_get_file_args), (sy_call_t *)sys_extattr_get_file, AUE_EXTATTR_GET_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = extattr_get_file */ { AS(extattr_delete_file_args), (sy_call_t *)sys_extattr_delete_file, AUE_EXTATTR_DELETE_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = extattr_delete_file */ - { AS(aio_waitcomplete_args), (sy_call_t *)sys_aio_waitcomplete, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 359 = aio_waitcomplete */ + { AS(aio_waitcomplete_args), (sy_call_t *)sys_aio_waitcomplete, AUE_AIO_WAITCOMPLETE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 359 = aio_waitcomplete */ { AS(getresuid_args), (sy_call_t *)sys_getresuid, AUE_GETRESUID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 360 = getresuid */ { AS(getresgid_args), (sy_call_t *)sys_getresgid, AUE_GETRESGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 361 = getresgid */ { 0, (sy_call_t *)sys_kqueue, AUE_KQUEUE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 362 = kqueue */ - { AS(kevent_args), (sy_call_t *)sys_kevent, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = kevent */ + { AS(kevent_args), (sy_call_t *)sys_kevent, AUE_KEVENT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 363 = kevent */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 364 = __cap_get_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 365 = __cap_set_proc */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 366 = __cap_get_fd */ @@ -419,7 +419,7 @@ struct sysent sysent[] = { { AS(extattr_set_fd_args), (sy_call_t *)sys_extattr_set_fd, AUE_EXTATTR_SET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 371 = extattr_set_fd */ { AS(extattr_get_fd_args), (sy_call_t *)sys_extattr_get_fd, AUE_EXTATTR_GET_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 372 = extattr_get_fd */ { AS(extattr_delete_fd_args), (sy_call_t *)sys_extattr_delete_fd, AUE_EXTATTR_DELETE_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 373 = extattr_delete_fd */ - { AS(__setugid_args), (sy_call_t *)sys___setugid, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = __setugid */ + { AS(__setugid_args), (sy_call_t *)sys___setugid, AUE_SETUGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = __setugid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 375 = nfsclnt */ { AS(eaccess_args), (sy_call_t *)sys_eaccess, AUE_EACCESS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 376 = eaccess */ { AS(afs3_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 377 = afs3_syscall */ @@ -470,18 +470,18 @@ struct sysent sysent[] = { { AS(setcontext_args), (sy_call_t *)sys_setcontext, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 422 = setcontext */ { AS(swapcontext_args), (sy_call_t *)sys_swapcontext, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 423 = swapcontext */ { AS(swapoff_args), (sy_call_t *)sys_swapoff, AUE_SWAPOFF, NULL, 0, 0, 0, SY_THR_STATIC }, /* 424 = swapoff */ - { AS(__acl_get_link_args), (sy_call_t *)sys___acl_get_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = __acl_get_link */ - { AS(__acl_set_link_args), (sy_call_t *)sys___acl_set_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = __acl_set_link */ - { AS(__acl_delete_link_args), (sy_call_t *)sys___acl_delete_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = __acl_delete_link */ - { AS(__acl_aclcheck_link_args), (sy_call_t *)sys___acl_aclcheck_link, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */ + { AS(__acl_get_link_args), (sy_call_t *)sys___acl_get_link, AUE_ACL_GET_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 425 = __acl_get_link */ + { AS(__acl_set_link_args), (sy_call_t *)sys___acl_set_link, AUE_ACL_SET_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 426 = __acl_set_link */ + { AS(__acl_delete_link_args), (sy_call_t *)sys___acl_delete_link, AUE_ACL_DELETE_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 427 = __acl_delete_link */ + { AS(__acl_aclcheck_link_args), (sy_call_t *)sys___acl_aclcheck_link, AUE_ACL_CHECK_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 428 = __acl_aclcheck_link */ { AS(sigwait_args), (sy_call_t *)sys_sigwait, AUE_SIGWAIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 429 = sigwait */ - { AS(thr_create_args), (sy_call_t *)sys_thr_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 430 = thr_create */ - { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */ + { AS(thr_create_args), (sy_call_t *)sys_thr_create, AUE_THR_CREATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 430 = thr_create */ + { AS(thr_exit_args), (sy_call_t *)sys_thr_exit, AUE_THR_EXIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 431 = thr_exit */ { AS(thr_self_args), (sy_call_t *)sys_thr_self, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 432 = thr_self */ - { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */ + { AS(thr_kill_args), (sy_call_t *)sys_thr_kill, AUE_THR_KILL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 433 = thr_kill */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 434 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 435 = nosys */ - { AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ + { AS(jail_attach_args), (sy_call_t *)sys_jail_attach, AUE_JAIL_ATTACH, NULL, 0, 0, 0, SY_THR_STATIC }, /* 436 = jail_attach */ { AS(extattr_list_fd_args), (sy_call_t *)sys_extattr_list_fd, AUE_EXTATTR_LIST_FD, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 437 = extattr_list_fd */ { AS(extattr_list_file_args), (sy_call_t *)sys_extattr_list_file, AUE_EXTATTR_LIST_FILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 438 = extattr_list_file */ { AS(extattr_list_link_args), (sy_call_t *)sys_extattr_list_link, AUE_EXTATTR_LIST_LINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 439 = extattr_list_link */ @@ -500,7 +500,7 @@ struct sysent sysent[] = { { AS(setaudit_addr_args), (sy_call_t *)sys_setaudit_addr, AUE_SETAUDIT_ADDR, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 452 = setaudit_addr */ { AS(auditctl_args), (sy_call_t *)sys_auditctl, AUE_AUDITCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 453 = auditctl */ { AS(_umtx_op_args), (sy_call_t *)sys__umtx_op, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 454 = _umtx_op */ - { AS(thr_new_args), (sy_call_t *)sys_thr_new, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = thr_new */ + { AS(thr_new_args), (sy_call_t *)sys_thr_new, AUE_THR_NEW, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 455 = thr_new */ { AS(sigqueue_args), (sy_call_t *)sys_sigqueue, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 456 = sigqueue */ { AS(kmq_open_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 457 = kmq_open */ { AS(kmq_setattr_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_ABSENT }, /* 458 = kmq_setattr */ @@ -510,7 +510,7 @@ struct sysent sysent[] = { { AS(kmq_unlink_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 462 = kmq_unlink */ { AS(abort2_args), (sy_call_t *)sys_abort2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 463 = abort2 */ { AS(thr_set_name_args), (sy_call_t *)sys_thr_set_name, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 464 = thr_set_name */ - { AS(aio_fsync_args), (sy_call_t *)sys_aio_fsync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 465 = aio_fsync */ + { AS(aio_fsync_args), (sy_call_t *)sys_aio_fsync, AUE_AIO_FSYNC, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 465 = aio_fsync */ { AS(rtprio_thread_args), (sy_call_t *)sys_rtprio_thread, AUE_RTPRIO, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 466 = rtprio_thread */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 467 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 468 = nosys */ @@ -526,7 +526,7 @@ struct sysent sysent[] = { { AS(lseek_args), (sy_call_t *)sys_lseek, AUE_LSEEK, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 478 = lseek */ { AS(truncate_args), (sy_call_t *)sys_truncate, AUE_TRUNCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 479 = truncate */ { AS(ftruncate_args), (sy_call_t *)sys_ftruncate, AUE_FTRUNCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 480 = ftruncate */ - { AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_KILL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ + { AS(thr_kill2_args), (sy_call_t *)sys_thr_kill2, AUE_THR_KILL2, NULL, 0, 0, 0, SY_THR_STATIC }, /* 481 = thr_kill2 */ { AS(shm_open_args), (sy_call_t *)sys_shm_open, AUE_SHMOPEN, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 482 = shm_open */ { AS(shm_unlink_args), (sy_call_t *)sys_shm_unlink, AUE_SHMUNLINK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 483 = shm_unlink */ { AS(cpuset_args), (sy_call_t *)sys_cpuset, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 484 = cpuset */ @@ -551,9 +551,9 @@ struct sysent sysent[] = { { AS(unlinkat_args), (sy_call_t *)sys_unlinkat, AUE_UNLINKAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 503 = unlinkat */ { AS(posix_openpt_args), (sy_call_t *)sys_posix_openpt, AUE_POSIX_OPENPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 504 = posix_openpt */ { AS(gssd_syscall_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 505 = gssd_syscall */ - { AS(jail_get_args), (sy_call_t *)sys_jail_get, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 506 = jail_get */ - { AS(jail_set_args), (sy_call_t *)sys_jail_set, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 507 = jail_set */ - { AS(jail_remove_args), (sy_call_t *)sys_jail_remove, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 508 = jail_remove */ + { AS(jail_get_args), (sy_call_t *)sys_jail_get, AUE_JAIL_GET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 506 = jail_get */ + { AS(jail_set_args), (sy_call_t *)sys_jail_set, AUE_JAIL_SET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 507 = jail_set */ + { AS(jail_remove_args), (sy_call_t *)sys_jail_remove, AUE_JAIL_REMOVE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 508 = jail_remove */ { AS(closefrom_args), (sy_call_t *)sys_closefrom, AUE_CLOSEFROM, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 509 = closefrom */ { AS(__semctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 510 = __semctl */ { AS(msgctl_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 511 = msgctl */ @@ -568,15 +568,15 @@ struct sysent sysent[] = { { AS(pdgetpid_args), (sy_call_t *)sys_pdgetpid, AUE_PDGETPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 520 = pdgetpid */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 521 = pdwait4 */ { AS(pselect_args), (sy_call_t *)sys_pselect, AUE_SELECT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 522 = pselect */ - { AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */ - { AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */ + { AS(getloginclass_args), (sy_call_t *)sys_getloginclass, AUE_GETLOGINCLASS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 523 = getloginclass */ + { AS(setloginclass_args), (sy_call_t *)sys_setloginclass, AUE_SETLOGINCLASS, NULL, 0, 0, 0, SY_THR_STATIC }, /* 524 = setloginclass */ { AS(rctl_get_racct_args), (sy_call_t *)sys_rctl_get_racct, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 525 = rctl_get_racct */ { AS(rctl_get_rules_args), (sy_call_t *)sys_rctl_get_rules, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 526 = rctl_get_rules */ { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ - { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = posix_fallocate */ - { AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = posix_fadvise */ + { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = posix_fallocate */ + { AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = posix_fadvise */ { AS(wait6_args), (sy_call_t *)sys_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = wait6 */ { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 533 = cap_rights_limit */ { AS(cap_ioctls_limit_args), (sy_call_t *)sys_cap_ioctls_limit, AUE_CAP_IOCTLS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 534 = cap_ioctls_limit */ @@ -588,8 +588,8 @@ struct sysent sysent[] = { { AS(chflagsat_args), (sy_call_t *)sys_chflagsat, AUE_CHFLAGSAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 540 = chflagsat */ { AS(accept4_args), (sy_call_t *)sys_accept4, AUE_ACCEPT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 541 = accept4 */ { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 542 = pipe2 */ - { AS(aio_mlock_args), (sy_call_t *)sys_aio_mlock, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 543 = aio_mlock */ - { AS(procctl_args), (sy_call_t *)sys_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = procctl */ + { AS(aio_mlock_args), (sy_call_t *)sys_aio_mlock, AUE_AIO_MLOCK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 543 = aio_mlock */ + { AS(procctl_args), (sy_call_t *)sys_procctl, AUE_PROCCTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = procctl */ { AS(ppoll_args), (sy_call_t *)sys_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = ppoll */ { AS(futimens_args), (sy_call_t *)sys_futimens, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 546 = futimens */ { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Mar 29 21:31:45 2017 (r316181) +++ head/sys/kern/syscalls.master Wed Mar 29 22:33:56 2017 (r316182) @@ -348,7 +348,7 @@ 174 AUE_PWRITE COMPAT6 { ssize_t pwrite(int fd, \ const void *buf, \ size_t nbyte, int pad, off_t offset); } -175 AUE_NULL STD { int setfib(int fibnum); } +175 AUE_SETFIB STD { int setfib(int fibnum); } 176 AUE_NTP_ADJTIME STD { int ntp_adjtime(struct timex *tp); } 177 AUE_NULL UNIMPL sfork (BSD/OS 2.x) 178 AUE_NULL UNIMPL getdescriptor (BSD/OS 2.x) @@ -474,12 +474,12 @@ 250 AUE_MINHERIT STD { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK STD { int rfork(int flags); } -252 AUE_NULL OBSOL openbsd_poll +252 AUE_POLL OBSOL openbsd_poll 253 AUE_ISSETUGID STD { int issetugid(void); } 254 AUE_LCHOWN STD { int lchown(char *path, int uid, int gid); } -255 AUE_NULL STD { int aio_read(struct aiocb *aiocbp); } -256 AUE_NULL STD { int aio_write(struct aiocb *aiocbp); } -257 AUE_NULL STD { int lio_listio(int mode, \ +255 AUE_AIO_READ STD { int aio_read(struct aiocb *aiocbp); } +256 AUE_AIO_WRITE STD { int aio_write(struct aiocb *aiocbp); } +257 AUE_LIO_LISTIO STD { int lio_listio(int mode, \ struct aiocb * const *acb_list, \ int nent, struct sigevent *sig); } 258 AUE_NULL UNIMPL nosys @@ -556,16 +556,16 @@ 312 AUE_SETRESGID STD { int setresgid(gid_t rgid, gid_t egid, \ gid_t sgid); } 313 AUE_NULL OBSOL signanosleep -314 AUE_NULL STD { ssize_t aio_return(struct aiocb *aiocbp); } -315 AUE_NULL STD { int aio_suspend( \ +314 AUE_AIO_RETURN STD { ssize_t aio_return(struct aiocb *aiocbp); } +315 AUE_AIO_SUSPEND STD { int aio_suspend( \ struct aiocb * const * aiocbp, int nent, \ const struct timespec *timeout); } -316 AUE_NULL STD { int aio_cancel(int fd, \ +316 AUE_AIO_CANCEL STD { int aio_cancel(int fd, \ struct aiocb *aiocbp); } -317 AUE_NULL STD { int aio_error(struct aiocb *aiocbp); } -318 AUE_NULL COMPAT6 { int aio_read(struct oaiocb *aiocbp); } -319 AUE_NULL COMPAT6 { int aio_write(struct oaiocb *aiocbp); } -320 AUE_NULL COMPAT6 { int lio_listio(int mode, \ +317 AUE_AIO_ERROR STD { int aio_error(struct aiocb *aiocbp); } +318 AUE_AIO_READ COMPAT6 { int aio_read(struct oaiocb *aiocbp); } +319 AUE_AIO_WRITE COMPAT6 { int aio_write(struct oaiocb *aiocbp); } +320 AUE_LIO_LISTIO COMPAT6 { int lio_listio(int mode, \ struct oaiocb * const *acb_list, \ int nent, struct osigevent *sig); } 321 AUE_NULL STD { int yield(void); } @@ -615,21 +615,21 @@ const struct timespec *timeout); } 346 AUE_NULL STD { int sigwaitinfo(const sigset_t *set, \ siginfo_t *info); } -347 AUE_NULL STD { int __acl_get_file(const char *path, \ +347 AUE_ACL_GET_FILE STD { int __acl_get_file(const char *path, \ acl_type_t type, struct acl *aclp); } -348 AUE_NULL STD { int __acl_set_file(const char *path, \ +348 AUE_ACL_SET_FILE STD { int __acl_set_file(const char *path, \ acl_type_t type, struct acl *aclp); } -349 AUE_NULL STD { int __acl_get_fd(int filedes, \ +349 AUE_ACL_GET_FD STD { int __acl_get_fd(int filedes, \ acl_type_t type, struct acl *aclp); } -350 AUE_NULL STD { int __acl_set_fd(int filedes, \ +350 AUE_ACL_SET_FD STD { int __acl_set_fd(int filedes, \ acl_type_t type, struct acl *aclp); } -351 AUE_NULL STD { int __acl_delete_file(const char *path, \ +351 AUE_ACL_DELETE_FILE STD { int __acl_delete_file(const char *path, \ acl_type_t type); } -352 AUE_NULL STD { int __acl_delete_fd(int filedes, \ +352 AUE_ACL_DELETE_FD STD { int __acl_delete_fd(int filedes, \ acl_type_t type); } -353 AUE_NULL STD { int __acl_aclcheck_file(const char *path, \ +353 AUE_ACL_CHECK_FILE STD { int __acl_aclcheck_file(const char *path, \ acl_type_t type, struct acl *aclp); } -354 AUE_NULL STD { int __acl_aclcheck_fd(int filedes, \ +354 AUE_ACL_CHECK_FD STD { int __acl_aclcheck_fd(int filedes, \ acl_type_t type, struct acl *aclp); } 355 AUE_EXTATTRCTL STD { int extattrctl(const char *path, int cmd, \ const char *filename, int attrnamespace, \ @@ -645,7 +645,7 @@ 358 AUE_EXTATTR_DELETE_FILE STD { int extattr_delete_file(const char *path, \ int attrnamespace, \ const char *attrname); } -359 AUE_NULL STD { ssize_t aio_waitcomplete( \ +359 AUE_AIO_WAITCOMPLETE STD { ssize_t aio_waitcomplete( \ struct aiocb **aiocbp, \ struct timespec *timeout); } 360 AUE_GETRESUID STD { int getresuid(uid_t *ruid, uid_t *euid, \ @@ -653,7 +653,7 @@ 361 AUE_GETRESGID STD { int getresgid(gid_t *rgid, gid_t *egid, \ gid_t *sgid); } 362 AUE_KQUEUE STD { int kqueue(void); } -363 AUE_NULL STD { int kevent(int fd, \ +363 AUE_KEVENT STD { int kevent(int fd, \ struct kevent *changelist, int nchanges, \ struct kevent *eventlist, int nevents, \ const struct timespec *timeout); } @@ -673,7 +673,7 @@ 373 AUE_EXTATTR_DELETE_FD STD { int extattr_delete_fd(int fd, \ int attrnamespace, \ const char *attrname); } -374 AUE_NULL STD { int __setugid(int flag); } +374 AUE_SETUGID STD { int __setugid(int flag); } 375 AUE_NULL UNIMPL nfsclnt 376 AUE_EACCESS STD { int eaccess(char *path, int amode); } 377 AUE_NULL NOSTD|NOTSTATIC { int afs3_syscall(long syscall, \ @@ -715,18 +715,18 @@ 398 AUE_FHSTATFS STD { int fhstatfs(const struct fhandle *u_fhp, \ struct statfs *buf); } 399 AUE_NULL UNIMPL nosys -400 AUE_NULL NOSTD { int ksem_close(semid_t id); } -401 AUE_NULL NOSTD { int ksem_post(semid_t id); } -402 AUE_NULL NOSTD { int ksem_wait(semid_t id); } -403 AUE_NULL NOSTD { int ksem_trywait(semid_t id); } -404 AUE_NULL NOSTD { int ksem_init(semid_t *idp, \ +400 AUE_SEMCLOSE NOSTD { int ksem_close(semid_t id); } +401 AUE_SEMPOST NOSTD { int ksem_post(semid_t id); } +402 AUE_SEMWAIT NOSTD { int ksem_wait(semid_t id); } +403 AUE_SEMTRYWAIT NOSTD { int ksem_trywait(semid_t id); } +404 AUE_SEMINIT NOSTD { int ksem_init(semid_t *idp, \ unsigned int value); } -405 AUE_NULL NOSTD { int ksem_open(semid_t *idp, \ +405 AUE_SEMOPEN NOSTD { int ksem_open(semid_t *idp, \ const char *name, int oflag, \ mode_t mode, unsigned int value); } -406 AUE_NULL NOSTD { int ksem_unlink(const char *name); } -407 AUE_NULL NOSTD { int ksem_getvalue(semid_t id, int *val); } -408 AUE_NULL NOSTD { int ksem_destroy(semid_t id); } +406 AUE_SEMUNLINK NOSTD { int ksem_unlink(const char *name); } +407 AUE_SEMGETVALUE NOSTD { int ksem_getvalue(semid_t id, int *val); } +408 AUE_SEMDESTROY NOSTD { int ksem_destroy(semid_t id); } 409 AUE_NULL STD { int __mac_get_pid(pid_t pid, \ struct mac *mac_p); } 410 AUE_NULL STD { int __mac_get_link(const char *path_p, \ @@ -760,24 +760,24 @@ 423 AUE_NULL STD { int swapcontext(struct __ucontext *oucp, \ const struct __ucontext *ucp); } 424 AUE_SWAPOFF STD { int swapoff(const char *name); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Mar 29 23:00:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30C7ED23C2D; Wed, 29 Mar 2017 23:00:10 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EDACCEF; Wed, 29 Mar 2017 23:00:09 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TN08oA023634; Wed, 29 Mar 2017 23:00:08 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TN08Ea023631; Wed, 29 Mar 2017 23:00:08 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201703292300.v2TN08Ea023631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 29 Mar 2017 23:00:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316183 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 23:00:10 -0000 Author: davidcs Date: Wed Mar 29 23:00:07 2017 New Revision: 316183 URL: https://svnweb.freebsd.org/changeset/base/316183 Log: Upgrade firmware and other related files to version 5.4.64 Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_reset.c Modified: head/sys/dev/qlxgbe/ql_boot.c ============================================================================== --- head/sys/dev/qlxgbe/ql_boot.c Wed Mar 29 22:33:56 2017 (r316182) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Mar 29 23:00:07 2017 (r316183) @@ -35,7 +35,7 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_bootloader_version_major = 5; unsigned int ql83xx_bootloader_version_minor = 4; -unsigned int ql83xx_bootloader_version_sub = 62; +unsigned int ql83xx_bootloader_version_sub = 64; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -10957,9 +10957,9 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x97, 0x0e + 0x00, 0x00, 0x00, 0x00, 0x9b, 0x64, 0x95, 0x0e }; unsigned int ql83xx_bootloader_len = 131072; Modified: head/sys/dev/qlxgbe/ql_fw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_fw.c Wed Mar 29 22:33:56 2017 (r316182) +++ head/sys/dev/qlxgbe/ql_fw.c Wed Mar 29 23:00:07 2017 (r316183) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 62; +unsigned int ql83xx_firmware_version_sub = 64; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xc4, 0x5e, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x88, 0xcd, 0x7d, 0x72, 0x3d, 0x1f, 0x5f, 0xe0, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe4, 0x42, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5f, 0x7e, 0x74, 0x37, 0x27, 0xc9, 0xab, 0x39, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8b, 0xef, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x44, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0xf9, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7a, 0x9f, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x46, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xdd, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0xf9, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x9f, 0x90, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x46, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9f, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe5, 0x98, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x71, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfc, 0x89, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -69,118 +69,118 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x56, 0xa3, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7b, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6f, 0x94, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7d, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd1, 0xb8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xec, 0xa9, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0xbd, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x94, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x54, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0xae, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xde, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x35, 0xd0, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfa, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x8c, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x9a, 0xb9, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1a, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2f, 0xef, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9f, 0xd8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0xfb, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x14, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0xe4, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xbe, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xa0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xdd, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x72, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x47, 0xeb, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x73, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4f, 0x25, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xba, 0x0e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x30, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x86, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xb4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x19, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x84, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xdc, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x68, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x45, 0x36, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x29, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x56, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x6e, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x5e, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x51, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x40, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x47, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xcc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x68, 0x61, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x68, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd3, 0x4a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x25, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x8e, 0x63, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x0a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf8, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x6e, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xbc, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x7c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x57, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb7, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x8f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2a, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x79, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x44, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x30, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, + 0xbd, 0x19, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfc, 0x30, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x56, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x77, 0x1a, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -189,7 +189,7 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x56, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb5, 0x3f, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -232,9 +232,9 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0x5f, 0x1a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0c, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x24, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb2, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x49, 0x1a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xcb, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xe8, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x92, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -249,7838 +249,7837 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xda, 0xec, 0x3d, - 0x6d, 0x70, 0x5c, 0xd5, 0x75, 0xf7, 0x7d, 0xec, 0xee, 0xd3, 0x6a, 0x57, - 0x5e, 0x83, 0x4c, 0x84, 0x90, 0xe3, 0x27, 0xdb, 0xd8, 0xe2, 0x33, 0x6b, - 0x63, 0x1b, 0x63, 0x9c, 0xfa, 0x49, 0x96, 0x8d, 0xed, 0xc8, 0x44, 0x40, - 0xca, 0x37, 0x44, 0x24, 0x0d, 0x35, 0x84, 0x60, 0x31, 0x25, 0xa9, 0xf8, - 0x28, 0x7e, 0xb2, 0x25, 0xd9, 0x04, 0x9b, 0xc8, 0xd8, 0x01, 0x87, 0xd0, - 0xb0, 0x92, 0x31, 0xa5, 0x2d, 0x93, 0x2e, 0x93, 0x4c, 0x60, 0xda, 0xce, - 0xb0, 0xd8, 0x99, 0x60, 0x52, 0xdc, 0xba, 0x3f, 0x48, 0x43, 0x18, 0x9a, - 0xed, 0xa4, 0x4c, 0x55, 0x02, 0x64, 0xdb, 0xe9, 0x10, 0x39, 0xa9, 0xa1, - 0xf7, 0xdc, 0x8f, 0xf7, 0xde, 0xbd, 0xfb, 0xde, 0xdb, 0xbd, 0xb2, 0xec, - 0x4c, 0x3a, 0x5e, 0x66, 0xf0, 0x1e, 0xdd, 0x7b, 0xcf, 0x3d, 0xf7, 0xdc, - 0x73, 0xcf, 0x39, 0xf7, 0x9c, 0xf3, 0xde, 0x22, 0x0d, 0xd1, 0x8f, 0x89, - 0x0c, 0xa4, 0xa3, 0xdb, 0xd0, 0x69, 0xf8, 0xf7, 0x13, 0xa6, 0x9f, 0x3e, - 0x06, 0x1f, 0x7d, 0xf7, 0x6d, 0xf2, 0xdf, 0x57, 0xaa, 0x60, 0xf1, 0x53, - 0x94, 0xe0, 0x82, 0x22, 0xec, 0xea, 0xc8, 0x26, 0x5f, 0xf6, 0xa4, 0xc8, - 0x3f, 0xfd, 0x55, 0xfd, 0x35, 0xe4, 0x3a, 0xb9, 0x00, 0xcc, 0xbe, 0xdb, - 0x85, 0x0c, 0xa5, 0x17, 0x95, 0x0c, 0x4e, 0x3a, 0x42, 0x0d, 0x05, 0x93, - 0x02, 0xbd, 0x37, 0xd2, 0xcf, 0x9d, 0x51, 0xf3, 0xad, 0x43, 0x11, 0xf3, - 0x29, 0xc2, 0x1c, 0xdf, 0x91, 0x69, 0xc6, 0x37, 0x5f, 0x9b, 0x5e, 0x7c, - 0x8b, 0xa7, 0x19, 0xdf, 0x66, 0x7d, 0x6a, 0xf8, 0xf8, 0xf8, 0x9b, 0xcc, - 0x29, 0x8d, 0x0f, 0x91, 0xb7, 0xbc, 0x0b, 0xa8, 0xce, 0x5b, 0x7c, 0xeb, - 0xfa, 0x99, 0x68, 0xe8, 0x9b, 0x18, 0x25, 0xc0, 0x47, 0x3b, 0x86, 0xde, - 0xf8, 0x71, 0x8f, 0x96, 0xdb, 0x8d, 0x87, 0x00, 0x5c, 0xb8, 0x6b, 0xf6, - 0xca, 0x15, 0x88, 0xb4, 0x57, 0x78, 0xfb, 0x7b, 0x77, 0x6b, 0x05, 0xdc, - 0x9e, 0x1f, 0x84, 0xf1, 0x77, 0x5e, 0xf3, 0xea, 0xc5, 0xf3, 0xe8, 0xf8, - 0x41, 0xd6, 0xde, 0xb4, 0x5b, 0xcb, 0x3f, 0x86, 0xc7, 0x0f, 0x72, 0xfc, - 0xff, 0x4c, 0xc7, 0x0f, 0x8a, 0xf8, 0xf3, 0x5b, 0x31, 0xdc, 0xbb, 0xfe, - 0xe2, 0xc4, 0x79, 0x17, 0xd1, 0xf1, 0x5b, 0x59, 0xfb, 0xd5, 0x6f, 0x68, - 0xbd, 0x7b, 0xf0, 0x78, 0x80, 0xfb, 0x56, 0xdc, 0xf8, 0xec, 0x5d, 0x49, - 0x3a, 0x9e, 0xb7, 0xdf, 0xfb, 0x6b, 0xad, 0x6f, 0x14, 0x8f, 0xdf, 0xe6, - 0xe1, 0xd7, 0xc8, 0xf8, 0x6d, 0x12, 0xfd, 0x00, 0x17, 0x5e, 0xfe, 0xaf, - 0xf9, 0xcb, 0x2c, 0x3a, 0x9e, 0xb7, 0xbf, 0x74, 0x39, 0xea, 0x85, 0xf9, - 0x87, 0x30, 0xdc, 0x9f, 0x7b, 0xd5, 0x69, 0xa6, 0xeb, 0xeb, 0x1f, 0x62, - 0xed, 0x3f, 0xbb, 0xe5, 0x21, 0x0b, 0xe3, 0x2f, 0x02, 0xdc, 0x97, 0x19, - 0xc9, 0xe7, 0x5a, 0xe9, 0x78, 0xde, 0xbe, 0xf2, 0x0b, 0x0f, 0xed, 0x80, - 0xf9, 0x87, 0x81, 0x7e, 0x6b, 0x8d, 0x9d, 0x61, 0xeb, 0x1f, 0x66, 0xed, - 0x5d, 0x43, 0x0f, 0x59, 0x30, 0x3f, 0xc0, 0x8e, 0x69, 0xe6, 0xac, 0x0c, - 0x1d, 0xcf, 0xdb, 0xff, 0xe8, 0xd9, 0x87, 0x76, 0xc0, 0xfc, 0x23, 0xa6, - 0xbf, 0x1f, 0x18, 0x5f, 0xbf, 0x04, 0x17, 0x25, 0xb8, 0x22, 0xc1, 0xf9, - 0xed, 0xd2, 0x78, 0x09, 0x2e, 0x4a, 0x70, 0x45, 0x82, 0xf3, 0x3b, 0x80, - 0xbe, 0xe6, 0xb5, 0xb7, 0xb5, 0xd9, 0xb9, 0xa5, 0x4f, 0xe2, 0xf1, 0x00, - 0x17, 0xf2, 0x5f, 0x30, 0x2f, 0xd8, 0xbc, 0x05, 0xd6, 0x57, 0x04, 0xb8, - 0xb7, 0x65, 0xfb, 0x3d, 0xcd, 0xe7, 0x91, 0xf6, 0x0a, 0x6f, 0xdf, 0xb8, - 0x7b, 0x0b, 0xac, 0x2f, 0xff, 0x30, 0xf0, 0xa7, 0xed, 0xa0, 0x66, 0x2e, - 0xa6, 0xe3, 0x1f, 0x66, 0xed, 0x9b, 0xbf, 0xb7, 0x05, 0xd6, 0x57, 0x04, - 0xb8, 0xbf, 0x4d, 0xcb, 0x59, 0x97, 0xd3, 0xf1, 0xbc, 0x7d, 0xf7, 0x1b, - 0x5b, 0x2c, 0x2c, 0x1f, 0xf9, 0xaf, 0x53, 0x7a, 0x16, 0xb4, 0xd9, 0x94, - 0x7e, 0x02, 0x37, 0x66, 0x90, 0xb5, 0xf1, 0x36, 0x42, 0x3f, 0x6b, 0x5f, - 0xc2, 0xda, 0x2b, 0x04, 0x7e, 0x44, 0xe3, 0xed, 0xf9, 0x47, 0xa4, 0xf5, - 0x4b, 0x70, 0x51, 0x82, 0x2b, 0x12, 0x9c, 0xdf, 0x29, 0x8d, 0x97, 0xe0, - 0xa2, 0x04, 0x57, 0x24, 0x38, 0xbf, 0x4b, 0x1a, 0x2f, 0xc1, 0x45, 0x09, - 0xae, 0x48, 0x70, 0xfe, 0x51, 0x69, 0xbc, 0x04, 0x17, 0x25, 0xb8, 0x22, - 0xc1, 0xf9, 0x6f, 0x48, 0xe3, 0x25, 0xb8, 0x28, 0xc1, 0x15, 0x09, 0xce, - 0x3b, 0x18, 0x76, 0x37, 0xbd, 0x97, 0xe4, 0xe3, 0x01, 0x2e, 0xcf, 0xfb, - 0xd9, 0xd7, 0xf8, 0x78, 0x80, 0x4b, 0xbf, 0x39, 0x3c, 0x62, 0xb0, 0xf1, - 0x00, 0x17, 0x5e, 0xf8, 0xe8, 0x43, 0x06, 0xe7, 0x3b, 0x31, 0x9c, 0xdb, - 0xb5, 0xb4, 0xc1, 0x61, 0xe3, 0x01, 0xee, 0xef, 0x9e, 0x77, 0x1f, 0x83, - 0x8b, 0x00, 0xf7, 0xce, 0xd9, 0xbd, 0x6b, 0x35, 0x1b, 0x0f, 0x70, 0xfe, - 0x27, 0xdb, 0x8f, 0x33, 0x38, 0xdf, 0x25, 0xd1, 0x2f, 0xc1, 0x45, 0x09, - 0xae, 0x48, 0x70, 0x7e, 0xb5, 0x34, 0x5e, 0x82, 0x8b, 0x12, 0x5c, 0x91, - 0xe0, 0x7c, 0xb7, 0x34, 0x5e, 0x82, 0x8b, 0x12, 0x5c, 0x91, 0xe0, 0xfc, - 0x1a, 0x69, 0xbc, 0x04, 0x17, 0x25, 0xb8, 0x22, 0xc1, 0xf9, 0xb5, 0xd2, - 0x78, 0x09, 0x2e, 0x4a, 0x70, 0x45, 0x82, 0xf3, 0x57, 0x48, 0xe3, 0x25, - 0xb8, 0x28, 0xc1, 0x15, 0x09, 0xce, 0xaf, 0x83, 0xfd, 0xf9, 0xc3, 0x37, - 0xf8, 0x7e, 0xf6, 0x03, 0x7c, 0xf4, 0xab, 0x6f, 0x73, 0xb8, 0x48, 0xda, - 0x1f, 0x7f, 0x87, 0xc3, 0x15, 0xd2, 0xfe, 0x83, 0xf7, 0xbd, 0xfd, 0x5f, - 0x0f, 0xe7, 0xff, 0xf2, 0xbf, 0x3e, 0xce, 0xc7, 0x13, 0xf8, 0xa6, 0xef, - 0x73, 0xb8, 0x48, 0xe0, 0x07, 0x86, 0x39, 0x5c, 0x01, 0xb8, 0xf2, 0xf4, - 0xa3, 0x1c, 0xce, 0x6f, 0x00, 0xf8, 0xe5, 0x51, 0x6f, 0x3c, 0x81, 0x7f, - 0xfe, 0x2d, 0x6f, 0x3c, 0xc0, 0x68, 0xe6, 0xdc, 0x63, 0x7c, 0x3c, 0xc0, - 0xa3, 0x4b, 0x2f, 0xe0, 0x70, 0xfe, 0x33, 0x18, 0xb6, 0xbb, 0x4c, 0x0e, - 0xf7, 0x03, 0x5c, 0xbc, 0x3d, 0xcb, 0xe1, 0x22, 0xc0, 0xce, 0x8e, 0x9c, - 0x37, 0x1e, 0xe0, 0xa3, 0xcf, 0x9f, 0xed, 0x8d, 0xef, 0x01, 0xfc, 0xa5, - 0x57, 0xbd, 0xf5, 0xf7, 0x50, 0xfe, 0x54, 0xf8, 0x78, 0x09, 0xae, 0x48, - 0x70, 0x7e, 0xa3, 0x08, 0xf7, 0x4b, 0x70, 0x51, 0x82, 0x2b, 0x12, 0x9c, - 0xbf, 0x52, 0x1a, 0x2f, 0xc1, 0x45, 0x09, 0xae, 0x48, 0x70, 0xfe, 0xb3, - 0xd2, 0x78, 0x09, 0x2e, 0x4a, 0x70, 0x45, 0x82, 0x45, 0xff, 0xae, 0xda, - 0x3f, 0x98, 0x19, 0x84, 0x6b, 0xfa, 0x1b, 0x36, 0xff, 0xa6, 0x31, 0xa7, - 0x92, 0x4d, 0x36, 0x43, 0xf3, 0x9c, 0xcc, 0x1a, 0xfe, 0x4a, 0xbf, 0xe6, - 0x04, 0xe4, 0x93, 0xe2, 0x4b, 0x24, 0xb0, 0xfe, 0x07, 0x9f, 0x1b, 0xb7, - 0xdf, 0x98, 0x60, 0x6d, 0x1f, 0xcd, 0x41, 0x76, 0x6f, 0x6d, 0x7c, 0x6a, - 0xf4, 0xb3, 0xb3, 0x51, 0xfe, 0x98, 0x7e, 0x36, 0xab, 0xfb, 0x53, 0xd3, - 0x0a, 0x17, 0x6b, 0xef, 0x8f, 0x1a, 0xcc, 0xd6, 0x57, 0x89, 0x58, 0x5f, - 0xcd, 0xf9, 0x6a, 0x8c, 0xaf, 0x79, 0x5f, 0x51, 0x9c, 0xcf, 0xf5, 0x74, - 0x95, 0xc3, 0xe5, 0x27, 0xcb, 0xee, 0x2b, 0x9b, 0x70, 0xab, 0xe6, 0xdd, - 0x67, 0x10, 0xb2, 0x48, 0xbb, 0xaf, 0x9c, 0x6d, 0xb4, 0xef, 0x90, 0x36, - 0x88, 0x72, 0x25, 0x64, 0xb5, 0xd0, 0xfe, 0xf6, 0x56, 0xdc, 0x1f, 0x5d, - 0xa8, 0x33, 0xd4, 0x1f, 0x87, 0xcb, 0x4f, 0x46, 0xc4, 0x8f, 0x5e, 0x67, - 0x4d, 0x13, 0x0c, 0xfe, 0xdd, 0xee, 0x5f, 0x2d, 0x7e, 0x9d, 0x86, 0x4f, - 0xec, 0xfc, 0x9f, 0x7c, 0x78, 0x7a, 0xe9, 0xb1, 0x91, 0x14, 0x7f, 0xc0, - 0x7f, 0xf8, 0x83, 0xd6, 0x40, 0x7f, 0xa6, 0x7f, 0xbd, 0x76, 0xf4, 0x43, - 0x24, 0xca, 0x77, 0x2e, 0x23, 0xc2, 0x70, 0xa2, 0x92, 0xc8, 0x3f, 0x57, - 0x78, 0x50, 0x3a, 0x3f, 0xd4, 0xd5, 0xd9, 0x41, 0xf9, 0x8b, 0xf1, 0xa7, - 0x5b, 0xe9, 0xf9, 0xb2, 0xf5, 0xa0, 0x3e, 0x76, 0x8f, 0x9f, 0x0c, 0x7d, - 0x5c, 0x1b, 0x9e, 0x11, 0x00, 0xeb, 0x99, 0x9f, 0xf7, 0x77, 0x9b, 0xd4, - 0xfa, 0xa3, 0xd9, 0x8a, 0xf8, 0x2f, 0x50, 0xc4, 0xbf, 0x42, 0x11, 0xff, - 0x3a, 0x45, 0xfc, 0xd7, 0x29, 0xe2, 0xff, 0x92, 0x22, 0xfe, 0x7b, 0x15, - 0xf1, 0x6f, 0x55, 0xc4, 0xbf, 0x5b, 0x11, 0xff, 0xd3, 0x8a, 0xf8, 0xbf, - 0xab, 0x88, 0xff, 0xef, 0x15, 0xf1, 0xff, 0x83, 0x22, 0xfe, 0x37, 0x15, - 0xf1, 0x4f, 0x28, 0xe2, 0xff, 0x50, 0x11, 0x7f, 0x42, 0x53, 0xc3, 0x7f, - 0xa6, 0x5a, 0x7f, 0x34, 0x57, 0x11, 0x7f, 0x5e, 0x11, 0xff, 0x2a, 0x45, - 0xfc, 0x1b, 0x15, 0xf1, 0xdf, 0xac, 0x88, 0xff, 0x4e, 0x45, 0xfc, 0xf7, - 0x29, 0xe2, 0xdf, 0xae, 0x88, 0xff, 0x71, 0x45, 0xfc, 0xcf, 0x28, 0xe2, - 0xff, 0x9e, 0x22, 0xfe, 0x57, 0x14, 0xf1, 0x1f, 0x55, 0xc4, 0xff, 0xaf, - 0x8a, 0xf8, 0xdf, 0x57, 0xc4, 0xff, 0x5b, 0x45, 0xfc, 0x69, 0x5d, 0x0d, - 0x7f, 0x8b, 0x5a, 0x7f, 0xb4, 0x50, 0x11, 0xff, 0x52, 0x45, 0xfc, 0xdd, - 0x8a, 0xf8, 0xaf, 0x56, 0xc4, 0x7f, 0x9b, 0x22, 0xfe, 0xcd, 0x8a, 0xf8, - 0x1f, 0x52, 0xc4, 0xbf, 0x53, 0x11, 0xff, 0xb7, 0x15, 0xf1, 0xff, 0xa5, - 0x22, 0xfe, 0x97, 0x14, 0xf1, 0xff, 0x48, 0x11, 0xff, 0x1b, 0x8a, 0xf8, - 0x7f, 0xa1, 0x88, 0xff, 0xbf, 0x15, 0xf1, 0x23, 0x43, 0x0d, 0xff, 0x0c, - 0xb5, 0xfe, 0xee, 0x6c, 0x45, 0xfc, 0x17, 0x2a, 0xe2, 0x5f, 0xa1, 0x88, - 0x7f, 0xbd, 0x22, 0xfe, 0xeb, 0x14, 0xf1, 0xdf, 0xae, 0x88, 0xff, 0x5e, - 0x45, 0xfc, 0xdb, 0x14, 0xf1, 0xef, 0x56, 0xc4, 0x5f, 0x30, 0x4e, 0xc5, - 0xfd, 0xc3, 0xdd, 0x88, 0x2e, 0xfe, 0x24, 0x7c, 0xfd, 0xe5, 0x2a, 0x44, - 0xe2, 0x09, 0x47, 0x58, 0x06, 0x78, 0x53, 0x82, 0xde, 0x9f, 0xb2, 0x2c, - 0xbe, 0x30, 0x61, 0x02, 0xcc, 0xf3, 0x75, 0x2f, 0x5e, 0xc5, 0xe7, 0xdb, - 0xc5, 0xe3, 0x0b, 0x26, 0xeb, 0xcf, 0xef, 0x63, 0x1a, 0x1a, 0xd4, 0x0a, - 0xf4, 0xda, 0xf5, 0x24, 0xbe, 0xb5, 0x2d, 0x40, 0x65, 0xd3, 0xcf, 0xd7, - 0x16, 0x9c, 0xcb, 0xc8, 0x55, 0x0c, 0xff, 0xa9, 0xb9, 0xc3, 0x40, 0x6d, - 0x40, 0x4a, 0xe1, 0x90, 0x36, 0xc8, 0xf1, 0xbf, 0x35, 0x4e, 0xf1, 0x5b, - 0x48, 0x43, 0x0e, 0x84, 0xf2, 0xaf, 0x1f, 0x40, 0x94, 0x3e, 0x91, 0x7e, - 0xde, 0xbf, 0xf3, 0x6b, 0xe1, 0xeb, 0xb7, 0x2d, 0x84, 0x9c, 0xb4, 0xdd, - 0x88, 0x26, 0x2f, 0x45, 0xe5, 0x14, 0xda, 0x8f, 0x74, 0x16, 0xef, 0xb9, - 0x94, 0x04, 0x60, 0xfa, 0xbc, 0x0b, 0x76, 0x87, 0xc3, 0xe8, 0x71, 0x66, - 0x61, 0x7a, 0x9e, 0xfa, 0xd1, 0xfc, 0x96, 0xe4, 0xa2, 0xe6, 0x11, 0xd7, - 0x42, 0xbb, 0x06, 0xf7, 0x90, 0x54, 0xc2, 0x84, 0x11, 0x5c, 0x3f, 0xa7, - 0x0f, 0x69, 0x1b, 0x0f, 0xd1, 0x7c, 0xf4, 0x26, 0x9d, 0xac, 0x9f, 0x05, - 0xfb, 0x9c, 0x46, 0xc2, 0x87, 0x3e, 0x88, 0xe2, 0x10, 0xfa, 0xad, 0x3c, - 0xc2, 0x73, 0xf3, 0x78, 0x13, 0xba, 0x96, 0xe5, 0xab, 0xad, 0x6d, 0x63, - 0x8d, 0x20, 0x1c, 0xed, 0x4c, 0x48, 0xaa, 0xf1, 0x37, 0x1c, 0x64, 0xf8, - 0x85, 0xf8, 0x50, 0x27, 0xc3, 0x0f, 0xcb, 0x71, 0xf4, 0x6a, 0xfc, 0xd7, - 0x31, 0xfc, 0xe9, 0xc1, 0x31, 0x20, 0xc1, 0x3d, 0x2f, 0x12, 0xbf, 0x26, - 0xe2, 0x77, 0xb2, 0x07, 0xdb, 0xdb, 0xd8, 0xfe, 0x61, 0xd8, 0xaa, 0xe2, - 0x0f, 0xfd, 0x5c, 0xcf, 0xf0, 0x57, 0xe1, 0xf3, 0xe4, 0x61, 0x82, 0x8d, - 0xdf, 0x65, 0x90, 0xf5, 0x33, 0x7c, 0xbc, 0xff, 0xa7, 0xf6, 0xd3, 0xfe, - 0xa6, 0x84, 0x1f, 0xa1, 0x9d, 0xdc, 0xfd, 0x27, 0xfc, 0x76, 0xd0, 0xeb, - 0x9a, 0x03, 0x53, 0xb5, 0xdc, 0xa5, 0x43, 0xbc, 0x8b, 0xd1, 0xe3, 0xde, - 0xc0, 0xf3, 0xfd, 0x64, 0x3f, 0x47, 0x1a, 0x20, 0x9e, 0xea, 0x26, 0xb0, - 0x10, 0x75, 0x6e, 0x3c, 0xa8, 0xb5, 0xe1, 0x5d, 0x9f, 0xdc, 0x6c, 0x94, - 0x87, 0xb5, 0xb1, 0x9b, 0xaf, 0x74, 0xcd, 0x32, 0x5a, 0xae, 0x6b, 0xe8, - 0xb9, 0xc4, 0x8f, 0x11, 0xda, 0x8e, 0xf7, 0xeb, 0x60, 0x36, 0xe7, 0xd3, - 0x57, 0x4d, 0x3f, 0x97, 0x77, 0xbe, 0xfe, 0x23, 0xda, 0xca, 0x10, 0xfa, - 0x79, 0x7f, 0x46, 0xbf, 0x7b, 0x0b, 0xa7, 0x07, 0xe4, 0xed, 0x2c, 0xa0, - 0x97, 0xee, 0x07, 0xd0, 0x9b, 0x84, 0x5a, 0x86, 0xc3, 0x14, 0x46, 0x68, - 0x79, 0x8a, 0x0d, 0x49, 0x86, 0xdf, 0x57, 0xbc, 0xf3, 0xa7, 0xd1, 0xf3, - 0xd4, 0xc3, 0xcf, 0x17, 0xe1, 0x07, 0xe7, 0xd7, 0xe7, 0x23, 0xf8, 0x6f, - 0xa1, 0x8d, 0x06, 0xa5, 0x97, 0xae, 0x8f, 0xd3, 0xb7, 0x26, 0xb2, 0xbf, - 0xc8, 0x4f, 0x4f, 0x5e, 0xa5, 0xf3, 0x75, 0x46, 0x42, 0x58, 0x6f, 0xaf, - 0x46, 0x03, 0x31, 0x7d, 0x7e, 0x7c, 0x71, 0x42, 0x0f, 0x8b, 0x27, 0x02, - 0xab, 0x1d, 0x40, 0xba, 0x6f, 0x2e, 0x5b, 0x7f, 0x0f, 0x27, 0x29, 0x51, - 0xcf, 0x7d, 0x2d, 0x82, 0xdf, 0xe8, 0x8b, 0x8c, 0xde, 0x93, 0xbd, 0x3e, - 0x0b, 0xeb, 0x33, 0xc2, 0xcf, 0xc9, 0xfb, 0xe2, 0xf6, 0x1f, 0xdd, 0xee, - 0xd5, 0x9f, 0x84, 0xd3, 0xbf, 0xbf, 0x89, 0xf6, 0x87, 0x5e, 0x2b, 0x4d, - 0xdb, 0x00, 0x79, 0x2d, 0x27, 0xd0, 0x18, 0xd5, 0x17, 0xe3, 0x4d, 0x9e, - 0x7e, 0x44, 0x4d, 0xc8, 0x3b, 0xaa, 0x0a, 0xfc, 0x79, 0x1b, 0xf9, 0xf4, - 0x40, 0x42, 0x13, 0x75, 0x70, 0x79, 0xf3, 0xce, 0x93, 0x1e, 0xa4, 0xff, - 0xbe, 0x74, 0x7d, 0xf6, 0x82, 0xf7, 0xff, 0x7c, 0xa3, 0x5a, 0x7f, 0xf9, - 0x7c, 0x6c, 0xaa, 0xc1, 0x9f, 0xf9, 0x27, 0x88, 0xff, 0x0e, 0x0f, 0x7f, - 0x0f, 0x5f, 0x6f, 0x22, 0x3c, 0xbe, 0xbd, 0x53, 0xb2, 0x57, 0xae, 0x89, - 0x3d, 0x29, 0x48, 0xa9, 0x69, 0x2f, 0x1d, 0x42, 0x83, 0x55, 0xf6, 0x14, - 0x1b, 0x88, 0x26, 0x62, 0x1f, 0xe7, 0x31, 0x7e, 0xca, 0xf8, 0xcc, 0x40, - 0xfa, 0xb1, 0x2a, 0xff, 0x14, 0xb0, 0xaf, 0xc7, 0x88, 0x7d, 0xb5, 0xf1, - 0xae, 0x3a, 0x67, 0xec, 0x4d, 0x20, 0x3b, 0x8f, 0x4a, 0x29, 0xbc, 0xff, - 0xe8, 0x06, 0x26, 0x8d, 0x6e, 0x33, 0xec, 0xb7, 0x8b, 0x8e, 0x74, 0x3a, - 0x4d, 0x81, 0xf3, 0xcf, 0x04, 0xf8, 0x57, 0x7f, 0xc1, 0xd6, 0x47, 0x66, - 0x1b, 0x4e, 0x83, 0xfc, 0xd8, 0x01, 0x7b, 0x8a, 0xf6, 0x81, 0xfa, 0xa6, - 0xf4, 0x61, 0xa1, 0x35, 0xeb, 0x8f, 0x27, 0x9f, 0x19, 0xeb, 0x3f, 0x78, - 0xe7, 0xe5, 0xa7, 0x0b, 0x42, 0xd7, 0xcf, 0xf7, 0xc3, 0xf9, 0x52, 0x52, - 0x38, 0x0f, 0x2e, 0x72, 0x8c, 0xa0, 0xbd, 0xd0, 0xdd, 0xb5, 0x46, 0xf0, - 0x7c, 0xf2, 0xfe, 0x6c, 0x79, 0xc5, 0xaf, 0x9c, 0x83, 0x42, 0xe5, 0x83, - 0x7f, 0x79, 0x4a, 0xaf, 0x8f, 0xbe, 0x68, 0x7a, 0x3a, 0x8d, 0x93, 0x8b, - 0xbf, 0xeb, 0x24, 0xe3, 0x5f, 0x7d, 0x92, 0xf1, 0x7f, 0x86, 0xed, 0x0f, - 0x2a, 0x75, 0xea, 0x71, 0xfe, 0xe3, 0xeb, 0x92, 0x7d, 0x8a, 0x3a, 0x2f, - 0x8b, 0xc2, 0xcf, 0x0b, 0x3f, 0x0f, 0xce, 0x7b, 0x92, 0xbf, 0x39, 0x91, - 0x02, 0x7c, 0x39, 0x6c, 0x7f, 0x89, 0xbd, 0x68, 0xd9, 0x9c, 0x2a, 0x6d, - 0xf5, 0xf5, 0xd5, 0xbf, 0x7d, 0x8e, 0xeb, 0xcf, 0x5d, 0x46, 0x53, 0x72, - 0x08, 0xeb, 0xb2, 0xe3, 0xc9, 0xc2, 0x08, 0x1e, 0x4f, 0x68, 0x1d, 0x6f, - 0xf0, 0xf5, 0x67, 0x83, 0x16, 0xb4, 0x2f, 0x30, 0x7a, 0x71, 0x5a, 0x38, - 0xff, 0xdc, 0xbe, 0x27, 0x51, 0x99, 0x9e, 0x2f, 0x62, 0xaf, 0x27, 0x2f, - 0xa1, 0xf4, 0x62, 0x7d, 0xbc, 0x60, 0x36, 0x0c, 0x67, 0xf4, 0xf3, 0x7a, - 0xc8, 0x51, 0x03, 0x72, 0xc0, 0xf8, 0xbc, 0x5e, 0x1f, 0xaf, 0x9f, 0xb9, - 0xff, 0xb7, 0xfa, 0x32, 0x41, 0x9e, 0x7f, 0xe0, 0xed, 0xcf, 0xc3, 0xdc, - 0x9f, 0xce, 0x0a, 0xfe, 0x22, 0xeb, 0xcf, 0xce, 0x43, 0x7f, 0x6a, 0x6c, - 0x3e, 0x1b, 0xff, 0x1a, 0x12, 0xfa, 0xa3, 0xc3, 0x5a, 0x10, 0xe6, 0xfa, - 0xcf, 0xbd, 0xc7, 0x10, 0xec, 0x1f, 0xe7, 0x97, 0x85, 0x5e, 0xd3, 0x9a, - 0x60, 0xab, 0xdd, 0x63, 0xd4, 0x7f, 0x26, 0xfa, 0x62, 0x3c, 0xe3, 0xf3, - 0x2b, 0x23, 0xf0, 0x0b, 0x88, 0x5b, 0x2e, 0xec, 0xbf, 0xe7, 0x7f, 0x50, - 0x7e, 0x11, 0xfd, 0xe5, 0xf3, 0x0b, 0xc8, 0x9f, 0x9b, 0x0d, 0xf0, 0x0b, - 0x16, 0x50, 0xb8, 0xb2, 0xd1, 0x1f, 0x7f, 0x8e, 0x92, 0x3d, 0xe3, 0x5f, - 0x0e, 0x7b, 0xfc, 0x5a, 0xcf, 0xfd, 0x8b, 0x26, 0xb2, 0x7e, 0x56, 0xb7, - 0x98, 0x7a, 0x85, 0xf3, 0xa7, 0x41, 0x0f, 0xb6, 0xc3, 0xf4, 0x74, 0xbd, - 0x8b, 0x04, 0x79, 0xe7, 0xfc, 0x60, 0xfc, 0x72, 0x38, 0xbf, 0xa8, 0xa6, - 0x1c, 0x4f, 0xfb, 0xfc, 0x48, 0x57, 0xc9, 0xcf, 0x92, 0x74, 0xa8, 0xfc, - 0x53, 0x7e, 0x60, 0x7e, 0x3a, 0x2d, 0x3e, 0x3f, 0x80, 0xbd, 0x1d, 0x0d, - 0x01, 0x7e, 0xb0, 0x75, 0x3c, 0x6b, 0xf2, 0xf1, 0x37, 0x4c, 0x89, 0x1f, - 0x6f, 0x7a, 0xfc, 0x78, 0x8d, 0xcf, 0xdf, 0x44, 0xfd, 0x63, 0xc6, 0x8f, - 0x17, 0x38, 0x3f, 0x1e, 0x16, 0xda, 0xeb, 0xe4, 0x07, 0x1a, 0xe2, 0xfc, - 0x20, 0x02, 0x38, 0xde, 0xe8, 0xf3, 0xa3, 0xb1, 0x4a, 0x3e, 0x96, 0xc5, - 0xc9, 0x07, 0xee, 0x4d, 0xee, 0x13, 0xfc, 0x3c, 0x41, 0x31, 0xcb, 0xac, - 0x00, 0x3f, 0xb8, 0xbd, 0x7a, 0x0e, 0xdc, 0x11, 0x38, 0x4f, 0x6d, 0x53, - 0xe2, 0xc7, 0x2f, 0xab, 0xe4, 0x63, 0xd3, 0x0c, 0xaa, 0x3f, 0x98, 0xbf, - 0xd9, 0x82, 0xd7, 0x69, 0x70, 0xfe, 0x0f, 0xe1, 0x1d, 0xc9, 0x83, 0x5f, - 0x84, 0xc7, 0xaf, 0xd7, 0x83, 0xfd, 0xeb, 0x95, 0x97, 0x7a, 0xf9, 0x03, - 0xa3, 0x97, 0x89, 0xfa, 0x46, 0x90, 0x17, 0x4f, 0x1f, 0x73, 0xfe, 0x90, - 0xd6, 0x3d, 0x16, 0xd0, 0x87, 0xc0, 0x1f, 0xc4, 0x5e, 0xc9, 0xee, 0xe6, - 0xe0, 0xf8, 0x1b, 0xa7, 0xc4, 0x9f, 0xff, 0xf5, 0xf5, 0x0d, 0x9f, 0x3f, - 0x17, 0xb8, 0x3f, 0xda, 0x86, 0xc5, 0xed, 0x6d, 0x83, 0x11, 0x6c, 0xaf, - 0x93, 0x1f, 0xae, 0xc7, 0x0f, 0xd2, 0x3c, 0x9e, 0xf5, 0xf9, 0x91, 0xad, - 0x92, 0x97, 0x15, 0xa2, 0xbc, 0xc4, 0xea, 0x5f, 0x70, 0x50, 0x16, 0xcc, - 0x90, 0xf4, 0xaf, 0xfd, 0x59, 0xcb, 0x1f, 0xdf, 0x32, 0x25, 0x7e, 0xb0, - 0x2a, 0x8b, 0x7e, 0x7f, 0xff, 0x27, 0x66, 0x04, 0xee, 0xb7, 0x39, 0x9f, - 0x1f, 0x9e, 0xbe, 0x9d, 0x11, 0xe6, 0x3f, 0x72, 0x7e, 0xfc, 0xe3, 0xb5, - 0x11, 0xf1, 0x06, 0xf2, 0xcf, 0x78, 0x82, 0xf3, 0x83, 0xf1, 0xab, 0x34, - 0x18, 0xa9, 0x9f, 0xd7, 0x53, 0xfd, 0x5c, 0xba, 0x8f, 0xc5, 0x37, 0xb8, - 0xbc, 0x4c, 0x04, 0xef, 0x7b, 0x6e, 0xe4, 0x78, 0x0d, 0xf6, 0x6b, 0xc4, - 0x42, 0xa5, 0x45, 0x90, 0xe6, 0x1e, 0x0b, 0xdc, 0xc7, 0xc8, 0x78, 0xe8, - 0xee, 0xb4, 0x8a, 0xfa, 0xe9, 0xfc, 0x06, 0xdf, 0x3e, 0x3f, 0xce, 0xdc, - 0xe5, 0x24, 0x5a, 0xbe, 0x64, 0xaf, 0x81, 0xb6, 0xf7, 0x3b, 0x86, 0xb7, - 0x18, 0x47, 0xd7, 0xb0, 0x3f, 0x8c, 0xda, 0xec, 0xec, 0xb6, 0x28, 0x7f, - 0xb2, 0xb0, 0x15, 0x5b, 0x12, 0x67, 0x99, 0x9d, 0xca, 0x65, 0x21, 0x83, - 0x8e, 0x9e, 0xd1, 0x5f, 0x19, 0xdb, 0x82, 0xff, 0xde, 0xfc, 0xca, 0x3d, - 0x84, 0xa1, 0xc3, 0xcd, 0xf6, 0x73, 0x54, 0x18, 0xac, 0x0b, 0xe9, 0x78, - 0x9b, 0xfb, 0xab, 0x78, 0x72, 0xe2, 0xaf, 0xf2, 0x78, 0x11, 0x3e, 0xad, - 0xa1, 0xfb, 0xc9, 0xda, 0x9d, 0x01, 0xe1, 0x3e, 0xbb, 0x9a, 0xd9, 0x4b, - 0xce, 0x8f, 0xe6, 0xfd, 0xe2, 0x7d, 0x4f, 0x0f, 0xdc, 0xf7, 0x82, 0xf2, - 0xcc, 0xf5, 0x4f, 0xf7, 0xea, 0xcb, 0x82, 0xf7, 0x47, 0x87, 0xf3, 0x17, - 0x79, 0x06, 0x7f, 0x00, 0x05, 0xef, 0x4b, 0x9c, 0xdf, 0xf8, 0xbc, 0x30, - 0x89, 0x19, 0x98, 0xe9, 0xdb, 0xa3, 0x71, 0xcb, 0x97, 0x7f, 0xab, 0x4a, - 0x1f, 0xe4, 0x63, 0xf4, 0x81, 0xa7, 0xaf, 0xb8, 0x3e, 0x20, 0xd2, 0xb9, - 0xb7, 0x21, 0xa8, 0x0f, 0xf6, 0x4c, 0x83, 0x3e, 0x58, 0x69, 0xc8, 0xfa, - 0x60, 0x82, 0xd2, 0xcf, 0xd7, 0xb3, 0xef, 0xd8, 0x4c, 0x85, 0xf3, 0x5f, - 0xda, 0x5e, 0x5b, 0x1f, 0x26, 0xeb, 0xb2, 0x17, 0x35, 0xe9, 0x9f, 0xcd, - 0xbf, 0x9b, 0x61, 0xeb, 0x75, 0xc1, 0xde, 0x14, 0xed, 0x14, 0xdc, 0xa7, - 0xa8, 0xbf, 0x39, 0x90, 0x9c, 0x0a, 0x7f, 0xae, 0x34, 0xaa, 0xec, 0x89, - 0x26, 0xf0, 0x27, 0x37, 0xc0, 0x60, 0x4b, 0xf2, 0x7f, 0x25, 0x7c, 0x74, - 0xad, 0xae, 0xc1, 0xe3, 0x13, 0xc4, 0x3f, 0xc0, 0xfe, 0xaa, 0x95, 0x47, - 0x76, 0x12, 0xec, 0x61, 0xd6, 0xb5, 0xc0, 0x1e, 0xda, 0xef, 0x33, 0x79, - 0x76, 0x34, 0x88, 0x7f, 0x8e, 0xa0, 0xc9, 0x55, 0xe7, 0xe3, 0xfb, 0xa7, - 0x83, 0x36, 0xea, 0xcb, 0x89, 0xc8, 0xdf, 0xad, 0x95, 0xb1, 0x3e, 0xc0, - 0xda, 0x6e, 0x5f, 0x8f, 0x89, 0x9e, 0xfa, 0xea, 0x1e, 0x1a, 0x1f, 0x85, - 0x91, 0x7d, 0xd6, 0xfe, 0x04, 0xa0, 0xbe, 0x3e, 0x24, 0x5e, 0x8a, 0xfd, - 0x69, 0xae, 0x5f, 0xf5, 0xe0, 0x79, 0x79, 0x24, 0x52, 0xff, 0x48, 0xe7, - 0x43, 0x59, 0x9f, 0x67, 0x62, 0xed, 0x3f, 0x7c, 0xb5, 0x65, 0x7f, 0xc8, - 0xed, 0x69, 0xf0, 0xc7, 0x9f, 0x3d, 0x25, 0x79, 0xbe, 0xc3, 0xdb, 0x2f, - 0xcf, 0x7e, 0x35, 0x0b, 0xfb, 0x35, 0x30, 0xd0, 0xac, 0x22, 0xcf, 0x8f, - 0xd4, 0xf4, 0x07, 0xa3, 0xf4, 0x93, 0x78, 0x9e, 0xa3, 0xe8, 0xbd, 0xb7, - 0xfa, 0xfc, 0x89, 0xf4, 0xa2, 0x49, 0x15, 0x7a, 0xd1, 0xce, 0x9a, 0xe7, - 0x2f, 0x8a, 0xde, 0xfa, 0xce, 0xdf, 0x96, 0xea, 0xf3, 0x30, 0x4b, 0xa4, - 0x77, 0x60, 0x56, 0x9c, 0x7d, 0xf4, 0xf3, 0x03, 0x11, 0xfa, 0x1c, 0x7d, - 0x40, 0xe4, 0x9f, 0x1a, 0x94, 0xf1, 0x14, 0xa7, 0x9f, 0xeb, 0x6f, 0x7e, - 0x7e, 0x5a, 0xa9, 0xfc, 0xb7, 0x69, 0x58, 0x1f, 0x93, 0xf8, 0x2d, 0x56, - 0xd0, 0x7d, 0x4d, 0x29, 0x28, 0xf1, 0x4f, 0x2c, 0xa7, 0xe7, 0xe1, 0x28, - 0xad, 0xef, 0xb2, 0x6c, 0x94, 0xb4, 0x51, 0xc8, 0x79, 0xd0, 0x82, 0xe7, - 0x01, 0xc4, 0xaf, 0x09, 0xfe, 0x57, 0x58, 0xe4, 0xf9, 0x1b, 0xa0, 0x82, - 0x39, 0x3f, 0x73, 0x68, 0x23, 0x5a, 0x69, 0x05, 0xe2, 0x47, 0x5a, 0x56, - 0x63, 0xf1, 0xf1, 0xa4, 0x54, 0x3f, 0x99, 0x08, 0xb3, 0x0f, 0x74, 0x7f, - 0x9e, 0xd6, 0xfd, 0xfd, 0x08, 0xf0, 0xdb, 0x8d, 0xbb, 0x7f, 0xf1, 0xfd, - 0xe2, 0xe5, 0xc0, 0x93, 0x67, 0xd1, 0xf9, 0x3c, 0x7f, 0xa0, 0x4e, 0x7d, - 0x39, 0xcc, 0xfb, 0x9f, 0xc5, 0xe3, 0x47, 0x69, 0xf0, 0xaf, 0x1c, 0xaa, - 0x1f, 0x73, 0xd0, 0x9a, 0xb3, 0x4d, 0x64, 0x2d, 0xa1, 0xfa, 0x08, 0xad, - 0xe3, 0xf1, 0xe8, 0x63, 0x73, 0x68, 0xfc, 0x09, 0xd3, 0x9e, 0x4a, 0x81, - 0x1e, 0x75, 0x86, 0x40, 0x1e, 0x59, 0xfc, 0xd3, 0xb9, 0x4b, 0xb3, 0x63, - 0xf6, 0xbb, 0x59, 0x8a, 0xe7, 0x1f, 0xf2, 0xee, 0xbf, 0x3b, 0x78, 0x3e, - 0x08, 0x01, 0xfd, 0xbc, 0x7f, 0xd7, 0x75, 0xa2, 0xbd, 0x7e, 0xcb, 0xeb, - 0xcf, 0xe3, 0x77, 0x9b, 0x2c, 0xba, 0xfe, 0xc0, 0x78, 0xca, 0x0f, 0xc3, - 0xe3, 0x07, 0xa5, 0x27, 0x45, 0xe3, 0x77, 0xe5, 0xf8, 0xf8, 0x9d, 0x33, - 0x9f, 0xea, 0x1f, 0x1e, 0x7f, 0x28, 0x1d, 0x63, 0xf1, 0x87, 0xac, 0xa0, - 0x2f, 0xfd, 0xf8, 0x9b, 0x18, 0x2f, 0xfd, 0xee, 0x55, 0xe1, 0xf9, 0x0d, - 0xd9, 0xfe, 0xf3, 0xf5, 0xa4, 0x23, 0xe2, 0xd1, 0x9c, 0x3f, 0x8d, 0x52, - 0xfc, 0x3a, 0x53, 0x23, 0x7e, 0x9d, 0x65, 0xed, 0x39, 0x1e, 0x2c, 0x94, - 0xc6, 0xcf, 0x0a, 0xf8, 0x3b, 0xf0, 0xf9, 0x44, 0x64, 0x7e, 0x26, 0xab, - 0x89, 0xf9, 0x8d, 0xf0, 0x78, 0xf8, 0x5b, 0x57, 0x89, 0xfe, 0x7e, 0x5a, - 0x3f, 0xcb, 0x8c, 0x8b, 0x9f, 0x4b, 0xfd, 0x4b, 0x8a, 0xfd, 0x51, 0x23, - 0xeb, 0xcf, 0xe7, 0x3b, 0x83, 0xc1, 0x72, 0x7f, 0xb6, 0xbe, 0xf2, 0xfd, - 0x63, 0x1f, 0x24, 0xe2, 0xe2, 0xc9, 0x97, 0xde, 0xa2, 0x16, 0x4f, 0x7e, - 0xe7, 0x4f, 0xea, 0xcd, 0x9f, 0x7a, 0xfe, 0x9d, 0x52, 0x7c, 0xfe, 0xf2, - 0x76, 0x35, 0x7a, 0xc6, 0x75, 0xb5, 0xfe, 0x47, 0x3e, 0xad, 0x4a, 0x7f, - 0xb8, 0x3f, 0xe5, 0xe5, 0x0f, 0x24, 0xfc, 0x87, 0x6f, 0x16, 0xf8, 0x8f, - 0x0a, 0xed, 0xd9, 0xd8, 0x78, 0xed, 0x3b, 0x46, 0x38, 0x3d, 0xf5, 0xe2, - 0x77, 0xed, 0x6c, 0x6c, 0xbe, 0xe0, 0xcc, 0x3f, 0x55, 0x5e, 0x6f, 0x4a, - 0x29, 0xdf, 0x74, 0x93, 0x94, 0x9f, 0xac, 0x41, 0xcf, 0x6f, 0x35, 0xb5, - 0xfd, 0xba, 0xed, 0x49, 0x11, 0x7f, 0x2d, 0x7e, 0xa6, 0x4d, 0x35, 0xfc, - 0xab, 0x22, 0xf3, 0x3b, 0x8d, 0x52, 0xbe, 0x82, 0xdb, 0x63, 0x9a, 0xdf, - 0xe2, 0xf7, 0xa3, 0xf2, 0x47, 0x67, 0x53, 0xfb, 0xbb, 0xc7, 0x26, 0xd1, - 0xdc, 0x2b, 0xda, 0x37, 0x69, 0x61, 0xf7, 0x3f, 0x39, 0x9f, 0x9b, 0xe1, - 0xe7, 0x1d, 0x5f, 0xee, 0x1c, 0x85, 0xf5, 0xd7, 0xda, 0xef, 0x6b, 0xaf, - 0x56, 0x5b, 0xff, 0x3f, 0x3d, 0x51, 0x23, 0x1e, 0x8e, 0x16, 0xc5, 0xc5, - 0xc3, 0xf1, 0xb5, 0x82, 0xe6, 0x2f, 0xea, 0xef, 0xdf, 0x29, 0xf6, 0xaf, - 0xe4, 0x63, 0xfb, 0x23, 0xd4, 0xae, 0xa4, 0x1f, 0x35, 0xa6, 0x0f, 0xa3, - 0xd6, 0x9b, 0x59, 0xaa, 0xc6, 0x9f, 0x85, 0x33, 0x44, 0xfc, 0xff, 0x73, - 0x8b, 0x16, 0xcb, 0xff, 0xbf, 0x59, 0x5c, 0xe3, 0x3c, 0x17, 0xc4, 0xf5, - 0x6e, 0x69, 0x14, 0xcf, 0xf3, 0xbf, 0xfc, 0x19, 0xf2, 0xec, 0x15, 0xe9, - 0xdf, 0x27, 0xf6, 0x1f, 0x95, 0xfa, 0x3f, 0xfa, 0xba, 0x11, 0x4b, 0xcf, - 0x9d, 0x4b, 0xd4, 0xd6, 0x7b, 0x6d, 0x83, 0x5a, 0xff, 0x0f, 0xcf, 0x54, - 0xeb, 0xff, 0xc5, 0x4f, 0xab, 0xf5, 0xff, 0x3b, 0xc5, 0x7c, 0xe7, 0xb1, - 0xac, 0x5a, 0xff, 0xad, 0x6b, 0x15, 0xf3, 0xbb, 0xbd, 0x53, 0xab, 0x1f, - 0xe2, 0xe3, 0x2b, 0x3d, 0x6a, 0xf3, 0xfd, 0xc7, 0x51, 0x43, 0xed, 0x3c, - 0xff, 0x44, 0xad, 0xff, 0x15, 0x8a, 0xf8, 0xbf, 0xb9, 0x4a, 0x8d, 0xfe, - 0xf3, 0x9e, 0x51, 0xc3, 0xbf, 0x55, 0x51, 0x7f, 0x8f, 0x27, 0xc3, 0xfb, - 0xeb, 0x68, 0xe7, 0x21, 0x9a, 0x9f, 0x63, 0xfe, 0x27, 0xca, 0x08, 0xfe, - 0xab, 0x9f, 0x9f, 0xe0, 0xf5, 0x18, 0x11, 0xfe, 0x70, 0x69, 0x91, 0xe8, - 0x0f, 0x3b, 0xdc, 0x1f, 0x16, 0xf3, 0xd9, 0x01, 0x7f, 0x58, 0x8b, 0xbb, - 0xef, 0xfd, 0xca, 0x62, 0xf8, 0x1d, 0xf0, 0x8f, 0xf7, 0xe2, 0x11, 0x03, - 0x5a, 0x69, 0x58, 0x1b, 0x8b, 0xea, 0x3f, 0x43, 0xf1, 0x3c, 0xfe, 0x7b, - 0x52, 0xaa, 0x6f, 0x50, 0xed, 0x6f, 0xe5, 0x63, 0xf3, 0xd7, 0xaf, 0xd4, - 0xfd, 0xfe, 0x89, 0xa6, 0x29, 0xf9, 0x7f, 0x7f, 0x15, 0xe1, 0x0f, 0x79, - 0x99, 0x7a, 0xe6, 0xaf, 0x43, 0x3e, 0x27, 0x03, 0x67, 0x9d, 0xd5, 0x0f, - 0x11, 0x7b, 0xec, 0x24, 0x33, 0x41, 0xfc, 0x2a, 0xf9, 0x7d, 0x1d, 0x5d, - 0x12, 0x9b, 0xdf, 0xaf, 0xce, 0xf7, 0xee, 0x94, 0xe2, 0x5f, 0x9e, 0x3c, - 0x85, 0xc7, 0xbb, 0x24, 0xf9, 0x32, 0x99, 0x7c, 0xe5, 0x3a, 0x6b, 0xe5, - 0x7f, 0x99, 0xbc, 0xe5, 0x78, 0x42, 0x8e, 0xdb, 0xff, 0x5d, 0xc2, 0xfc, - 0x6e, 0xd7, 0x11, 0xcd, 0x69, 0x3b, 0x3b, 0x35, 0x6a, 0xd2, 0xf9, 0x1d, - 0xe4, 0xd0, 0x7a, 0xb0, 0xc9, 0xcd, 0xa8, 0xbc, 0x9f, 0xe6, 0x23, 0xf5, - 0x33, 0x88, 0x83, 0xc6, 0x9e, 0xdf, 0xba, 0x83, 0x07, 0xb0, 0xe9, 0xf3, - 0x90, 0xbd, 0x58, 0x22, 0x49, 0x8a, 0x49, 0x73, 0xdd, 0x99, 0xb6, 0x9f, - 0x6f, 0x80, 0x7d, 0xd1, 0xd1, 0x18, 0x8f, 0x47, 0x3b, 0x83, 0xbc, 0x9e, - 0x2e, 0x67, 0x91, 0x7a, 0x3a, 0xc0, 0xbf, 0xad, 0x7d, 0x0c, 0xfa, 0x27, - 0xcf, 0x0a, 0xe2, 0x3f, 0x47, 0xc4, 0xdf, 0x87, 0xdc, 0x9d, 0x80, 0xdf, - 0xd1, 0xdc, 0x02, 0xe0, 0xaf, 0x55, 0x0f, 0x12, 0x1a, 0x2f, 0xec, 0x21, - 0xf1, 0x5e, 0x9b, 0xe6, 0xaf, 0xf9, 0x56, 0x36, 0x86, 0xc9, 0x17, 0xcb, - 0xf7, 0x55, 0x3e, 0xd6, 0x79, 0xbe, 0xe2, 0xcb, 0xdc, 0xa5, 0x88, 0x88, - 0xf7, 0x00, 0x87, 0xe1, 0x8d, 0x06, 0x16, 0x22, 0x73, 0x49, 0xeb, 0xd1, - 0xab, 0xf0, 0xf1, 0xf5, 0xb9, 0x1f, 0x85, 0xad, 0x4f, 0x8e, 0x57, 0x43, - 0x3d, 0xcb, 0x32, 0xa8, 0x67, 0x01, 0xfa, 0x13, 0xa4, 0x9e, 0x85, 0xd3, - 0x63, 0x45, 0xd1, 0x4f, 0xf7, 0xef, 0x12, 0xaf, 0x3e, 0x0e, 0xa1, 0xc7, - 0x0d, 0x7f, 0x3c, 0x44, 0xe0, 0x1d, 0x8d, 0xd0, 0x6b, 0x55, 0xd3, 0x8b, - 0x6f, 0x52, 0x32, 0xff, 0xe9, 0xf3, 0x7b, 0xa3, 0x86, 0x5b, 0x32, 0xec, - 0x48, 0x7b, 0xf5, 0x82, 0x19, 0xed, 0xbf, 0xc0, 0xe7, 0xe7, 0xe3, 0xf1, - 0xf7, 0xef, 0x5f, 0x8c, 0x4f, 0xad, 0x7e, 0xac, 0xd6, 0xf9, 0x32, 0xf1, - 0xf9, 0x5a, 0x69, 0x06, 0xcf, 0x57, 0x54, 0xfc, 0x22, 0xfc, 0x3c, 0x79, - 0xfb, 0x61, 0xb5, 0x13, 0x79, 0x86, 0x09, 0x9d, 0xb4, 0xdd, 0xd0, 0xd5, - 0xb8, 0x04, 0x95, 0x67, 0xa0, 0xfd, 0x76, 0x26, 0x63, 0xe8, 0x8d, 0xc3, - 0x5f, 0xd6, 0x86, 0x07, 0x34, 0x7b, 0x44, 0x1b, 0x6b, 0x7d, 0xd2, 0x2e, - 0x6f, 0xfb, 0xdb, 0xf9, 0x6e, 0x17, 0xbe, 0x0d, 0xed, 0x9b, 0x99, 0x70, - 0xd3, 0x10, 0x67, 0x84, 0x75, 0x58, 0x1d, 0x39, 0x12, 0x87, 0x18, 0x6e, - 0x07, 0xfa, 0xdc, 0xef, 0x53, 0x4d, 0xe2, 0x9a, 0xdf, 0xb2, 0xcb, 0x06, - 0xdc, 0xc7, 0x2d, 0xae, 0x5f, 0xae, 0x11, 0x9e, 0x67, 0xaf, 0x59, 0x7f, - 0xec, 0xd5, 0x3f, 0xbd, 0x4b, 0xce, 0xbb, 0xff, 0x18, 0xe6, 0x72, 0x2a, - 0x6f, 0x2c, 0x5e, 0x9e, 0xb8, 0xdb, 0xab, 0x97, 0x30, 0xca, 0x24, 0xbe, - 0x57, 0x40, 0x25, 0x1a, 0xdf, 0xd3, 0x4b, 0x33, 0x52, 0x43, 0x06, 0x95, - 0xf0, 0xed, 0x08, 0xad, 0xe7, 0xe7, 0x23, 0x47, 0xe4, 0x4b, 0x13, 0xc7, - 0xc3, 0x6e, 0x38, 0x69, 0xb1, 0x3e, 0x01, 0x5b, 0xf7, 0x24, 0xd4, 0x4b, - 0x61, 0x66, 0x8f, 0x31, 0xcd, 0x59, 0x5e, 0x98, 0xe0, 0xfb, 0x91, 0x46, - 0x53, 0xd1, 0xe7, 0x72, 0x3c, 0x27, 0x79, 0x40, 0xaa, 0xff, 0xe4, 0xf5, - 0xb8, 0x1a, 0x2a, 0xb5, 0xc3, 0xa2, 0x4b, 0x43, 0x69, 0x27, 0x07, 0xf2, - 0xd9, 0x91, 0x0a, 0xc6, 0xd3, 0xf1, 0x25, 0xc9, 0x75, 0xda, 0x94, 0xe7, - 0x73, 0xd3, 0x07, 0x84, 0xf8, 0x0f, 0x9a, 0x79, 0x20, 0x5e, 0x7e, 0xcf, - 0x3c, 0x30, 0xc5, 0xfa, 0x4e, 0x29, 0x7f, 0x68, 0x85, 0xec, 0x5f, 0x1a, - 0x7c, 0xe5, 0xe7, 0x44, 0x7f, 0xfe, 0x45, 0x93, 0xe3, 0xdb, 0xa8, 0x53, - 0x7b, 0xcd, 0xed, 0xc9, 0x2e, 0xc9, 0xbe, 0x78, 0xf5, 0xe5, 0x42, 0x7e, - 0x6f, 0x56, 0xfc, 0x7a, 0xbc, 0xf9, 0x7d, 0x83, 0xb7, 0x82, 0x9f, 0x37, - 0x01, 0xf6, 0xdf, 0x67, 0xc6, 0x60, 0x3f, 0x7f, 0x9c, 0x63, 0xfc, 0x17, - 0xda, 0xab, 0xf4, 0x1b, 0x69, 0xa3, 0xfa, 0x8d, 0xe5, 0xe3, 0xe0, 0x73, - 0x74, 0xba, 0xe5, 0xa7, 0x55, 0xde, 0x1f, 0x2e, 0x3f, 0x0e, 0x2a, 0x5d, - 0xd4, 0xb6, 0x4d, 0x67, 0xf3, 0x63, 0x7c, 0x17, 0x8b, 0xf2, 0x23, 0xbf, - 0x0f, 0xad, 0x4e, 0xf9, 0xf9, 0xe4, 0xa9, 0x92, 0x1f, 0xa9, 0x3e, 0xc6, - 0x92, 0xf7, 0x07, 0x0f, 0xb7, 0xa0, 0x44, 0xc8, 0x8d, 0x94, 0x1f, 0x83, - 0xfa, 0x6f, 0x03, 0x9a, 0x14, 0xaf, 0x95, 0xe4, 0x49, 0x90, 0x1f, 0x74, - 0x6e, 0x4d, 0xf9, 0x59, 0x21, 0xc5, 0x9b, 0x59, 0xbe, 0xbc, 0x3a, 0xbf, - 0x63, 0x88, 0xfe, 0x35, 0xde, 0x67, 0x12, 0x6f, 0x2e, 0xa1, 0xf8, 0x7a, - 0xd1, 0xb9, 0xf1, 0xfe, 0x8f, 0xfb, 0x6e, 0x94, 0xbf, 0xad, 0x11, 0x7f, - 0x7b, 0xf2, 0x01, 0x13, 0xda, 0xd3, 0x4f, 0xb4, 0x83, 0x36, 0x71, 0x9f, - 0x7f, 0xac, 0x84, 0x2a, 0x44, 0x1f, 0x7a, 0xf5, 0x6d, 0x1a, 0xa9, 0x17, - 0xed, 0xcc, 0x6e, 0x75, 0x9a, 0xf6, 0x2e, 0xcf, 0xa5, 0x26, 0x0d, 0xf0, - 0xb7, 0xe9, 0x79, 0x00, 0xed, 0xbe, 0x04, 0x39, 0x89, 0x60, 0xbe, 0x65, - 0x40, 0xa8, 0x5f, 0xde, 0x31, 0x2f, 0x10, 0xaf, 0x81, 0x7a, 0xe4, 0xc9, - 0x85, 0x90, 0x46, 0xf1, 0xfb, 0x5b, 0x75, 0xf6, 0x37, 0xa1, 0xbf, 0x8d, - 0x0f, 0xc1, 0x83, 0x1a, 0x1a, 0x0a, 0xef, 0x6f, 0x62, 0xd9, 0x18, 0xbd, - 0x8f, 0xf9, 0xb3, 0x56, 0x96, 0xe9, 0x47, 0xba, 0x9f, 0x61, 0xfd, 0x93, - 0xc1, 0xfe, 0x51, 0xfe, 0x7a, 0x44, 0x7c, 0xba, 0xaa, 0x7e, 0x3e, 0x07, - 0xf2, 0x01, 0xc6, 0xfb, 0x03, 0xad, 0x3c, 0xe4, 0xcb, 0xc7, 0xf9, 0x91, - 0xf2, 0x91, 0x35, 0xf2, 0xc9, 0xe0, 0xfd, 0xa9, 0x27, 0xb6, 0xbe, 0x3d, - 0x24, 0xbf, 0xc5, 0x35, 0x4e, 0x36, 0x34, 0x5f, 0x4d, 0xfe, 0xd9, 0x9e, - 0x82, 0xf3, 0xec, 0xfa, 0xf5, 0x21, 0x1e, 0xfd, 0xf4, 0x28, 0x7b, 0xaf, - 0x34, 0x2a, 0x84, 0xd7, 0xcb, 0xc2, 0xe5, 0xd3, 0xcb, 0x2f, 0x69, 0x6a, - 0xf4, 0xdd, 0xca, 0xe9, 0x4b, 0x44, 0xd5, 0x2f, 0x36, 0x11, 0x7f, 0x8f, - 0xcb, 0xef, 0x0e, 0x2d, 0x98, 0x7f, 0x91, 0xe3, 0xfb, 0xe1, 0xf1, 0xf9, - 0x67, 0x03, 0xf4, 0x85, 0xd3, 0xb3, 0x31, 0x11, 0x1d, 0x9f, 0xeb, 0x21, - 0x1a, 0x0e, 0x8f, 0xd7, 0x6b, 0xe7, 0x17, 0x54, 0xf1, 0x47, 0xde, 0x17, - 0x51, 0xdd, 0xf1, 0xe4, 0x58, 0x7d, 0x2f, 0xeb, 0xef, 0x88, 0xf8, 0x5f, - 0xc9, 0x08, 0xd4, 0x47, 0x8b, 0xf7, 0xd3, 0x8e, 0x69, 0xc2, 0xdf, 0xc9, - 0xeb, 0x79, 0xe9, 0xf3, 0x41, 0x39, 0x8e, 0xbf, 0x65, 0x9a, 0xf0, 0xd3, - 0x7a, 0x67, 0x90, 0x67, 0xa2, 0xaf, 0x5a, 0xbc, 0xfa, 0x8b, 0x69, 0xc2, - 0x4f, 0xeb, 0x9d, 0x3d, 0x7b, 0xec, 0xd5, 0x77, 0xac, 0x9b, 0x26, 0xfc, - 0xb4, 0xde, 0x99, 0xdb, 0xff, 0x92, 0x97, 0x7f, 0x5c, 0xc7, 0xed, 0x8b, - 0x19, 0x73, 0x9e, 0xdc, 0xd5, 0x0b, 0xac, 0xc9, 0xde, 0x3e, 0xb8, 0xed, - 0xde, 0xcf, 0xdf, 0x17, 0x62, 0x72, 0x7f, 0xb4, 0x1e, 0x7b, 0x6c, 0xbd, - 0x18, 0x88, 0x4f, 0x24, 0x7c, 0x79, 0x27, 0xe4, 0x64, 0x02, 0xf2, 0x40, - 0x4e, 0xdf, 0x77, 0x02, 0xf5, 0x45, 0x03, 0xfc, 0x7d, 0x3f, 0x75, 0xbd, - 0x9f, 0xa4, 0xb6, 0x7c, 0x7b, 0xf6, 0xcf, 0xac, 0x61, 0xff, 0x98, 0x7d, - 0xc4, 0x5e, 0x38, 0xb1, 0x7f, 0x28, 0x3e, 0xdf, 0xea, 0x52, 0xfd, 0x91, - 0x23, 0xf6, 0x0e, 0xdf, 0x6c, 0x4b, 0xc7, 0x57, 0xe1, 0xfb, 0x47, 0xc1, - 0xf3, 0xcf, 0x2d, 0x7a, 0x9f, 0x73, 0x4c, 0xb0, 0xe7, 0x43, 0x5f, 0xef, - 0x5c, 0xfd, 0xa0, 0xee, 0xee, 0xd4, 0xc6, 0x50, 0x1a, 0xeb, 0x6b, 0xa7, - 0xeb, 0x91, 0x83, 0x17, 0x4e, 0x6a, 0x58, 0xf5, 0x14, 0x2e, 0x5e, 0x3b, - 0xa8, 0xc3, 0x7d, 0xe0, 0x87, 0x9d, 0xeb, 0xd0, 0x4f, 0xe9, 0x7d, 0x20, - 0x74, 0x7d, 0x4f, 0xa7, 0x7c, 0x7e, 0xe6, 0x83, 0xf1, 0x21, 0xb2, 0x17, - 0x1b, 0x32, 0xfe, 0xfb, 0xb6, 0xbc, 0x7c, 0x7b, 0xc4, 0xfb, 0xb6, 0x78, - 0x7e, 0x5f, 0x7c, 0xde, 0xeb, 0x80, 0x8f, 0xbf, 0xd4, 0x59, 0x47, 0xfc, - 0x89, 0xf7, 0xa7, 0xf9, 0x90, 0x94, 0x0e, 0xf9, 0x76, 0x6a, 0x5f, 0xbd, - 0xfc, 0x76, 0x0d, 0x7f, 0xc3, 0x8b, 0xb7, 0x30, 0x7f, 0xa3, 0x10, 0xef, - 0x6f, 0xb0, 0x78, 0x1e, 0x9d, 0x7d, 0x5b, 0x82, 0xdb, 0x17, 0x87, 0xf2, - 0x3f, 0x09, 0xfc, 0x77, 0x46, 0x02, 0xf5, 0xf5, 0xd6, 0x26, 0xf2, 0x3c, - 0x9d, 0xab, 0x83, 0xbd, 0x1c, 0x4a, 0x1d, 0xea, 0x3e, 0xae, 0x3b, 0x3b, - 0x31, 0x6c, 0x62, 0xfe, 0xdb, 0x5d, 0xbf, 0x19, 0x37, 0x78, 0x7e, 0x7b, - 0x17, 0xd4, 0x03, 0x58, 0xe0, 0x3f, 0xd8, 0x43, 0xd1, 0xf1, 0xbf, 0x48, - 0xfe, 0x13, 0x75, 0xb9, 0xa1, 0xd1, 0xe7, 0x7f, 0xe3, 0xff, 0x6b, 0xfe, - 0xcb, 0xf5, 0x05, 0xa6, 0xa7, 0xac, 0xd6, 0x18, 0xa2, 0x7f, 0xc2, 0xed, - 0xb5, 0x58, 0x7f, 0x50, 0x6d, 0xef, 0xd9, 0xf3, 0x93, 0xb9, 0x49, 0xe2, - 0x2f, 0x79, 0xfa, 0x2d, 0x17, 0xaf, 0xdf, 0xf8, 0x7c, 0xa6, 0x57, 0x5c, - 0xb2, 0x26, 0xee, 0xf9, 0x1b, 0x9b, 0xdc, 0x2f, 0x82, 0xfa, 0x96, 0xeb, - 0x1f, 0x8f, 0xd7, 0xf4, 0x7d, 0x64, 0x36, 0x56, 0x50, 0x4e, 0xdb, 0x50, - 0x02, 0xf4, 0xbd, 0x9b, 0x12, 0xea, 0x11, 0x67, 0x12, 0xfd, 0xa7, 0x8b, - 0xfd, 0x3d, 0x73, 0xc9, 0x61, 0xfe, 0xa6, 0xdf, 0xa8, 0x7c, 0x2c, 0xbf, - 0x2f, 0xf0, 0xf9, 0x6d, 0x71, 0x3c, 0x21, 0x0d, 0xf6, 0xb6, 0xc8, 0xed, - 0xc1, 0xa7, 0xf9, 0xfc, 0x59, 0x7e, 0x9f, 0x23, 0xf7, 0xe9, 0xc0, 0xf3, - 0xb0, 0x41, 0xfb, 0x4a, 0xc9, 0xdb, 0xaa, 0x81, 0x3c, 0xf6, 0x25, 0x84, - 0xfa, 0xb3, 0x46, 0x61, 0x7c, 0x2e, 0x1f, 0xf1, 0xbc, 0x17, 0xfd, 0xbc, - 0x19, 0xe1, 0x5f, 0x78, 0xf6, 0x50, 0xd0, 0xdf, 0x3e, 0xfd, 0xd4, 0x34, - 0xc0, 0x2b, 0x6b, 0xd9, 0xf3, 0xaa, 0xbe, 0x3d, 0x4b, 0x09, 0xf3, 0x73, - 0x7b, 0x27, 0xad, 0xc7, 0x8b, 0x0f, 0x1f, 0xe5, 0xf4, 0xdd, 0x81, 0xa4, - 0x78, 0x02, 0xed, 0xdf, 0x21, 0x8d, 0xaf, 0x71, 0xff, 0xbc, 0x48, 0xba, - 0x0f, 0x7e, 0xaa, 0xc6, 0x7d, 0x70, 0xd1, 0x54, 0xef, 0x83, 0xec, 0x0f, - 0xb7, 0x3f, 0xa0, 0x09, 0xf5, 0x2b, 0x35, 0xe4, 0x93, 0x3c, 0x7f, 0xd3, - 0x17, 0x88, 0xd7, 0xcd, 0x88, 0xef, 0x5f, 0x40, 0x3b, 0x2c, 0x91, 0xbe, - 0xd2, 0x42, 0x16, 0xef, 0x0c, 0x3f, 0x2f, 0x26, 0x3f, 0x9f, 0x7c, 0x81, - 0x0f, 0x64, 0x05, 0xfa, 0x52, 0xac, 0x1d, 0x9a, 0xd7, 0x82, 0xfc, 0x75, - 0x88, 0xfe, 0x29, 0xc7, 0x87, 0xf7, 0xbb, 0x14, 0xb4, 0xff, 0xd0, 0x3f, - 0x1f, 0xc2, 0x1f, 0x79, 0x7e, 0x8e, 0xdf, 0xb3, 0x8f, 0x1d, 0x73, 0x61, - 0x71, 0x55, 0xfd, 0xa9, 0x3e, 0x1b, 0x26, 0xf1, 0x00, 0xb8, 0xdf, 0x45, - 0xf1, 0x5f, 0xc2, 0x8f, 0xa5, 0x60, 0x8d, 0x11, 0xb7, 0x5f, 0xd5, 0xf9, - 0xec, 0xf0, 0xfe, 0x51, 0xfa, 0x56, 0x5e, 0x0f, 0x1f, 0x2f, 0xfb, 0x43, - 0x04, 0x5f, 0xc0, 0xbf, 0xf7, 0xf3, 0xe1, 0xe1, 0xfb, 0x89, 0x29, 0x2f, - 0x05, 0xe5, 0x17, 0xc6, 0xaf, 0xac, 0x4d, 0x3f, 0xd2, 0x65, 0xfa, 0xe3, - 0xfd, 0x41, 0xc7, 0xd7, 0xcf, 0x11, 0xf9, 0xe3, 0xa8, 0xfe, 0x36, 0x72, - 0x9d, 0xd6, 0xd0, 0xfb, 0x5f, 0xa8, 0x7d, 0xf3, 0xfc, 0x71, 0x7c, 0x7f, - 0xee, 0xe3, 0xfa, 0x21, 0x17, 0xf4, 0xff, 0x5b, 0x78, 0x7c, 0xfb, 0xd7, - 0x73, 0x22, 0xea, 0x73, 0xa8, 0xff, 0x1a, 0x7f, 0x5e, 0xca, 0x2f, 0xdf, - 0x29, 0xae, 0xdf, 0xad, 0x4f, 0xfe, 0x3d, 0xfd, 0xc5, 0xe2, 0x35, 0x7c, - 0xbd, 0xc9, 0x1a, 0xfc, 0x11, 0xe7, 0x7f, 0x82, 0xc4, 0xf3, 0x91, 0x89, - 0xc6, 0xea, 0xe4, 0x27, 0x76, 0x79, 0xd7, 0x18, 0xbe, 0x7e, 0x84, 0x57, - 0x22, 0xd3, 0x78, 0x97, 0xdc, 0x5e, 0xc7, 0x7d, 0xf8, 0x77, 0x64, 0xdf, - 0xbb, 0xa7, 0xc5, 0xbe, 0xfb, 0xf6, 0xba, 0xfb, 0xb4, 0xbd, 0x9e, 0x46, - 0x7b, 0xfd, 0xb9, 0x88, 0x7c, 0xba, 0xa7, 0x9f, 0x22, 0xf8, 0xe7, 0x52, - 0x63, 0x13, 0x78, 0x7f, 0xc3, 0xfd, 0x4a, 0xf6, 0x1a, 0x50, 0x67, 0x1a, - 0x82, 0xf6, 0x7a, 0xfd, 0x74, 0xd8, 0x6b, 0x77, 0xb1, 0xa2, 0xbd, 0x5e, - 0x32, 0x45, 0x7b, 0xed, 0xe5, 0xeb, 0x76, 0x08, 0xef, 0x17, 0x71, 0xb9, - 0x7c, 0x52, 0x36, 0x8d, 0x34, 0xf2, 0xf3, 0x1a, 0x69, 0xbf, 0xf7, 0x51, - 0xfb, 0xed, 0xcd, 0xef, 0xcc, 0xab, 0xa1, 0x8f, 0xba, 0x55, 0xec, 0x15, - 0xb6, 0x9f, 0xdd, 0xa2, 0xfd, 0xdc, 0x11, 0xfe, 0xbc, 0x73, 0xd0, 0x7e, - 0xf6, 0x29, 0xd9, 0xcf, 0x6e, 0x45, 0xfb, 0xa9, 0x46, 0x3f, 0xef, 0x5f, - 0xbf, 0xbd, 0xec, 0x9e, 0x66, 0x7b, 0xd9, 0xad, 0x68, 0x2f, 0xbb, 0x15, - 0xed, 0x65, 0xf7, 0x09, 0xdb, 0x4b, 0xfb, 0x84, 0xec, 0x65, 0x77, 0xbc, - 0xbd, 0x7c, 0x5a, 0xb2, 0x97, 0xa8, 0x3e, 0xf9, 0x94, 0x9f, 0x77, 0xf1, - 0xed, 0x65, 0xf4, 0x7c, 0x36, 0xd9, 0x4f, 0x9e, 0xcf, 0x3d, 0x45, 0xf6, - 0x8a, 0xbd, 0x7f, 0x42, 0x7e, 0xbf, 0x44, 0xd4, 0x7e, 0x21, 0x2f, 0xbe, - 0x7b, 0x62, 0xef, 0x03, 0xa0, 0xf5, 0x20, 0x1b, 0x30, 0x86, 0xa5, 0xf0, - 0xfe, 0xa5, 0x40, 0xfe, 0x23, 0xbc, 0xde, 0xc8, 0x03, 0xfc, 0xf8, 0xae, - 0x06, 0xf9, 0xdf, 0x46, 0xcb, 0xc5, 0xeb, 0xf5, 0x9f, 0x77, 0xe2, 0xf4, - 0xa2, 0xce, 0xac, 0xee, 0xb4, 0xed, 0xc5, 0x6c, 0x9d, 0x0c, 0xad, 0x37, - 0xc2, 0x8a, 0x55, 0x13, 0xf4, 0x75, 0x9d, 0xf1, 0xb2, 0x28, 0x7e, 0xd8, - 0x49, 0x2c, 0xbf, 0x67, 0x6c, 0x48, 0x8f, 0x9e, 0xbf, 0x04, 0x95, 0xb3, - 0xa8, 0x60, 0xe3, 0xbd, 0xdf, 0xdb, 0x92, 0x48, 0x40, 0x7c, 0x81, 0xbc, - 0x5f, 0x0a, 0x91, 0x97, 0x64, 0xbb, 0x1a, 0xad, 0x58, 0xb0, 0x51, 0x07, - 0x72, 0x3a, 0xb1, 0xbc, 0x8f, 0x26, 0xfc, 0x78, 0x08, 0x4b, 0xad, 0xa3, - 0xbe, 0xc1, 0xb2, 0x56, 0x25, 0xff, 0xdd, 0x08, 0x35, 0xc3, 0xf3, 0x61, - 0xfb, 0x06, 0x11, 0xd4, 0x33, 0x80, 0xbc, 0x2c, 0xae, 0x43, 0xdf, 0xf0, - 0x7a, 0x52, 0xbf, 0x3e, 0x6c, 0x93, 0x54, 0x1f, 0x36, 0x21, 0xd5, 0x1b, - 0x6c, 0x8a, 0xaf, 0x0f, 0x73, 0x17, 0xc5, 0xda, 0xd3, 0xea, 0xfc, 0x3e, - 0x7b, 0xbf, 0x09, 0xdd, 0xbc, 0x04, 0xe4, 0xbf, 0xe0, 0xe5, 0x5e, 0x39, - 0xf3, 0x88, 0xe6, 0x58, 0xad, 0x69, 0xf2, 0xfc, 0x1c, 0xd9, 0xef, 0x0d, - 0x86, 0xa7, 0x72, 0x20, 0x7f, 0x95, 0xde, 0x89, 0xe5, 0x71, 0xf8, 0xf2, - 0x51, 0x73, 0xc0, 0x70, 0x86, 0x79, 0x3d, 0x90, 0x9e, 0x41, 0xe5, 0x73, - 0xc9, 0x78, 0xe0, 0x97, 0xf5, 0x09, 0xe4, 0xd5, 0x97, 0x56, 0xd3, 0x23, - 0xe6, 0xc3, 0x80, 0x3d, 0x23, 0xa0, 0x5f, 0x6c, 0xff, 0x79, 0x36, 0x02, - 0x47, 0xbc, 0x8f, 0x22, 0xcc, 0x3e, 0xac, 0x30, 0xfd, 0xfc, 0xc5, 0x74, - 0xbf, 0x0f, 0xa3, 0x8a, 0x3f, 0x5b, 0x49, 0x7c, 0x6e, 0xfe, 0xa8, 0x79, - 0x8c, 0xc4, 0x47, 0xfd, 0xe7, 0xad, 0x28, 0x7f, 0x4a, 0x26, 0x9c, 0xd7, - 0xe1, 0x65, 0xb9, 0xc4, 0x80, 0x46, 0xf8, 0x43, 0x14, 0x96, 0xde, 0xc8, - 0xf9, 0x03, 0xf6, 0x39, 0x99, 0x8d, 0xe3, 0x4f, 0x5a, 0xe4, 0x0f, 0xe1, - 0xef, 0xda, 0x0c, 0xd8, 0xbf, 0x12, 0xf8, 0xe7, 0x01, 0xd8, 0xad, 0xd3, - 0x5f, 0x5f, 0x6e, 0xc6, 0xd5, 0x8f, 0x9d, 0x18, 0x7f, 0xaa, 0xf5, 0x83, - 0x58, 0x1f, 0x10, 0xd0, 0x5f, 0x82, 0x3f, 0xed, 0xc5, 0x1f, 0x3b, 0xb1, - 0x3f, 0xdd, 0x66, 0xeb, 0xe7, 0x66, 0x1e, 0xd4, 0x4a, 0xdf, 0x08, 0xd4, - 0x9b, 0x60, 0x77, 0xcb, 0xf5, 0x9e, 0xcf, 0x7e, 0x2a, 0xe1, 0xef, 0x6f, - 0x48, 0xbc, 0xd0, 0x44, 0xbd, 0x63, 0xff, 0xc9, 0xed, 0x5f, 0xfc, 0x79, - 0x0a, 0xac, 0xaf, 0xbe, 0xf3, 0x74, 0x4a, 0xd6, 0x87, 0x9c, 0xe7, 0xf5, - 0x60, 0xbd, 0xd8, 0x9f, 0x27, 0x6b, 0xac, 0xb7, 0xef, 0xc0, 0xc9, 0x5e, - 0x2f, 0xab, 0xf7, 0x1b, 0x25, 0xeb, 0x6b, 0x35, 0xe5, 0xf7, 0xaf, 0x79, - 0xeb, 0x73, 0xf0, 0xfa, 0xcc, 0x9e, 0x26, 0x34, 0xf1, 0xa0, 0x86, 0x82, - 0xf9, 0x02, 0xdb, 0x8f, 0x7f, 0xa1, 0xd2, 0x70, 0x52, 0xac, 0x9f, 0xfb, - 0x4e, 0x43, 0xec, 0xfa, 0xe6, 0x77, 0x19, 0x68, 0xc2, 0xbb, 0x4f, 0x28, - 0xd6, 0x3b, 0xd6, 0xa8, 0xc7, 0x22, 0xe7, 0xb7, 0xb5, 0x81, 0xeb, 0xbf, - 0x40, 0xfd, 0x1e, 0x39, 0x6f, 0x05, 0xb2, 0x5e, 0x3b, 0xc1, 0xea, 0x61, - 0xfd, 0xf5, 0x54, 0xe2, 0xf3, 0xdb, 0x81, 0x78, 0xba, 0xd3, 0x79, 0x32, - 0xcf, 0x1b, 0x1a, 0x4a, 0x89, 0xf5, 0x8a, 0x23, 0x29, 0x95, 0xfa, 0xc5, - 0xa4, 0x5d, 0x78, 0xd5, 0xbe, 0xa3, 0x1d, 0xad, 0xe9, 0xb0, 0x26, 0xa9, - 0x1d, 0x5a, 0x91, 0x8a, 0x8f, 0xef, 0xc7, 0xd7, 0x8f, 0x46, 0xd7, 0x4b, - 0x1c, 0x93, 0xdf, 0x4f, 0x49, 0xe5, 0x4f, 0xcf, 0x6e, 0x25, 0xef, 0xa3, - 0xf1, 0xf6, 0xab, 0x81, 0xcf, 0x6f, 0xd2, 0xfa, 0x08, 0x38, 0x2f, 0xad, - 0x2d, 0xa3, 0xc6, 0xa6, 0xd8, 0xfa, 0xe5, 0x73, 0x22, 0x7e, 0x6f, 0x10, - 0xee, 0xcf, 0x99, 0x36, 0xbc, 0x7f, 0x9e, 0xbf, 0x79, 0x6b, 0x32, 0xde, - 0x5f, 0x3d, 0x49, 0xe7, 0x27, 0xe2, 0x79, 0xc5, 0xea, 0x78, 0x83, 0x58, - 0x0f, 0x53, 0xf5, 0xfc, 0xa2, 0xb6, 0x8b, 0xdd, 0x2f, 0x18, 0x7d, 0x3a, - 0xf8, 0x33, 0x61, 0xf6, 0x14, 0x12, 0xd1, 0xf4, 0xfd, 0x05, 0x4e, 0xba, - 0x76, 0x7e, 0x46, 0xbe, 0x9f, 0x2e, 0x3d, 0x10, 0xff, 0xbe, 0xb7, 0x6b, - 0x23, 0xfc, 0x17, 0xef, 0xbe, 0x29, 0xdc, 0xc7, 0x47, 0xd2, 0x60, 0x9f, - 0xca, 0x09, 0x96, 0x4f, 0x72, 0x36, 0x04, 0xde, 0x2f, 0xd4, 0x28, 0xde, - 0xa7, 0xa7, 0x58, 0x7f, 0xb5, 0x4c, 0xf1, 0x3e, 0xbd, 0xfc, 0xc0, 0x89, - 0xbe, 0x2f, 0x91, 0xf1, 0x9f, 0x2a, 0x68, 0x67, 0xce, 0x61, 0x43, 0x98, - 0xdf, 0x44, 0x49, 0xc2, 0x8f, 0xd6, 0x9e, 0x02, 0x79, 0xee, 0xaa, 0xbb, - 0x9d, 0x74, 0x70, 0x0f, 0x93, 0xb4, 0x3e, 0x1e, 0xf9, 0xc7, 0xf4, 0xbc, - 0xd5, 0xba, 0xff, 0xf9, 0xf9, 0x56, 0xf1, 0xfd, 0xa0, 0x1c, 0x3f, 0x5d, - 0xcf, 0x30, 0x89, 0xd7, 0x95, 0xc2, 0xef, 0xef, 0xa5, 0x9d, 0xc9, 0x90, - 0xfb, 0x18, 0xc3, 0x47, 0x7d, 0xd9, 0x41, 0x5a, 0xcf, 0x92, 0xa8, 0xdb, - 0x9f, 0xf6, 0xe6, 0xa7, 0xcb, 0x1f, 0xf7, 0xec, 0x13, 0x8b, 0xbf, 0xf4, - 0x07, 0xea, 0xeb, 0xb8, 0x3c, 0x36, 0xaa, 0xec, 0xef, 0xb9, 0x81, 0x7c, - 0x24, 0x89, 0x27, 0xf5, 0xe6, 0x3d, 0xff, 0x8b, 0xf0, 0xa3, 0x10, 0x71, - 0x9f, 0xc4, 0x70, 0x7e, 0xa6, 0x7f, 0xdf, 0x46, 0xe8, 0x7a, 0x5e, 0x0f, - 0x7d, 0x6c, 0xce, 0xd4, 0xe5, 0xcb, 0xbd, 0xec, 0x94, 0xc9, 0x57, 0x38, - 0x7d, 0x7d, 0x51, 0xbf, 0xa7, 0x2a, 0xcb, 0x63, 0x54, 0x3e, 0x2b, 0x32, - 0xbe, 0xf6, 0xa0, 0x58, 0x4f, 0xc4, 0xeb, 0x45, 0xe5, 0xf8, 0x9a, 0xe2, - 0x7d, 0xcb, 0x93, 0x4f, 0x10, 0x90, 0x36, 0xdb, 0x80, 0xfb, 0x55, 0x5f, - 0x92, 0xe2, 0xeb, 0x11, 0xf6, 0xc7, 0x7b, 0x9f, 0x2a, 0xad, 0x87, 0x20, - 0xe8, 0xfc, 0xf7, 0x57, 0x78, 0xf2, 0xba, 0x3c, 0xe0, 0x3f, 0xa0, 0xc1, - 0x24, 0x97, 0x77, 0xdc, 0xdd, 0xfd, 0x76, 0x3a, 0xac, 0x1e, 0x62, 0x7a, - 0xee, 0xe3, 0xf4, 0xfe, 0x3b, 0x5b, 0xf7, 0xee, 0xe3, 0xd5, 0xf7, 0x97, - 0x1a, 0xcf, 0x0b, 0x48, 0xf8, 0x20, 0x3a, 0x0e, 0x7b, 0x5f, 0x5e, 0x38, - 0x6d, 0xf8, 0x1e, 0x8b, 0x79, 0x3e, 0xa6, 0x16, 0x0c, 0xfc, 0x13, 0xed, - 0x83, 0xdc, 0xbf, 0x4b, 0xad, 0x5e, 0x5c, 0x19, 0xff, 0x35, 0x27, 0x84, - 0x1f, 0x1e, 0x36, 0x88, 0x97, 0xcf, 0xc5, 0xb1, 0xf8, 0x40, 0xb4, 0xf2, - 0x7a, 0xfd, 0xfc, 0x9a, 0xe2, 0xef, 0xb7, 0x79, 0xbf, 0x5f, 0x6c, 0x49, - 0x70, 0x4e, 0x82, 0x6d, 0x09, 0x76, 0x24, 0x98, 0xc5, 0xfb, 0x7d, 0xd8, - 0x94, 0x60, 0x4b, 0x82, 0x73, 0x12, 0x6c, 0x4b, 0xf0, 0xa9, 0xfd, 0x3d, - 0x2a, 0x57, 0x82, 0x6b, 0xfe, 0xde, 0xda, 0x34, 0xd3, 0x77, 0xfa, 0x73, - 0xfa, 0x73, 0xfa, 0x13, 0xf3, 0xf9, 0x3f, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xec, 0x5d, 0x7b, 0x90, 0x1c, 0x47, 0x79, 0xef, 0xee, 0x99, 0x9d, 0x9d, - 0xdd, 0xdb, 0x5b, 0x8d, 0xce, 0x27, 0xb1, 0x3e, 0x4b, 0xd6, 0x9c, 0x74, - 0x96, 0x8e, 0xc4, 0xa8, 0xce, 0x8a, 0x2c, 0xce, 0x46, 0x31, 0x73, 0xd2, - 0xc9, 0x48, 0x46, 0x22, 0xc2, 0x3c, 0x22, 0x53, 0x3c, 0xf6, 0x70, 0x51, - 0x25, 0x83, 0x23, 0x9b, 0xc4, 0x49, 0xce, 0xd8, 0x29, 0xf7, 0xde, 0xed, - 0x3d, 0x0c, 0x3a, 0xd7, 0x59, 0x18, 0x23, 0x8c, 0x31, 0x7b, 0x92, 0x6c, - 0xab, 0x30, 0x15, 0xa8, 0x72, 0x52, 0x65, 0xf2, 0x47, 0xb2, 0xd6, 0x83, - 0x08, 0xca, 0xaa, 0x3a, 0x70, 0xe2, 0x22, 0x29, 0x2a, 0x59, 0x3b, 0x29, - 0x22, 0x1e, 0x51, 0x94, 0x02, 0x93, 0x33, 0x18, 0x94, 0x7e, 0xcf, 0x74, - 0xef, 0xcc, 0xec, 0x9e, 0x1e, 0x14, 0x09, 0xdc, 0x1f, 0xb6, 0xc7, 0x33, - 0xdb, 0xd3, 0xd3, 0xfd, 0xf5, 0xf7, 0xfe, 0x7e, 0xdf, 0x00, 0xd3, 0xaf, - 0x38, 0xbe, 0x0c, 0xcd, 0xb7, 0x72, 0x51, 0xc1, 0x22, 0xf6, 0xc5, 0xfc, - 0x83, 0x70, 0x2f, 0xac, 0x8f, 0xc3, 0xc3, 0xef, 0x06, 0x2f, 0xe0, 0x03, - 0x76, 0x75, 0x23, 0xb4, 0xb8, 0xbf, 0x36, 0x0f, 0x1e, 0xa1, 0x67, 0x76, - 0x85, 0xd3, 0xeb, 0xc2, 0xaf, 0x0e, 0x66, 0x30, 0xe7, 0x57, 0x37, 0x3b, - 0xcc, 0x7b, 0x4a, 0xe4, 0x77, 0xd9, 0x03, 0xc1, 0x83, 0xf9, 0xf1, 0x6b, - 0x3b, 0x2c, 0xee, 0x9f, 0x2a, 0x3c, 0x3a, 0x67, 0x97, 0x11, 0x02, 0x4b, - 0x97, 0x02, 0xa7, 0x5c, 0x9a, 0x54, 0xfa, 0xaf, 0x27, 0xea, 0x4f, 0x87, - 0xa9, 0xbd, 0x5c, 0xdd, 0xa2, 0xfc, 0x03, 0x6b, 0x89, 0xfe, 0x1a, 0xa0, - 0x65, 0xdb, 0xd6, 0x40, 0x99, 0x7f, 0x76, 0x6b, 0x6a, 0x3f, 0xce, 0x3c, - 0x66, 0xea, 0x44, 0x6d, 0xcb, 0x7b, 0xfa, 0xe9, 0x2d, 0x9c, 0xc7, 0x39, - 0x7e, 0x2d, 0xfa, 0xc5, 0xc9, 0xfb, 0x6e, 0x9d, 0x31, 0xd2, 0xe9, 0x23, - 0xbe, 0xce, 0x6f, 0xfc, 0x7e, 0x2a, 0xaf, 0xfc, 0x8e, 0xd9, 0xe2, 0x46, - 0x1a, 0xb4, 0xa6, 0xfe, 0xbc, 0x98, 0xf7, 0xbd, 0x27, 0x23, 0xbf, 0x0f, - 0x80, 0xb7, 0x1b, 0xf2, 0x4b, 0xe1, 0x6d, 0x31, 0xfb, 0xd2, 0xf7, 0xc5, - 0xf3, 0x7b, 0x10, 0xae, 0x65, 0xfc, 0x8b, 0x95, 0x27, 0x97, 0xfd, 0xcf, - 0xd3, 0x2f, 0x47, 0xe4, 0x7f, 0xf4, 0x89, 0xfd, 0xf1, 0x59, 0x73, 0x6e, - 0x3f, 0x23, 0xe9, 0x83, 0xe6, 0x0a, 0x06, 0xae, 0x9f, 0xf1, 0x32, 0x7c, - 0xfd, 0xa3, 0xf4, 0xd2, 0x20, 0xf4, 0x32, 0x4c, 0xed, 0x4d, 0xff, 0x96, - 0x0d, 0x50, 0xe4, 0x23, 0x4a, 0xf9, 0x86, 0x44, 0xbd, 0x22, 0x95, 0xdd, - 0xee, 0x0d, 0xef, 0x70, 0x24, 0xbe, 0x91, 0x49, 0x2f, 0x76, 0x17, 0xc0, - 0xd3, 0xf6, 0x64, 0x61, 0xb6, 0x40, 0xae, 0x0b, 0xd4, 0xbf, 0xb9, 0xc3, - 0x58, 0x6f, 0xe5, 0x3f, 0x66, 0xf5, 0x84, 0x4c, 0x1c, 0xe2, 0x2d, 0x52, - 0xa2, 0xd7, 0x18, 0xaa, 0x2a, 0x58, 0xb6, 0xad, 0xb7, 0x4d, 0xfa, 0x89, - 0xd4, 0x03, 0x09, 0x7c, 0x15, 0xd6, 0xff, 0xd5, 0x0b, 0xdf, 0xc7, 0x54, - 0x2e, 0x3f, 0x12, 0xef, 0x08, 0xd2, 0xf2, 0x19, 0x7d, 0xc4, 0xe8, 0x29, - 0x17, 0x8e, 0x9f, 0x3e, 0xff, 0x4b, 0xac, 0x7f, 0x5c, 0xc4, 0xf9, 0x1f, - 0xf8, 0x95, 0x9e, 0xff, 0x3f, 0xb8, 0x44, 0xe7, 0xbf, 0x79, 0xbf, 0xd2, - 0xd7, 0xeb, 0xff, 0xda, 0xfe, 0xfc, 0x7f, 0xe5, 0xff, 0xfb, 0xdc, 0x88, - 0x3d, 0x1c, 0x39, 0xbf, 0x72, 0xff, 0x7b, 0x17, 0xc9, 0xff, 0x25, 0x7f, - 0x6f, 0xd2, 0x27, 0x25, 0xfe, 0xb5, 0xb2, 0x97, 0x7e, 0xb3, 0xf7, 0xbb, - 0xf9, 0xef, 0x05, 0xa3, 0x3e, 0xaf, 0xa0, 0xd9, 0xcb, 0xa6, 0x3d, 0x97, - 0xc7, 0x6f, 0x62, 0xff, 0xee, 0x11, 0xf5, 0xc5, 0xb2, 0x1e, 0x79, 0x2c, - 0xd0, 0xe5, 0xed, 0x31, 0xfd, 0x5a, 0xf2, 0x4f, 0xbc, 0x9a, 0xfb, 0xff, - 0xfc, 0x24, 0xfd, 0x3f, 0x8c, 0xb7, 0xc9, 0xfa, 0xfa, 0x38, 0x79, 0x6c, - 0xa9, 0xfb, 0x79, 0xdc, 0x1f, 0x37, 0x1e, 0x7e, 0xf7, 0x7c, 0xb8, 0xff, - 0x07, 0xb4, 0xfd, 0x57, 0xfe, 0xd2, 0x5f, 0xfc, 0x66, 0xee, 0xb7, 0xfe, - 0xd7, 0x6c, 0xaf, 0xbf, 0x2b, 0x66, 0xbd, 0x91, 0x79, 0xde, 0x2e, 0xd9, - 0x7e, 0xb6, 0x5c, 0xff, 0xe4, 0xfd, 0xfb, 0xe5, 0x6f, 0xf7, 0xef, 0x57, - 0x72, 0xfe, 0x85, 0xf7, 0x52, 0xee, 0x3f, 0x3f, 0xff, 0xc7, 0x86, 0xfb, - 0xb5, 0xf3, 0xdf, 0xa5, 0xf8, 0x41, 0xd6, 0xe0, 0x0f, 0x8b, 0xa6, 0x17, - 0x83, 0x1e, 0x9b, 0xce, 0x7f, 0x5d, 0xe7, 0x47, 0xbf, 0x3d, 0xff, 0x17, - 0x79, 0xfe, 0xb5, 0xfd, 0x8d, 0x39, 0xff, 0x06, 0xff, 0x5f, 0xdc, 0x7e, - 0xfe, 0xfa, 0x9d, 0x77, 0x03, 0xef, 0x45, 0xc5, 0xeb, 0x7e, 0x60, 0xf6, - 0x37, 0xb1, 0x45, 0xbc, 0x12, 0x71, 0x7c, 0xef, 0x51, 0x9b, 0xe7, 0x2b, - 0xe5, 0x8c, 0xf8, 0xc6, 0x8c, 0x86, 0xdf, 0xae, 0xbe, 0x55, 0xe0, 0x03, - 0x85, 0x0b, 0xa2, 0xc7, 0x0f, 0x9e, 0xd1, 0xf1, 0xf7, 0xee, 0xee, 0x78, - 0xa3, 0xc4, 0x0f, 0x9a, 0x01, 0xbc, 0xfe, 0x79, 0x9f, 0x45, 0xeb, 0x9f, - 0x01, 0xec, 0xb4, 0x82, 0x48, 0xff, 0x33, 0x99, 0xff, 0x66, 0xc9, 0x7c, - 0x2b, 0xfa, 0x42, 0x0a, 0xb9, 0xed, 0xab, 0xfc, 0xd5, 0x7a, 0xc1, 0x6d, - 0x23, 0xde, 0xf1, 0xce, 0xf0, 0xfd, 0x00, 0x1c, 0x19, 0x7b, 0x11, 0xae, - 0x05, 0x8d, 0x82, 0xc2, 0xc3, 0x0e, 0xe4, 0xf8, 0xbe, 0x8c, 0x1f, 0x4e, - 0x3f, 0x0f, 0x6b, 0xd1, 0xf8, 0xa1, 0x56, 0xdf, 0xfb, 0xa4, 0xc2, 0xcf, - 0xdd, 0x42, 0xfb, 0x57, 0x21, 0xdf, 0x01, 0xee, 0xa8, 0x45, 0xeb, 0xd7, - 0x78, 0x3d, 0xcd, 0xe7, 0x22, 0xf5, 0x90, 0x7b, 0x65, 0xbe, 0xcc, 0xcf, - 0x38, 0x7e, 0x2d, 0x9f, 0xd7, 0xb8, 0xd5, 0xe4, 0xcf, 0x6f, 0xd1, 0x0f, - 0x4a, 0xd5, 0xff, 0x8b, 0x7e, 0x50, 0x7e, 0x7a, 0x7d, 0x63, 0x7d, 0x75, - 0x42, 0x3e, 0x87, 0x11, 0x9f, 0x06, 0x59, 0x23, 0xbf, 0xad, 0x8e, 0x71, - 0x06, 0xae, 0x20, 0x1f, 0xb8, 0xfe, 0x1f, 0x01, 0x98, 0xca, 0x7f, 0xb6, - 0x97, 0xfd, 0x7a, 0xeb, 0x08, 0x53, 0x35, 0xf1, 0x30, 0xdb, 0xff, 0x89, - 0xa7, 0x2c, 0x78, 0x3f, 0xc4, 0x91, 0x7a, 0x7a, 0x59, 0xef, 0x0e, 0x02, - 0x16, 0xff, 0x0d, 0xac, 0x6c, 0x14, 0x7f, 0x16, 0xd4, 0xd5, 0xfe, 0xb1, - 0xaf, 0xc9, 0xba, 0xdf, 0xb2, 0xc9, 0xfa, 0xb8, 0x71, 0xf5, 0xf2, 0x3b, - 0x10, 0xaf, 0xcf, 0x13, 0x78, 0xba, 0x26, 0x7e, 0xb4, 0xad, 0xef, 0x57, - 0xf3, 0xef, 0xbf, 0x81, 0x40, 0x90, 0x45, 0x61, 0x7d, 0x3d, 0x3f, 0x97, - 0xea, 0xfd, 0xfe, 0x29, 0x11, 0x7f, 0xd9, 0x07, 0x18, 0xbd, 0x85, 0xfd, - 0x5b, 0x34, 0x3c, 0xfd, 0x90, 0x5e, 0xbe, 0x41, 0x53, 0xf3, 0xc6, 0xbe, - 0x05, 0xcf, 0xc2, 0xc6, 0x34, 0xcf, 0x7f, 0x1f, 0xb0, 0x93, 0xe9, 0x4b, - 0xe2, 0xbf, 0x3e, 0xf3, 0xc3, 0xaf, 0x14, 0x80, 0x8e, 0xdf, 0x80, 0x5a, - 0xd4, 0xaf, 0x0a, 0x79, 0x84, 0x21, 0xdf, 0x5f, 0x9c, 0x9e, 0x3f, 0xa9, - 0xf2, 0xdf, 0x12, 0xce, 0xb7, 0xc0, 0xb3, 0x91, 0xe7, 0xb3, 0x71, 0x2b, - 0xaf, 0x17, 0x2a, 0x3e, 0x32, 0xf2, 0xc4, 0xcb, 0xc5, 0x6c, 0xf5, 0xd8, - 0x08, 0xcb, 0x3b, 0xc4, 0xdf, 0xcd, 0x20, 0x8a, 0x5f, 0x63, 0xd3, 0xa9, - 0x96, 0xd9, 0xfb, 0x54, 0xbe, 0x0f, 0xd2, 0xfb, 0x65, 0x8e, 0xaa, 0xf8, - 0x5b, 0xe0, 0x56, 0xd9, 0xf3, 0x1e, 0x79, 0x5e, 0xc5, 0x63, 0x85, 0x7d, - 0xe3, 0xc2, 0x4e, 0x1c, 0x78, 0xbe, 0x05, 0x06, 0x5f, 0x67, 0x78, 0x0b, - 0x49, 0xe7, 0xf1, 0xfa, 0xa8, 0x3d, 0x14, 0xf1, 0x97, 0x00, 0x70, 0x0a, - 0x44, 0xf7, 0x23, 0xac, 0x77, 0x16, 0xf4, 0x64, 0x4f, 0x83, 0x80, 0xf6, - 0x1b, 0x58, 0xb8, 0x8f, 0xf5, 0xa3, 0xe8, 0x39, 0xc0, 0x52, 0x8c, 0xf0, - 0x36, 0x5e, 0x97, 0x8e, 0x91, 0x07, 0xf0, 0xda, 0xe7, 0xde, 0x0e, 0xc3, - 0xf5, 0x5d, 0x21, 0xf1, 0xf6, 0x45, 0xfc, 0xfd, 0x1b, 0xda, 0x78, 0x12, - 0xde, 0x2b, 0x3c, 0xff, 0x7a, 0x3c, 0x9a, 0xaf, 0xdf, 0x84, 0x23, 0xfa, - 0xe1, 0xd5, 0x30, 0x7a, 0x90, 0x5c, 0x4f, 0xfd, 0xc7, 0x9c, 0xbd, 0x00, - 0x83, 0x6a, 0x1c, 0xbd, 0xec, 0x40, 0x5b, 0xb2, 0x84, 0xde, 0xe1, 0x59, - 0xd0, 0x18, 0x4b, 0xc6, 0x3b, 0x78, 0x7b, 0x02, 0xbe, 0x1c, 0xe7, 0x0f, - 0x1c, 0x7f, 0x81, 0xf7, 0x83, 0x91, 0xeb, 0x41, 0xf8, 0x48, 0x43, 0xc5, - 0xe3, 0xb1, 0x95, 0x80, 0x6f, 0xc0, 0xd6, 0xb3, 0x9e, 0x45, 0xe1, 0xfb, - 0x2e, 0x0c, 0x3f, 0x04, 0x3a, 0x97, 0x0a, 0x3f, 0x64, 0x46, 0xab, 0xcf, - 0x0e, 0xeb, 0x7b, 0x17, 0x2c, 0x76, 0x7f, 0x88, 0xe2, 0xa7, 0x55, 0x69, - 0xfd, 0xae, 0xed, 0x4f, 0x48, 0xbc, 0x75, 0xfa, 0x27, 0xf0, 0x7b, 0x24, - 0xfd, 0x95, 0x17, 0x4c, 0x7c, 0x1e, 0x3e, 0x5f, 0x9f, 0xf2, 0xb3, 0x6c, - 0xa7, 0xa4, 0xd7, 0x3c, 0x08, 0x72, 0xb4, 0x5f, 0x01, 0x0d, 0xd8, 0x5f, - 0x01, 0x59, 0x21, 0x23, 0xfb, 0x5b, 0xab, 0xfa, 0xef, 0x49, 0xfc, 0xf2, - 0x51, 0x41, 0x5f, 0xa0, 0x9e, 0x8e, 0xcf, 0xbe, 0x4b, 0xcf, 0x57, 0x52, - 0xf6, 0xb5, 0x4f, 0xe3, 0xb6, 0x6c, 0x3f, 0x0a, 0xd1, 0xfa, 0x47, 0xf2, - 0x42, 0xb4, 0x8c, 0xc8, 0x83, 0xed, 0x03, 0x54, 0xce, 0x91, 0xf1, 0xf7, - 0x65, 0x9b, 0xf8, 0x7f, 0x90, 0xcd, 0x1a, 0xf1, 0x33, 0x7c, 0x8d, 0xb1, - 0x9f, 0x4d, 0xf5, 0x09, 0x62, 0x3d, 0xc2, 0x78, 0xbb, 0xcf, 0xf0, 0xb4, - 0x92, 0xf2, 0xbf, 0xaf, 0x51, 0xf9, 0xc9, 0x97, 0xb7, 0x7e, 0xbe, 0x19, - 0x9f, 0xb1, 0x53, 0xe7, 0x47, 0xf6, 0xc3, 0x28, 0x72, 0xcd, 0x53, 0x79, - 0x8a, 0x60, 0xc5, 0x96, 0x6b, 0xa6, 0xe9, 0x1a, 0xe0, 0x42, 0xf5, 0xe5, - 0x13, 0xb4, 0x7e, 0xfe, 0x49, 0xf2, 0xa6, 0x79, 0x0b, 0x56, 0x30, 0xec, - 0x44, 0xf6, 0x52, 0x3f, 0x0b, 0xb6, 0xf3, 0xfc, 0xba, 0xe5, 0x53, 0xbd, - 0x39, 0x6c, 0x0d, 0xe0, 0xab, 0x9f, 0x0f, 0xf5, 0x2d, 0xb2, 0xc9, 0x89, - 0xfd, 0x5e, 0xc0, 0xf0, 0x8c, 0x65, 0x2f, 0xcb, 0x14, 0x41, 0xe9, 0x75, - 0xd0, 0x98, 0x82, 0x87, 0x7b, 0xde, 0x51, 0x3b, 0x4f, 0x5e, 0x84, 0x9f, - 0xa9, 0x8b, 0xe7, 0x21, 0xc5, 0x4b, 0x99, 0xa2, 0xf9, 0xd8, 0x4e, 0x99, - 0xf2, 0xa7, 0xfc, 0x0b, 0xc7, 0x38, 0xde, 0x4b, 0x90, 0xf5, 0x2b, 0x74, - 0xfe, 0x23, 0xda, 0x7c, 0x09, 0x7b, 0xb5, 0x6e, 0xa6, 0xf9, 0xce, 0x60, - 0x3d, 0x2a, 0x1f, 0x62, 0x78, 0x2b, 0xd2, 0x7e, 0xc8, 0xf2, 0x7e, 0x49, - 0x34, 0x5f, 0xea, 0x10, 0x19, 0x73, 0x9f, 0xc3, 0xeb, 0xcf, 0x37, 0x4b, - 0xff, 0xca, 0x0a, 0x5e, 0xbf, 0x54, 0x40, 0x5b, 0x18, 0x56, 0xeb, 0xd9, - 0x8c, 0xcf, 0xd6, 0xa7, 0x2a, 0xd6, 0xbb, 0x1f, 0xb4, 0x83, 0x87, 0x42, - 0xfb, 0x73, 0xec, 0xbc, 0x8d, 0x7a, 0xf1, 0xd6, 0x71, 0x7a, 0x03, 0xd7, - 0xca, 0xf1, 0xaf, 0x8c, 0xc5, 0xc7, 0xa6, 0xcf, 0xdf, 0x40, 0x9e, 0x57, - 0xf1, 0x77, 0xf9, 0x3c, 0x05, 0xd6, 0x88, 0xed, 0x0f, 0x21, 0xf9, 0x8b, - 0xa0, 0x0f, 0x5b, 0xcc, 0xef, 0x28, 0x68, 0x0f, 0xaf, 0x45, 0x8d, 0xbf, - 0x2c, 0x7d, 0xfc, 0x33, 0xc6, 0xf8, 0xfd, 0x70, 0x91, 0xe3, 0x77, 0xb5, - 0x98, 0x7f, 0xc6, 0x98, 0xff, 0x62, 0xc7, 0x5f, 0x12, 0x3f, 0xbe, 0x9a, - 0x6f, 0xac, 0xfc, 0x6e, 0xc2, 0x13, 0x08, 0xf7, 0xa7, 0x90, 0x3e, 0xde, - 0xd1, 0x36, 0xf1, 0x70, 0x54, 0xfe, 0x4a, 0xbe, 0xc5, 0xfc, 0xac, 0xa4, - 0xf9, 0xdd, 0x18, 0x3f, 0xbf, 0x6c, 0x8b, 0xf9, 0x25, 0x8e, 0xb7, 0x29, - 0x76, 0xbc, 0x04, 0xbc, 0x1e, 0x45, 0xef, 0x47, 0x69, 0x43, 0xa5, 0xd8, - 0xf1, 0x58, 0xfe, 0xd3, 0x82, 0xa4, 0xd7, 0xf5, 0xf2, 0x68, 0xc7, 0xe2, - 0xa7, 0xb0, 0x7a, 0xb5, 0x68, 0x3d, 0xa1, 0xf8, 0x7b, 0x49, 0xc9, 0xd3, - 0x0c, 0x8c, 0xbe, 0x2f, 0x1c, 0xff, 0xf7, 0xb4, 0xfe, 0x4a, 0xe5, 0x0d, - 0x4b, 0x85, 0x3c, 0xa0, 0xfc, 0x7f, 0x85, 0xe2, 0xff, 0xa5, 0x31, 0x86, - 0x86, 0x87, 0xcb, 0xb7, 0x92, 0x7d, 0xed, 0x71, 0x31, 0xe3, 0xaa, 0xf5, - 0xa1, 0x0a, 0xca, 0x0d, 0xd0, 0x92, 0x3b, 0x29, 0x7f, 0xcf, 0x9d, 0x3f, - 0x7f, 0x7e, 0x09, 0xf9, 0xc7, 0x5d, 0xdf, 0xd9, 0x01, 0xbd, 0xfa, 0x75, - 0xfd, 0x63, 0x95, 0x91, 0xbd, 0xc0, 0xbf, 0xa2, 0x13, 0x87, 0x78, 0x6d, - 0x9c, 0x5f, 0x97, 0x59, 0xfd, 0xe1, 0xe4, 0x4b, 0x95, 0xfc, 0x46, 0xda, - 0x71, 0xa8, 0xf6, 0x82, 0x03, 0xad, 0xf2, 0xee, 0x7e, 0xe4, 0xf4, 0x6e, - 0x47, 0xa5, 0x25, 0x36, 0xb6, 0x89, 0x2e, 0xf3, 0xc8, 0x23, 0x4e, 0xe1, - 0x9a, 0xd7, 0xd6, 0x81, 0x46, 0x07, 0xd5, 0x8f, 0x5e, 0x96, 0xf5, 0x17, - 0xe7, 0x57, 0x11, 0x71, 0x82, 0x28, 0x0b, 0x06, 0x0f, 0x43, 0x2a, 0xaf, - 0x30, 0x91, 0x8f, 0x03, 0xe0, 0x24, 0xb2, 0x3b, 0x80, 0xb7, 0x76, 0xec, - 0x6b, 0x4c, 0x7e, 0xbe, 0x1b, 0x6c, 0xb3, 0x50, 0xa7, 0x7f, 0xeb, 0xea, - 0x57, 0x7e, 0xdf, 0xa2, 0xfc, 0xb2, 0x0b, 0x9c, 0x24, 0xcf, 0x8e, 0x8d, - 0xac, 0x46, 0xcf, 0x21, 0xa2, 0x9f, 0xcf, 0xad, 0x1d, 0x26, 0x9a, 0x95, - 0xc5, 0x75, 0xfc, 0x83, 0x80, 0xe1, 0x93, 0x64, 0x6a, 0x45, 0x2b, 0x86, - 0x7f, 0x96, 0xc1, 0xd1, 0x3a, 0xbd, 0x8f, 0xed, 0xf2, 0x92, 0xb8, 0xfb, - 0x01, 0xf8, 0x0e, 0xbb, 0x0f, 0x6c, 0x1c, 0x7b, 0xdf, 0x07, 0x0d, 0x76, - 0x5f, 0xd9, 0x33, 0xc8, 0xe8, 0x87, 0x01, 0x0c, 0x3c, 0xe0, 0x50, 0x9f, - 0x5c, 0x02, 0xaa, 0x7f, 0x0f, 0x4b, 0xd7, 0xc7, 0xca, 0x1b, 0x2a, 0xe2, - 0xa2, 0x93, 0x68, 0x79, 0x5e, 0x8c, 0xeb, 0xa6, 0xfd, 0x6e, 0xca, 0x1f, - 0xae, 0xb3, 0x5a, 0x4a, 0x8f, 0x17, 0x6e, 0x2a, 0xfd, 0xef, 0x68, 0x2f, - 0x95, 0x84, 0x6a, 0xbc, 0x33, 0x82, 0xbe, 0xdc, 0x2e, 0x2a, 0xc4, 0x26, - 0x76, 0x7e, 0x0a, 0x6e, 0x64, 0xf8, 0x25, 0x4d, 0xef, 0xa3, 0xf2, 0xbf, - 0x3b, 0x42, 0x9f, 0x64, 0xf6, 0xc3, 0x8c, 0xff, 0x8b, 0x7c, 0x30, 0x0a, - 0x73, 0xfa, 0x06, 0xd0, 0x5c, 0x8f, 0xba, 0x87, 0x41, 0xd2, 0x33, 0x7a, - 0xcd, 0x53, 0x15, 0x65, 0x80, 0xdf, 0xdf, 0x9e, 0x11, 0x87, 0x61, 0x84, - 0xe1, 0x30, 0xe0, 0xbf, 0x12, 0x78, 0x92, 0x13, 0x3e, 0xbf, 0xfe, 0x04, - 0xe4, 0xcb, 0x3b, 0xd4, 0xcb, 0xf5, 0xf9, 0x69, 0xc4, 0x1f, 0xc8, 0xdc, - 0xa1, 0xf2, 0x9d, 0x65, 0xac, 0xe9, 0xe7, 0xab, 0x12, 0xea, 0x63, 0x37, - 0x94, 0xa2, 0xeb, 0x27, 0xa1, 0x7c, 0x13, 0xf0, 0x5a, 0x63, 0xcf, 0xcf, - 0x72, 0x75, 0x7e, 0x62, 0xf6, 0xe3, 0xca, 0xba, 0xbb, 0xae, 0xfa, 0x41, - 0x29, 0x7f, 0x81, 0x5d, 0xbf, 0x9b, 0x07, 0xc4, 0x13, 0x9e, 0xbf, 0xc4, - 0xf9, 0x3a, 0x4d, 0xf9, 0xc9, 0xe6, 0xfe, 0x9b, 0xf9, 0xca, 0x98, 0xd6, - 0x73, 0xd9, 0x59, 0xa1, 0x3f, 0x92, 0xeb, 0x67, 0x71, 0xe7, 0x61, 0x91, - 0x3f, 0xc7, 0xe8, 0xbf, 0xc1, 0x7a, 0x60, 0xab, 0xf9, 0xcb, 0xf5, 0x12, - 0xfd, 0x2a, 0xa0, 0xdd, 0x10, 0x01, 0xff, 0xd5, 0x71, 0xdf, 0x27, 0xf5, - 0xb5, 0x7f, 0xcd, 0x2d, 0xee, 0xfb, 0x7e, 0x67, 0x91, 0xfd, 0xb0, 0xcd, - 0xfc, 0x65, 0x1f, 0xbc, 0x81, 0xeb, 0x83, 0x46, 0xff, 0x28, 0x89, 0xaf, - 0xfb, 0x77, 0x3f, 0x39, 0x4f, 0xff, 0xee, 0x32, 0xf5, 0x37, 0x9f, 0xd7, - 0x71, 0xd3, 0xe7, 0xfa, 0xe9, 0x7a, 0x5c, 0x2b, 0x7e, 0xe0, 0x72, 0xc3, - 0x9e, 0x3a, 0x05, 0xfc, 0x7a, 0xe1, 0xe9, 0x89, 0x09, 0x41, 0x6f, 0x67, - 0x39, 0x2e, 0x3d, 0x3e, 0x21, 0xae, 0x7d, 0xde, 0x3f, 0xb3, 0x76, 0xb3, - 0xd0, 0xf7, 0x9c, 0x47, 0x58, 0xbf, 0x06, 0x7c, 0xb3, 0xa0, 0x57, 0x6a, - 0xe6, 0x74, 0xf4, 0x8c, 0x33, 0xfc, 0x23, 0x7a, 0x9e, 0xba, 0x3d, 0xa2, - 0xc0, 0x97, 0x7a, 0x6c, 0xc2, 0xb4, 0x21, 0xc3, 0x23, 0x25, 0x5a, 0x03, - 0x8a, 0xf6, 0x97, 0x43, 0x75, 0xc4, 0xcf, 0x13, 0xb7, 0xaf, 0x7c, 0x6e, - 0xf7, 0xf9, 0x2e, 0xf7, 0xcb, 0x4d, 0x17, 0x84, 0xf7, 0x9d, 0x98, 0x4d, - 0xb0, 0x8c, 0xc8, 0xef, 0xbb, 0x9e, 0xc7, 0xa8, 0xeb, 0x61, 0xf2, 0xbf, - 0x17, 0x00, 0xf5, 0x67, 0x95, 0xaa, 0x8d, 0x6a, 0x39, 0x6f, 0xd9, 0xeb, - 0x21, 0xce, 0x0e, 0xbe, 0x7f, 0x12, 0x8f, 0x51, 0x97, 0xe9, 0x92, 0x29, - 0x08, 0xbc, 0xd7, 0x01, 0x26, 0xfc, 0xd3, 0x45, 0xc4, 0x76, 0xdb, 0x60, - 0x59, 0xea, 0x7d, 0x03, 0x27, 0x41, 0xdf, 0x55, 0x60, 0x1e, 0x7c, 0xef, - 0x5e, 0x5e, 0xff, 0xee, 0x07, 0x20, 0x7f, 0xd5, 0x01, 0x04, 0xb6, 0xbf, - 0x0e, 0xcb, 0xac, 0x1e, 0x0a, 0xfb, 0x01, 0xf9, 0xfe, 0x7d, 0x64, 0xbc, - 0xdd, 0x3b, 0x1f, 0xc2, 0xae, 0x3b, 0x8c, 0xec, 0x37, 0x93, 0x43, 0xb9, - 0x9d, 0xd7, 0x93, 0xfd, 0x8d, 0x85, 0x61, 0xd9, 0xe5, 0xf6, 0xf5, 0xd1, - 0x63, 0xa0, 0xd2, 0xf3, 0xb0, 0x2f, 0xc6, 0x0e, 0xdc, 0xbd, 0xc7, 0xef, - 0xa8, 0x14, 0x3e, 0xf3, 0x32, 0xaa, 0x14, 0xa7, 0x68, 0xbf, 0x34, 0x77, - 0x80, 0x5c, 0x37, 0xef, 0xaf, 0xb2, 0x00, 0x9c, 0xb4, 0x7e, 0xbe, 0x91, - 0xf3, 0xd8, 0x10, 0x78, 0xca, 0xf2, 0x7c, 0x35, 0x98, 0xea, 0xe7, 0xb9, - 0x7d, 0x31, 0xf4, 0x88, 0x1f, 0xea, 0xe2, 0xfc, 0xe2, 0xe4, 0x1d, 0x67, - 0x2c, 0x7e, 0x3e, 0xf3, 0x17, 0x84, 0x1f, 0xbe, 0x3a, 0xb1, 0xdf, 0xc1, - 0x65, 0xae, 0x1f, 0x5d, 0xf4, 0xf9, 0x37, 0xfa, 0x23, 0x2d, 0xb6, 0xbf, - 0x92, 0xb9, 0xde, 0x91, 0x7e, 0x59, 0x3c, 0xde, 0x63, 0xf0, 0x03, 0x60, - 0x37, 0xd8, 0xa4, 0xbc, 0xe9, 0x67, 0x01, 0xf2, 0x81, 0xb0, 0x5c, 0xd4, - 0x79, 0x0b, 0x9a, 0xce, 0xdf, 0xa7, 0x4c, 0xf9, 0xe4, 0x07, 0x9d, 0x4f, - 0x53, 0x8a, 0xce, 0x09, 0xfa, 0xb8, 0xb2, 0xdc, 0xb9, 0xae, 0xfa, 0xfc, - 0x5a, 0xc9, 0xdf, 0xed, 0xc6, 0x57, 0x35, 0x7e, 0x33, 0x66, 0xfe, 0xbe, - 0xc1, 0xd2, 0x05, 0x92, 0xf8, 0x95, 0x9a, 0xdf, 0xa5, 0xe5, 0x57, 0xf7, - 0x5c, 0x2a, 0x7e, 0x65, 0xf4, 0xcf, 0x5e, 0x34, 0xbf, 0x82, 0x3a, 0xbf, - 0xea, 0x7e, 0xaa, 0x97, 0xe2, 0x45, 0x83, 0xea, 0x09, 0xf9, 0x1e, 0x15, - 0x4f, 0x61, 0xe7, 0x6f, 0x79, 0x8d, 0xe1, 0x49, 0x93, 0xe7, 0xd9, 0xb9, - 0x9b, 0x16, 0xfc, 0x0a, 0x7c, 0xbd, 0x1c, 0xf2, 0xab, 0x1c, 0x95, 0x97, - 0x41, 0xe6, 0xea, 0xda, 0x52, 0xff, 0x50, 0x37, 0xa8, 0x23, 0x27, 0x43, - 0xf8, 0x95, 0xb7, 0xc0, 0xfc, 0x51, 0xb7, 0x5a, 0xd8, 0xae, 0xbd, 0x73, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Mar 29 23:13:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE9F8D2416C; Wed, 29 Mar 2017 23:13:05 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6BC4A58; Wed, 29 Mar 2017 23:13:05 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TND4Qr031353; Wed, 29 Mar 2017 23:13:04 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TND4Qc031352; Wed, 29 Mar 2017 23:13:04 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201703292313.v2TND4Qc031352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Wed, 29 Mar 2017 23:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316184 - head/sys/dev/ichsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 23:13:06 -0000 Author: gavin Date: Wed Mar 29 23:13:04 2017 New Revision: 316184 URL: https://svnweb.freebsd.org/changeset/base/316184 Log: ichsmb: switch device_probe() from a large case statement to a lookup table. The case statement was getting unmanageably large, and I'm about to add several more devices to it. MFC after: 2 weeks Modified: head/sys/dev/ichsmb/ichsmb_pci.c Modified: head/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- head/sys/dev/ichsmb/ichsmb_pci.c Wed Mar 29 23:00:07 2017 (r316183) +++ head/sys/dev/ichsmb/ichsmb_pci.c Wed Mar 29 23:13:04 2017 (r316184) @@ -67,33 +67,71 @@ __FBSDID("$FreeBSD$"); #include /* PCI unique identifiers */ -#define ID_82801AA 0x24138086 -#define ID_82801AB 0x24238086 -#define ID_82801BA 0x24438086 -#define ID_82801CA 0x24838086 -#define ID_82801DC 0x24C38086 -#define ID_82801EB 0x24D38086 -#define ID_82801FB 0x266A8086 -#define ID_82801GB 0x27da8086 -#define ID_82801H 0x283e8086 -#define ID_82801I 0x29308086 -#define ID_82801JI 0x3a308086 -#define ID_PCH 0x3b308086 -#define ID_6300ESB 0x25a48086 -#define ID_631xESB 0x269b8086 -#define ID_DH89XXCC 0x23308086 -#define ID_PATSBURG 0x1d228086 -#define ID_CPT 0x1c228086 -#define ID_PPT 0x1e228086 -#define ID_AVOTON 0x1f3c8086 -#define ID_COLETOCRK 0x23B08086 -#define ID_LPT 0x8c228086 -#define ID_LPTLP 0x9c228086 -#define ID_WCPT 0x8ca28086 -#define ID_WCPTLP 0x9ca28086 -#define ID_WELLSBURG 0x8d228086 -#define ID_SRPT 0xa1238086 -#define ID_SRPTLP 0x9d238086 +#define PCI_VENDOR_INTEL 0x8086 +#define ID_82801AA 0x2413 +#define ID_82801AB 0x2423 +#define ID_82801BA 0x2443 +#define ID_82801CA 0x2483 +#define ID_82801DC 0x24C3 +#define ID_82801EB 0x24D3 +#define ID_82801FB 0x266A +#define ID_82801GB 0x27da +#define ID_82801H 0x283e +#define ID_82801I 0x2930 +#define ID_82801JI 0x3a30 +#define ID_PCH 0x3b30 +#define ID_6300ESB 0x25a4 +#define ID_631xESB 0x269b +#define ID_DH89XXCC 0x2330 +#define ID_PATSBURG 0x1d22 +#define ID_CPT 0x1c22 +#define ID_PPT 0x1e22 +#define ID_AVOTON 0x1f3c +#define ID_COLETOCRK 0x23B0 +#define ID_LPT 0x8c22 +#define ID_LPTLP 0x9c22 +#define ID_WCPT 0x8ca2 +#define ID_WCPTLP 0x9ca2 +#define ID_WELLSBURG 0x8d22 +#define ID_SRPT 0xa123 +#define ID_SRPTLP 0x9d23 + +static const struct ichsmb_device { + uint16_t id; + const char *name; +} ichsmb_devices[] = { + { ID_82801AA, "Intel 82801AA (ICH) SMBus controller" }, + { ID_82801AB, "Intel 82801AB (ICH0) SMBus controller" }, + { ID_82801BA, "Intel 82801BA (ICH2) SMBus controller" }, + { ID_82801CA, "Intel 82801CA (ICH3) SMBus controller" }, + { ID_82801DC, "Intel 82801DC (ICH4) SMBus controller" }, + { ID_82801EB, "Intel 82801EB (ICH5) SMBus controller" }, + { ID_82801FB, "Intel 82801FB (ICH6) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_82801GB, "Intel 82801GB (ICH7) SMBus controller" }, + { ID_82801H, "Intel 82801H (ICH8) SMBus controller" }, + { ID_82801I, "Intel 82801I (ICH9) SMBus controller" }, + { ID_82801JI, "Intel 82801JI (ICH10) SMBus controller" }, + { ID_PCH, "Intel PCH SMBus controller" }, + { ID_6300ESB, "Intel 6300ESB (ICH) SMBus controller" }, + { ID_631xESB, "Intel 631xESB/6321ESB (ESB2) SMBus controller" }, + { ID_DH89XXCC, "Intel DH89xxCC SMBus controller" }, + { ID_PATSBURG, "Intel Patsburg SMBus controller" }, + { ID_CPT, "Intel Cougar Point SMBus controller" }, + { ID_PPT, "Intel Panther Point SMBus controller" }, + { ID_AVOTON, "Intel Avoton SMBus controller" }, + { ID_LPT, "Intel Lynx Point SMBus controller" }, + { ID_LPTLP, "Intel Lynx Point-LP SMBus controller" }, + { ID_WCPT, "Intel Wildcat Point SMBus controller" }, + { ID_WCPTLP, "Intel Wildcat Point-LP SMBus controller" }, + { ID_COLETOCRK, "Intel Coleto Creek SMBus controller" }, + { ID_WELLSBURG, "Intel Wellsburg SMBus controller" }, + { ID_SRPT, "Intel Sunrise Point-H SMBus controller" }, + { ID_SRPTLP, "Intel Sunrise Point-LP SMBus controller" }, + { 0, NULL }, +}; /* Internal functions */ static int ichsmb_pci_probe(device_t dev); @@ -139,95 +177,19 @@ DRIVER_MODULE(ichsmb, pci, ichsmb_pci_dr static int ichsmb_pci_probe(device_t dev) { - /* Check PCI identifier */ - switch (pci_get_devid(dev)) { - case ID_82801AA: - device_set_desc(dev, "Intel 82801AA (ICH) SMBus controller"); - break; - case ID_82801AB: - device_set_desc(dev, "Intel 82801AB (ICH0) SMBus controller"); - break; - case ID_82801BA: - device_set_desc(dev, "Intel 82801BA (ICH2) SMBus controller"); - break; - case ID_82801CA: - device_set_desc(dev, "Intel 82801CA (ICH3) SMBus controller"); - break; - case ID_82801DC: - device_set_desc(dev, "Intel 82801DC (ICH4) SMBus controller"); - break; - case ID_82801EB: - device_set_desc(dev, "Intel 82801EB (ICH5) SMBus controller"); - break; - case ID_82801FB: - device_set_desc(dev, "Intel 82801FB (ICH6) SMBus controller"); - break; - case ID_82801GB: - device_set_desc(dev, "Intel 82801GB (ICH7) SMBus controller"); - break; - case ID_82801H: - device_set_desc(dev, "Intel 82801H (ICH8) SMBus controller"); - break; - case ID_82801I: - device_set_desc(dev, "Intel 82801I (ICH9) SMBus controller"); - break; - case ID_82801JI: - device_set_desc(dev, "Intel 82801JI (ICH10) SMBus controller"); - break; - case ID_PCH: - device_set_desc(dev, "Intel PCH SMBus controller"); - break; - case ID_6300ESB: - device_set_desc(dev, "Intel 6300ESB (ICH) SMBus controller"); - break; - case ID_631xESB: - device_set_desc(dev, "Intel 631xESB/6321ESB (ESB2) SMBus controller"); - break; - case ID_DH89XXCC: - device_set_desc(dev, "Intel DH89xxCC SMBus controller"); - break; - case ID_PATSBURG: - device_set_desc(dev, "Intel Patsburg SMBus controller"); - break; - case ID_CPT: - device_set_desc(dev, "Intel Cougar Point SMBus controller"); - break; - case ID_PPT: - device_set_desc(dev, "Intel Panther Point SMBus controller"); - break; - case ID_AVOTON: - device_set_desc(dev, "Intel Avoton SMBus controller"); - break; - case ID_LPT: - device_set_desc(dev, "Intel Lynx Point SMBus controller"); - break; - case ID_LPTLP: - device_set_desc(dev, "Intel Lynx Point-LP SMBus controller"); - break; - case ID_WCPT: - device_set_desc(dev, "Intel Wildcat Point SMBus controller"); - break; - case ID_WCPTLP: - device_set_desc(dev, "Intel Wildcat Point-LP SMBus controller"); - break; - case ID_COLETOCRK: - device_set_desc(dev, "Intel Coleto Creek SMBus controller"); - break; - case ID_WELLSBURG: - device_set_desc(dev, "Intel Wellsburg SMBus controller"); - break; - case ID_SRPT: - device_set_desc(dev, "Intel Sunrise Point-H SMBus controller"); - break; - case ID_SRPTLP: - device_set_desc(dev, "Intel Sunrise Point-LP SMBus controller"); - break; - default: + const struct ichsmb_device *device; + + if (pci_get_vendor(dev) != PCI_VENDOR_INTEL) return (ENXIO); + + for (device = ichsmb_devices; device->name != NULL; device++) { + if (pci_get_device(dev) == device->id) { + device_set_desc(dev, device->name); + return (ichsmb_probe(dev)); + } } - /* Done */ - return (ichsmb_probe(dev)); + return (ENXIO); } static int From owner-svn-src-all@freebsd.org Wed Mar 29 23:31:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F0B9D244C6; Wed, 29 Mar 2017 23:31:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4730B617; Wed, 29 Mar 2017 23:31:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2TNVafg037765; Wed, 29 Mar 2017 23:31:36 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2TNVZkN037757; Wed, 29 Mar 2017 23:31:35 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703292331.v2TNVZkN037757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 29 Mar 2017 23:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316185 - in head/sys: kern security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 23:31:37 -0000 Author: rwatson Date: Wed Mar 29 23:31:35 2017 New Revision: 316185 URL: https://svnweb.freebsd.org/changeset/base/316185 Log: When handling msgsys(2), semsys(2), and shmsys(2) multiplex system calls, map the 'which' argument into a suitable audit event identifier for the specific operation requested. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/security/audit/audit.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/kern/sysv_msg.c Wed Mar 29 23:31:35 2017 (r316185) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include FEATURE(sysv_msg, "System V message queues support"); @@ -1639,6 +1640,7 @@ freebsd32_msgsys(struct thread *td, stru #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) + AUDIT_ARG_SVIPC_WHICH(uap->which); switch (uap->which) { case 0: return (freebsd7_freebsd32_msgctl(td, @@ -1810,6 +1812,7 @@ sys_msgsys(td, uap) { int error; + AUDIT_ARG_SVIPC_WHICH(uap->which); if (uap->which < 0 || uap->which >= nitems(msgcalls)) return (EINVAL); error = (*msgcalls[uap->which])(td, &uap->a2); Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/kern/sysv_sem.c Wed Mar 29 23:31:35 2017 (r316185) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include FEATURE(sysv_sem, "System V semaphores support"); @@ -1692,6 +1693,7 @@ sys_semsys(td, uap) { int error; + AUDIT_ARG_SVIPC_WHICH(uap->which); if (uap->which < 0 || uap->which >= nitems(semcalls)) return (EINVAL); error = (*semcalls[uap->which])(td, &uap->a2); @@ -1791,6 +1793,7 @@ freebsd32_semsys(struct thread *td, stru #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) + AUDIT_ARG_SVIPC_WHICH(uap->which); switch (uap->which) { case 0: return (freebsd7_freebsd32_semctl(td, Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/kern/sysv_shm.c Wed Mar 29 23:31:35 2017 (r316185) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -1300,6 +1301,7 @@ int sys_shmsys(struct thread *td, struct shmsys_args *uap) { + AUDIT_ARG_SVIPC_WHICH(uap->which); if (uap->which < 0 || uap->which >= nitems(shmcalls)) return (EINVAL); return ((*shmcalls[uap->which])(td, &uap->a2)); @@ -1315,6 +1317,7 @@ freebsd32_shmsys(struct thread *td, stru #if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) + AUDIT_ARG_SVIPC_WHICH(uap->which); switch (uap->which) { case 0: { /* shmat */ struct shmat_args ap; Modified: head/sys/security/audit/audit.c ============================================================================== --- head/sys/security/audit/audit.c Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/security/audit/audit.c Wed Mar 29 23:31:35 2017 (r316185) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1999-2005 Apple Inc. - * Copyright (c) 2006-2007, 2016 Robert N. M. Watson + * Copyright (c) 2006-2007, 2016-2017 Robert N. M. Watson * All rights reserved. * * Portions of this software were developed by BAE Systems, the University of @@ -472,6 +472,24 @@ audit_commit(struct kaudit_record *ar, i /* Convert the auditon() command to an event. */ ar->k_ar.ar_event = auditon_command_event(ar->k_ar.ar_arg_cmd); break; + + case AUE_MSGSYS: + if (ARG_IS_VALID(ar, ARG_SVIPC_WHICH)) + ar->k_ar.ar_event = + audit_msgsys_to_event(ar->k_ar.ar_arg_svipc_which); + break; + + case AUE_SEMSYS: + if (ARG_IS_VALID(ar, ARG_SVIPC_WHICH)) + ar->k_ar.ar_event = + audit_semsys_to_event(ar->k_ar.ar_arg_svipc_which); + break; + + case AUE_SHMSYS: + if (ARG_IS_VALID(ar, ARG_SVIPC_WHICH)) + ar->k_ar.ar_event = + audit_shmsys_to_event(ar->k_ar.ar_arg_svipc_which); + break; } auid = ar->k_ar.ar_subj_auid; Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/security/audit/audit.h Wed Mar 29 23:31:35 2017 (r316185) @@ -1,7 +1,13 @@ /*- * Copyright (c) 1999-2005 Apple Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * 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: @@ -109,6 +115,7 @@ void audit_arg_svipc_cmd(int cmd); void audit_arg_svipc_perm(struct ipc_perm *perm); void audit_arg_svipc_id(int id); void audit_arg_svipc_addr(void *addr); +void audit_arg_svipc_which(int which); void audit_arg_posix_ipc_perm(uid_t uid, gid_t gid, mode_t mode); void audit_arg_auditon(union auditon_udata *udata); void audit_arg_file(struct proc *p, struct file *fp); @@ -282,6 +289,11 @@ void audit_thread_free(struct thread *t audit_arg_suid((suid)); \ } while (0) +#define AUDIT_ARG_SVIPC_WHICH(which) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_svipc_which((which)); \ +} while (0) + #define AUDIT_ARG_TEXT(text) do { \ if (AUDITING_TD(curthread)) \ audit_arg_text((text)); \ @@ -373,6 +385,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_SOCKET(sodomain, sotype, soprotocol) #define AUDIT_ARG_SOCKADDR(td, dirfd, sa) #define AUDIT_ARG_SUID(suid) +#define AUDIT_ARG_SVIPC_WHICH(which) #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) #define AUDIT_ARG_UPATH1(td, dirfd, upath) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/security/audit/audit_arg.c Wed Mar 29 23:31:35 2017 (r316185) @@ -1,7 +1,13 @@ /*- * Copyright (c) 1999-2005 Apple Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -616,6 +622,19 @@ audit_arg_svipc_addr(void * addr) } void +audit_arg_svipc_which(int which) +{ + struct kaudit_record *ar; + + ar = currecord(); + if (ar == NULL) + return; + + ar->k_ar.ar_arg_svipc_which = which; + ARG_SET_VALID(ar, ARG_SVIPC_WHICH); +} + +void audit_arg_posix_ipc_perm(uid_t uid, gid_t gid, mode_t mode) { struct kaudit_record *ar; Modified: head/sys/security/audit/audit_bsm_klib.c ============================================================================== --- head/sys/security/audit/audit_bsm_klib.c Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/security/audit/audit_bsm_klib.c Wed Mar 29 23:31:35 2017 (r316185) @@ -1,6 +1,6 @@ /* * Copyright (c) 1999-2009 Apple Inc. - * Copyright (c) 2005, 2016 Robert N. M. Watson + * Copyright (c) 2005, 2016-2017 Robert N. M. Watson * All rights reserved. * * Portions of this software were developed by BAE Systems, the University of @@ -141,6 +141,29 @@ static const struct aue_open_event aue_o { (O_WRONLY | O_TRUNC), AUE_OPENAT_WT }, }; +static const int aue_msgsys[] = { + /* 0 */ AUE_MSGCTL, + /* 1 */ AUE_MSGGET, + /* 2 */ AUE_MSGSND, + /* 3 */ AUE_MSGRCV, +}; +static const int aue_msgsys_count = sizeof(aue_msgsys) / sizeof(int); + +static const int aue_semsys[] = { + /* 0 */ AUE_SEMCTL, + /* 1 */ AUE_SEMGET, + /* 2 */ AUE_SEMOP, +}; +static const int aue_semsys_count = sizeof(aue_semsys) / sizeof(int); + +static const int aue_shmsys[] = { + /* 0 */ AUE_SHMAT, + /* 1 */ AUE_SHMDT, + /* 2 */ AUE_SHMGET, + /* 3 */ AUE_SHMCTL, +}; +static const int aue_shmsys_count = sizeof(aue_shmsys) / sizeof(int); + /* * Look up the class for an audit event in the class mapping table. */ @@ -555,6 +578,43 @@ audit_semctl_to_event(int cmd) } /* + * Convert msgsys(2), semsys(2), and shmsys(2) system-call variations into + * audit events, if possible. + */ +au_event_t +audit_msgsys_to_event(int which) +{ + + if ((which >= 0) && (which < aue_msgsys_count)) + return (aue_msgsys[which]); + + /* Audit a bad command. */ + return (AUE_MSGSYS); +} + +au_event_t +audit_semsys_to_event(int which) +{ + + if ((which >= 0) && (which < aue_semsys_count)) + return (aue_semsys[which]); + + /* Audit a bad command. */ + return (AUE_SEMSYS); +} + +au_event_t +audit_shmsys_to_event(int which) +{ + + if ((which >= 0) && (which < aue_shmsys_count)) + return (aue_shmsys[which]); + + /* Audit a bad command. */ + return (AUE_SHMSYS); +} + +/* * Convert a command for the auditon() system call to a audit event. */ au_event_t Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Wed Mar 29 23:13:04 2017 (r316184) +++ head/sys/security/audit/audit_private.h Wed Mar 29 23:31:35 2017 (r316185) @@ -226,6 +226,7 @@ struct audit_record { struct vnode_au_info ar_arg_vnode1; struct vnode_au_info ar_arg_vnode2; int ar_arg_cmd; + int ar_arg_svipc_which; int ar_arg_svipc_cmd; struct ipc_perm ar_arg_svipc_perm; int ar_arg_svipc_id; @@ -303,6 +304,7 @@ struct audit_record { #define ARG_ATFD2 0x0008000000000000ULL #define ARG_RIGHTS 0x0010000000000000ULL #define ARG_FCNTL_RIGHTS 0x0020000000000000ULL +#define ARG_SVIPC_WHICH 0x0200000000000000ULL #define ARG_NONE 0x0000000000000000ULL #define ARG_ALL 0xFFFFFFFFFFFFFFFFULL @@ -463,7 +465,10 @@ au_event_t audit_ctlname_to_sysctlevent au_event_t audit_flags_and_error_to_openevent(int oflags, int error); au_event_t audit_flags_and_error_to_openatevent(int oflags, int error); au_event_t audit_msgctl_to_event(int cmd); -au_event_t audit_semctl_to_event(int cmr); +au_event_t audit_msgsys_to_event(int which); +au_event_t audit_semctl_to_event(int cmd); +au_event_t audit_semsys_to_event(int which); +au_event_t audit_shmsys_to_event(int which); void audit_canon_path(struct thread *td, int dirfd, char *path, char *cpath); au_event_t auditon_command_event(int cmd); From owner-svn-src-all@freebsd.org Thu Mar 30 00:58:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:00:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:03:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C95CD243C4; Thu, 30 Mar 2017 01:03:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49D09869; Thu, 30 Mar 2017 01:03:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U137RQ077604; Thu, 30 Mar 2017 01:03:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U137kc077603; Thu, 30 Mar 2017 01:03:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703300103.v2U137kc077603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 30 Mar 2017 01:03:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316188 - head/lib/libc/inet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:03:08 -0000 Author: emaste Date: Thu Mar 30 01:03:07 2017 New Revision: 316188 URL: https://svnweb.freebsd.org/changeset/base/316188 Log: libc: remove use of archaic __P() macro Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/inet/inet_cidr_pton.c Modified: head/lib/libc/inet/inet_cidr_pton.c ============================================================================== --- head/lib/libc/inet/inet_cidr_pton.c Thu Mar 30 01:00:45 2017 (r316187) +++ head/lib/libc/inet/inet_cidr_pton.c Thu Mar 30 01:03:07 2017 (r316188) @@ -44,10 +44,9 @@ __FBSDID("$FreeBSD$"); # define SPRINTF(x) ((size_t)sprintf x) #endif -static int inet_cidr_pton_ipv4 __P((const char *src, u_char *dst, - int *bits, int ipv6)); -static int inet_cidr_pton_ipv6 __P((const char *src, u_char *dst, - int *bits)); +static int inet_cidr_pton_ipv4 (const char *src, u_char *dst, int *bits, + int ipv6); +static int inet_cidr_pton_ipv6 (const char *src, u_char *dst, int *bits); static int getbits(const char *, int ipv6); From owner-svn-src-all@freebsd.org Thu Mar 30 01:04:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34987D24435; Thu, 30 Mar 2017 01:04:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::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 E378FA3D; Thu, 30 Mar 2017 01:04:04 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id p22so27971769qka.3; Wed, 29 Mar 2017 18:04:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=X40NbBr4JLLYXfj84rfX6bU8uo5HTxa1D3x711w7ioI=; b=jisBna8jgyCcXkiAJ/Hb3zonnI3GJ50ECZ46jpANf6YLwQGKfti6WBQ7KWwBtl/pmK AjEizUHwUPqNYn2YaWmqIFFovTt2Udnv3gOyUqh7K+UwKeaR6/nGKb8SeZ3j5AO0grgr RI5EVjnzOp1WQW+vil4NaU7MY76dz/z4hTVDcGETexA5ksnWdB/YkJ1f9vaCLQ6sTygB MiTS84HfFvkirBkOqODQcXwzfiQVOVmkvmaGyXkjZdbNqiJBc/zyq0rqEweCWMUS1O9b pBUNyH//FWINuKbCG2r9/KaSwsFVMSOjlk6YMqEm9B+kHHp/+6lQa7nQo8V3zk0LLBir 63Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=X40NbBr4JLLYXfj84rfX6bU8uo5HTxa1D3x711w7ioI=; b=Tt5L8dwxlL62/VMlCsgEEIZ/Y3RoQZni9LsLJyZGO2vUfVFJmE27ZJgGtQh4Y3nsFm LdBtlm+bILCyD57ZurdjOy94LlsdPH9CrFmkwZZEcmsXgack+KRKGkB9kQr0+MruwvLe 2X/9lBY60Z2XtaiagDNhstPsL2F8oM8uEfB9vHYA/C4RTf1CLvM6Se1Ou314R6qxWBxN akYjFAxQvjrof2Pa74D3M8Zcbz1fe4qmXiZ/NEC0ySUDpVLWkxtP5WdUn7CTIHPdMLoj 52IUtSEfR7NbwXadhbi5c9PFyte8BmRF5cfe7QPXWRJ2bDb3hTRoVXjYA+GDONZOQh8U YQbw== X-Gm-Message-State: AFeK/H20XOcGrnVcfVX7aJG3h2VKFqMJcLCYIzoC+4bQRUQDe4orY14f8AywkYRMUXmkGmeIs+q2vwFI4EnFag== X-Received: by 10.55.67.135 with SMTP id q129mr3601041qka.98.1490835844235; Wed, 29 Mar 2017 18:04:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.93.18 with HTTP; Wed, 29 Mar 2017 18:04:03 -0700 (PDT) In-Reply-To: References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> From: Ngie Cooper Date: Wed, 29 Mar 2017 18:04:03 -0700 Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Toomas Soome Cc: Warner Losh , Poul-Henning Kamp , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:04:05 -0000 On Wed, Mar 29, 2017 at 3:14 PM, Toomas Soome wrote: ... > One thing is - for now we know the boot2 has not changed and we do not really expect it to change in large scale anyhow. > > Second thing, yes the build process needs to be tested etc, and if needed we can issue statement which compiler we support or not. > > And finally - if the space limit is really-really on the way and no other way, then the alternate is to use freebsd-boot partition - nothing new about it. Great! I didn't figure that it could be changed (given recent discussions). I'll add a nice comment and open a CR/get it right so it's clear why it's 7680. I (for instance) didn't understand exactly why the limit was that way. It helps to document these things for interested parties :). -Ngie From owner-svn-src-all@freebsd.org Thu Mar 30 01:18:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:17:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:30:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:24:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C97D23623 for ; Thu, 30 Mar 2017 01:24:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (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 625A0F68 for ; Thu, 30 Mar 2017 01:24:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x244.google.com with SMTP id f84so1557487ioj.0 for ; Wed, 29 Mar 2017 18:24:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=QzunOusF4pWGAN5x2bfKMJ30noOERD4NZsdErO45v44=; b=SnlJfQARB9vJmH29SG7UXtCsb34oODLsrxxUhzUPcz3cu7qMVKcjJtHj+m6Dps8uRi EIyZt2XPT/r/pWuLwC1Shh+Kae7Xr+xMPY5nS+aYp6czsgH4db/k24CBca4/G3QH0ICj aaPlIV6KR7NvXVTFpS+6gVQsv5INUqbgsLyMMi/hrkmbUgU9LfRsMv2DEkJ+3MSoUILa UgwDVaHaXCBznK53yVcV460JWvqyh3stLGmkOr1O9NXMzh3HMR2pC8HLh3Kctw0VqbfB I9Ogml3StqTDe7X4q3RIovU6pXwxGCSbh2JXGT734H6SVSwcZQuC2ZADJz5+h+o5wPAK OJIQ== 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=QzunOusF4pWGAN5x2bfKMJ30noOERD4NZsdErO45v44=; b=GF7HnSRGOsYgI3AGyw6Gplfc1B4RHcw25LcQw4AdVcbiNE4hrnYDUR7ltKPEXHGi8n UK9O3a8ML/QqAuoY+n7CWaslFgCd7xCSDOwWTrSBJERl31Nh3rHGbWFdSQwobmG5gdhZ eb6pIWgYsSKVaUJ6fvXOwB3K3rNOvRm6MUgEoKcHRNiFGKgibyBahUmwlWTHSHAbeFSg sxD0MwovcQjmCOvTaRN6Tzu5G0DucUR8DeDQ0XeOk8ceraCrJ0bGpjxstu3NS7WZ6xKd /fFCyzuIPoH+1mjHmNBxCv2d/ZyvERcuaIUDpvDBKwIz117YprKZj3823sCaXThG1Gpg 6CEg== X-Gm-Message-State: AFeK/H0xUOoX2KtYqPgfN1CclzBFIh2JDnMxZQexrr2eUT0j8VcLk9ywrGm9vapMOTI8jT4MQ/fbKDd8/vnOhA== X-Received: by 10.107.174.220 with SMTP id n89mr4505004ioo.166.1490837062646; Wed, 29 Mar 2017 18:24:22 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 18:24:22 -0700 (PDT) X-Originating-IP: [2607:fb90:6c9f:5a1f:0:45:9597:bc01] Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 18:24:22 -0700 (PDT) In-Reply-To: References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> From: Warner Losh Date: Wed, 29 Mar 2017 19:24:22 -0600 X-Google-Sender-Auth: YA9T2ATFxNjXaeyy7G-6IrBPNI0 Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Garrett Cooper Cc: John Baldwin , svn-src-head@freebsd.org, "svn-src-all@freebsd.org" , Poul-Henning Kamp , src-committers , Toomas Soome Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 01:24:23 -0000 On Mar 29, 2017 7:04 PM, "Ngie Cooper" wrote: On Wed, Mar 29, 2017 at 3:14 PM, Toomas Soome wrote: ... > One thing is - for now we know the boot2 has not changed and we do not really expect it to change in large scale anyhow. > > Second thing, yes the build process needs to be tested etc, and if needed we can issue statement which compiler we support or not. > > And finally - if the space limit is really-really on the way and no other way, then the alternate is to use freebsd-boot partition - nothing new about it. Great! I didn't figure that it could be changed (given recent discussions). I'll add a nice comment and open a CR/get it right so it's clear why it's 7680. I (for instance) didn't understand exactly why the limit was that way. It helps to document these things for interested parties :). Because it's 8k minus 512 bytes that boot1 consumes. We could gain a few bytes by combining the two, but that gets complicated. And I think people are underestimatin just how ingrained this assumption is outside of file system code... But this is just a legacy issue. Uefi kills these limits. I'm working on automating finding the optimal set of options to use for size so it isn't tedious trial and error. It's totally a non issue today. 6.3 isn't supported at all. Someday we may need to cope, but we have the luxury of time on this. Warner From owner-svn-src-all@freebsd.org Thu Mar 30 01:37:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:37:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:48:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:52:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 01:57:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:00:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:02:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:03:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:16:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:17:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:19:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:23:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:28:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:32:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:34:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3C78D25EFA; Thu, 30 Mar 2017 02:34:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C086CBE2; Thu, 30 Mar 2017 02:34:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2U2YL4b014889; Thu, 30 Mar 2017 02:34:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U2YLfB014888; Thu, 30 Mar 2017 02:34:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201703300234.v2U2YLfB014888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 30 Mar 2017 02:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316206 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 02:34:23 -0000 Author: adrian Date: Thu Mar 30 02:34:21 2017 New Revision: 316206 URL: https://svnweb.freebsd.org/changeset/base/316206 Log: [mbufq] add a concat method. Reviewed by: gnn, ae, glebius Approved by: ae, glebius Differential Revision: https://reviews.freebsd.org/D10158 Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Thu Mar 30 02:32:38 2017 (r316205) +++ head/sys/sys/mbuf.h Thu Mar 30 02:34:21 2017 (r316206) @@ -1320,5 +1320,18 @@ mbufq_prepend(struct mbufq *mq, struct m STAILQ_INSERT_HEAD(&mq->mq_head, m, m_stailqpkt); mq->mq_len++; } + +/* + * Note: this doesn't enforce the maximum list size for dst. + */ +static inline void +mbufq_concat(struct mbufq *mq_dst, struct mbufq *mq_src) +{ + + mq_dst->mq_len += mq_src->mq_len; + STAILQ_CONCAT(&mq_dst->mq_head, &mq_src->mq_head); + mq_src->mq_len = 0; +} + #endif /* _KERNEL */ #endif /* !_SYS_MBUF_H_ */ From owner-svn-src-all@freebsd.org Thu Mar 30 02:37:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:38:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:38:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 02:50:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 03:49:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115B9D24A5B; Thu, 30 Mar 2017 03:49:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EBAABB1; Thu, 30 Mar 2017 03:49:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2U3mvJ8099803 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 06:48:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2U3mvJ8099803 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2U3mvfL099802; Thu, 30 Mar 2017 06:48:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 Mar 2017 06:48:57 +0300 From: Konstantin Belousov To: Robert Watson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316182 - in head/sys: compat/freebsd32 kern sys Message-ID: <20170330034857.GU43712@kib.kiev.ua> References: <201703292233.v2TMXvot015371@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703292233.v2TMXvot015371@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 03:49:02 -0000 On Wed, Mar 29, 2017 at 10:33:57PM +0000, Robert Watson wrote: > Author: rwatson > Date: Wed Mar 29 22:33:56 2017 > New Revision: 316182 > URL: https://svnweb.freebsd.org/changeset/base/316182 > > Log: > Hook up new audit event identifiers for various non-Orange Book/CAPP > system calls supported by OpenBSM 1.2-alpha5. > > Obtained from: TrustedBSD Project > MFC after: 3 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/sys/compat/freebsd32/freebsd32_proto.h > head/sys/compat/freebsd32/freebsd32_sysent.c > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/init_sysent.c > head/sys/kern/syscalls.master > head/sys/sys/sysproto.h This was already discussed somewhere, might be the place was not public enough. The change, as committed, is impossible to read. Please do not mix human-made changes and generated files in one commit. For head it is no much harm to split the syscalls.master commits in way it was always done, for sake of the people reading either commit mails or VCS diffs. I have no opinion on the split/single commit on stable branches. From owner-svn-src-all@freebsd.org Thu Mar 30 04:21:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2520AD25B37; Thu, 30 Mar 2017 04:21:04 +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 E941B3A4; Thu, 30 Mar 2017 04:21:03 +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 v2U4L3hR056272; Thu, 30 Mar 2017 04:21:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U4L39e056271; Thu, 30 Mar 2017 04:21:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703300421.v2U4L39e056271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 Mar 2017 04:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316211 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 04:21:04 -0000 Author: kib Date: Thu Mar 30 04:21:02 2017 New Revision: 316211 URL: https://svnweb.freebsd.org/changeset/base/316211 Log: A followup to r315749, two more places where brand->interp_path was accessed unconditionally. Reported by: se Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Mar 30 02:50:21 2017 (r316210) +++ head/sys/kern/imgact_elf.c Thu Mar 30 04:21:02 2017 (r316211) @@ -291,9 +291,11 @@ __elfN(get_brandinfo)(struct image_param * this, we return first brand which accepted * our note and, optionally, header. */ - if (ret && bi_m == NULL && (strlen(bi->interp_path) + - 1 != interp_name_len || strncmp(interp, - bi->interp_path, interp_name_len) != 0)) { + if (ret && bi_m == NULL && interp != NULL && + (bi->interp_path == NULL || + (strlen(bi->interp_path) + 1 != interp_name_len || + strncmp(interp, bi->interp_path, interp_name_len) + != 0))) { bi_m = bi; ret = 0; } @@ -360,6 +362,7 @@ __elfN(get_brandinfo)(struct image_param != 0) continue; if (hdr->e_machine == bi->machine && + bi->interp_path != NULL && /* ELF image p_filesz includes terminating zero */ strlen(bi->interp_path) + 1 == interp_name_len && strncmp(interp, bi->interp_path, interp_name_len) From owner-svn-src-all@freebsd.org Thu Mar 30 04:56:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD7BD25CA4; Thu, 30 Mar 2017 04:56:30 +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 DB0B3EC6; Thu, 30 Mar 2017 04:56: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 v2U4uTsv072043; Thu, 30 Mar 2017 04:56:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U4uRfo072031; Thu, 30 Mar 2017 04:56:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300456.v2U4uRfo072031@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 04:56:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316212 - in head: share/man/man4 sys/cam/ctl sys/conf sys/modules sys/modules/cfiscsi sys/modules/ctl usr.sbin/ctladm usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 04:56:30 -0000 Author: ngie Date: Thu Mar 30 04:56:27 2017 New Revision: 316212 URL: https://svnweb.freebsd.org/changeset/base/316212 Log: Split iscsi(4) ctl frontend off of ctl(4) as cfiscsi(4) The goal of this work is to remove the explicit dependency for ctl(4) on iscsi(4), so end-users without iscsi(4) support in the kernel can use ctl(4) for its other functions. This allows those without iscsi(4) support built into the kernel to use ctl(4) as a test mechanism. As a sidenote, this was possible around the 10.0-RELEASE period, but made impossible for end-users without iscsi(4) between 10.0-RELEASE and 11.0-RELEASE. Automatically load cfiscsi(4) from ctladm(8) and ctld(8) for backwards compatibility with previously releases. The automatic loading feature is compiled into the beforementioned tools if MK_ISCSI == yes when building world. Add a manpage for cfiscsi(4) and refer to it in ctl(4). Differential Revision: D10099 MFC after: 2 months Relnotes: yes Reviewed by: mav, trasz Sponsored by: Dell EMC Isilon Added: head/share/man/man4/cfiscsi.4 - copied, changed from r315671, head/share/man/man4/ctl.4 head/sys/modules/cfiscsi/ - copied from r315671, head/sys/modules/ctl/ Modified: head/share/man/man4/Makefile head/share/man/man4/ctl.4 head/sys/cam/ctl/ctl_frontend_iscsi.c head/sys/conf/files head/sys/modules/Makefile head/sys/modules/cfiscsi/Makefile head/sys/modules/ctl/Makefile head/usr.sbin/ctladm/Makefile head/usr.sbin/ctladm/ctladm.c head/usr.sbin/ctld/Makefile head/usr.sbin/ctld/kernel.c Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Mar 30 04:21:02 2017 (r316211) +++ head/share/man/man4/Makefile Thu Mar 30 04:56:27 2017 (r316212) @@ -884,6 +884,7 @@ _dtrace_udp.4= dtrace_udp.4 .endif .if ${MK_ISCSI} != "no" +MAN+= cfiscsi.4 MAN+= iscsi.4 MAN+= iscsi_initiator.4 MAN+= iser.4 Copied and modified: head/share/man/man4/cfiscsi.4 (from r315671, head/share/man/man4/ctl.4) ============================================================================== --- head/share/man/man4/ctl.4 Tue Mar 21 08:57:20 2017 (r315671, copy source) +++ head/share/man/man4/cfiscsi.4 Thu Mar 30 04:56:27 2017 (r316212) @@ -1,5 +1,6 @@ .\" Copyright (c) 2013 Edward Tomasz Napierala .\" Copyright (c) 2015-2017 Alexander Motin +.\" Copyright (c) 2017 Ngie Cooper .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,110 +25,35 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 19, 2017 -.Dt CTL 4 +.Dd March 29, 2017 +.Dt CFISCSI 4 .Os .Sh NAME -.Nm ctl -.Nd CAM Target Layer / iSCSI target subsystem +.Nm cfiscsi +.Nd CAM Target Layer iSCSI target frontend .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following lines in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device iscsi" +.Cd "device cfiscsi" .Cd "device ctl" +.Cd "device iscsi" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -ctl_load="YES" +cfiscsi_load="YES" .Ed .Sh DESCRIPTION The .Nm -subsystem provides SCSI target devices emulation. -It supports features such as: -.Pp -.Bl -bullet -compact -.It -Disk, CD-ROM and processor device emulation -.It -Tagged queueing -.It -SCSI task attribute support (ordered, head of queue, simple tags) -.It -SCSI implicit command ordering support -.It -Full task management support (abort, query, reset, etc.) -.It -Support for multiple ports, initiators, targets and backing stores -.It -Support for VMWare VAAI and Microsoft ODX offload (COMPARE AND WRITE, -XCOPY, POPULATE TOKEN/WRITE USING TOKEN, WRITE SAME and UNMAP) -.It -Persistent reservation support -.It -Extensive VPD/mode/log pages support -.It -Featured error reporting, error injection and basic SMART support -.It -High Availability clustering support with ALUA -.It -All I/O handled in-kernel, no userland context switch overhead -.El -.Pp -The -.Nm -subsystem includes multiple frontends to provide access using different -transport protocols and implementations: -.Bl -tag -width cfumass -.It camsim -Provides access for local system via virtual initiator mode -.Xr CAM 4 -SIM. -.It camtgt -Provides access for remote systems via target mode -.Xr CAM 4 -SIMs, such as Fibre Channel -.Xr isp 4 +subsystem provides iSCSI target device emulation via +.Xr ctl 4 and -.Xr mpt 4 . -.It cfumass -Provides access for remote systems via USB Mass Storage Class -Bulk Only (BBB) Transport. -.It ha -Internal frontend used to receive requests from other node ports in -High Availability cluster. -.It ioctl -Provides access for local user-level applications via -.Xr ioctl 2 -based API. -.It iscsi -Combined with -.Xr iscsi 4 -and -.Xr ctld 8 , -provides access for remote systems via iSCSI protocol. -.It tpc -Internal frontend used to receive requests from Third Party Copy engine, -implementing copy offload operations. -.El -.Pp -The -.Nm -subsystem includes two backends to create logical units using different -kinds of backing stores: -.Bl -tag -width ramdisk -.It block -Stores data in ZFS ZVOLs, files or raw block devices. -.It ramdisk -Stores data in RAM, that makes it mostly useful for performance testing. -Depending on configured capacity can work as black hole, thin or thick -provisioned disk. -.El +.Xr iscsi 4 . .Sh SYSCTL VARIABLES The following variables are available as both .Xr sysctl 8 @@ -135,65 +61,6 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent -.It Va kern.cam.ctl.debug -Bit mask of enabled CTL log levels: -.Bl -tag -offset indent -compact -.It 1 -log commands with errors; -.It 2 -log all commands; -.It 4 -log data for commands other then READ/WRITE. -.El -Defaults to 0. -.It Va kern.cam.ctl.ha_id -Specifies unique position of this node within High Availability cluster. -Default is 0 -- no HA, 1 and 2 -- HA enabled at specified position. -.It Va kern.cam.ctl.ha_mode -Specifies High Availability cluster operation mode: -.Bl -tag -offset indent -compact -.It 0 -Active/Standby -- primary node has backend access and processes requests, -while secondary can only do basic LUN discovery and reservation; -.It 1 -Active/Active -- both nodes have backend access and process requests, -while secondary node synchronizes processing with primary one; -.It 2 -Active/Active -- primary node has backend access and processes requests, -while secondary node forwards all requests and data to primary one; -.El -All above modes require established connection between HA cluster nodes. -If connection is not configured, secondary node will report Unavailable -state; if configured but not established -- Transitioning state. -Defaults to 0. -.It Va kern.cam.ctl.ha_peer -String value, specifying method to establish connection to peer HA node. -Can be "listen IP:port", "connect IP:port" or empty. -.It Va kern.cam.ctl.ha_link -Reports present state of connection between HA cluster nodes: -.Bl -tag -offset indent -compact -.It 0 -not configured; -.It 1 -configured but not established; -.It 2 -established. -.El -.It Va kern.cam.ctl.ha_role -Specifies default role of this node: -.Bl -tag -offset indent -compact -.It 0 -primary; -.It 1 -secondary. -.El -This role can be overridden on per-LUN basis using "ha_role" LUN option, -so that for one LUN one node is primary, while for another -- another. -Role change from primary to secondary for HA modes 0 and 2 closes backends, -the opposite change -- opens. -If there is no primary node (both nodes are secondary, or secondary node has -no connection to primary one), secondary node(s) report Transitioning state. -State with two primary nodes is illegal (split brain condition). .It Va kern.cam.ctl.iscsi.debug Verbosity level for log messages from the kernel part of iSCSI target. Set to 0 to disable logging or 1 to warn about potential problems. @@ -212,19 +79,26 @@ Set to 0 to disable sending NOP-In PDUs. Defaults to 5. .El .Sh SEE ALSO -.Xr cfumass 4 , -.Xr ctladm 8 , -.Xr ctld 8 , -.Xr ctlstat 8 +.Xr ctl 4 , +.Xr iscsi 4 .Sh HISTORY The .Nm subsystem first appeared in -.Fx 9.1 . +.Fx 10.0 +as part of the +.Xr ctl 4 +driver. +It was split off of +.Xr ctl 4 +in +.Fx 12.0 . .Sh AUTHORS +.An -nosplit The .Nm -subsystem was originally written by -.An Kenneth Merry Aq Mt ken@FreeBSD.org . -Later work was done by -.An Alexander Motin Aq Mt mav@FreeBSD.org . +subsystem was developed by +.An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org +under sponsorship from the FreeBSD Foundation. +This manual page was written by +.An Ngie Cooper Aq Mt ngie@FreeBSD.org . Modified: head/share/man/man4/ctl.4 ============================================================================== --- head/share/man/man4/ctl.4 Thu Mar 30 04:21:02 2017 (r316211) +++ head/share/man/man4/ctl.4 Thu Mar 30 04:56:27 2017 (r316212) @@ -24,18 +24,17 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd March 19, 2017 +.Dd March 29, 2017 .Dt CTL 4 .Os .Sh NAME .Nm ctl -.Nd CAM Target Layer / iSCSI target subsystem +.Nd CAM Target Layer .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent -.Cd "device iscsi" .Cd "device ctl" .Ed .Pp @@ -106,11 +105,8 @@ Provides access for local user-level app .Xr ioctl 2 based API. .It iscsi -Combined with -.Xr iscsi 4 -and -.Xr ctld 8 , -provides access for remote systems via iSCSI protocol. +Provides access for remote systems via the iSCSI protocol using +.Xr cfiscsi 4 . .It tpc Internal frontend used to receive requests from Third Party Copy engine, implementing copy offload operations. @@ -194,24 +190,9 @@ the opposite change -- opens. If there is no primary node (both nodes are secondary, or secondary node has no connection to primary one), secondary node(s) report Transitioning state. State with two primary nodes is illegal (split brain condition). -.It Va kern.cam.ctl.iscsi.debug -Verbosity level for log messages from the kernel part of iSCSI target. -Set to 0 to disable logging or 1 to warn about potential problems. -Larger values enable debugging output. -Defaults to 1. -.It Va kern.cam.ctl.iscsi.maxtags -The number of outstanding commands to advertise to each iSCSI initiator. -Current implementation is not very accurate, so do not set this below 2. -Defaults to 256. -.It Va kern.cam.ctl.iscsi.ping_timeout -The number of seconds to wait for the iSCSI initiator to respond to a NOP-In -PDU. -In the event that there is no response within that time the session gets -forcibly terminated. -Set to 0 to disable sending NOP-In PDUs. -Defaults to 5. .El .Sh SEE ALSO +.Xr cfiscsi 4 , .Xr cfumass 4 , .Xr ctladm 8 , .Xr ctld 8 , Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 30 04:21:02 2017 (r316211) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Thu Mar 30 04:56:27 2017 (r316212) @@ -184,8 +184,8 @@ static struct ctl_frontend cfiscsi_front .ioctl = cfiscsi_ioctl, .shutdown = cfiscsi_shutdown, }; -CTL_FRONTEND_DECLARE(ctlcfiscsi, cfiscsi_frontend); -MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1); +CTL_FRONTEND_DECLARE(cfiscsi, cfiscsi_frontend); +MODULE_DEPEND(cfiscsi, icl, 1, 1, 1); static struct icl_pdu * cfiscsi_pdu_new_response(struct icl_pdu *request, int flags) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Mar 30 04:21:02 2017 (r316211) +++ head/sys/conf/files Thu Mar 30 04:56:27 2017 (r316212) @@ -102,7 +102,7 @@ cam/ctl/ctl_cmd_table.c optional ctl cam/ctl/ctl_frontend.c optional ctl cam/ctl/ctl_frontend_cam_sim.c optional ctl cam/ctl/ctl_frontend_ioctl.c optional ctl -cam/ctl/ctl_frontend_iscsi.c optional ctl +cam/ctl/ctl_frontend_iscsi.c optional ctl cfiscsi cam/ctl/ctl_ha.c optional ctl cam/ctl/ctl_scsi_all.c optional ctl cam/ctl/ctl_tpc.c optional ctl @@ -1783,10 +1783,10 @@ ipw_monitor.fw optional ipwmonitorfw | compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" -dev/iscsi/icl.c optional iscsi | ctl -dev/iscsi/icl_conn_if.m optional iscsi | ctl -dev/iscsi/icl_soft.c optional iscsi | ctl -dev/iscsi/icl_soft_proxy.c optional iscsi | ctl +dev/iscsi/icl.c optional iscsi +dev/iscsi/icl_conn_if.m optional cfiscsi | iscsi +dev/iscsi/icl_soft.c optional iscsi +dev/iscsi/icl_soft_proxy.c optional iscsi dev/iscsi/iscsi.c optional iscsi scbus dev/iscsi_initiator/iscsi.c optional iscsi_initiator scbus dev/iscsi_initiator/iscsi_subr.c optional iscsi_initiator scbus Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Thu Mar 30 04:21:02 2017 (r316211) +++ head/sys/modules/Makefile Thu Mar 30 04:56:27 2017 (r316212) @@ -471,6 +471,7 @@ _ipfilter= ipfilter .endif .if ${MK_ISCSI} != "no" || defined(ALL_MODULES) +SUBDIR+= cfiscsi SUBDIR+= iscsi SUBDIR+= iscsi_initiator .endif Modified: head/sys/modules/cfiscsi/Makefile ============================================================================== --- head/sys/modules/ctl/Makefile Tue Mar 21 08:57:20 2017 (r315671) +++ head/sys/modules/cfiscsi/Makefile Thu Mar 30 04:56:27 2017 (r316212) @@ -2,32 +2,11 @@ .PATH: ${SRCTOP}/sys/cam/ctl -KMOD= ctl - -SRCS= ctl.c -SRCS+= ctl_backend.c -SRCS+= ctl_backend_block.c -SRCS+= ctl_backend_ramdisk.c -SRCS+= ctl_cmd_table.c -SRCS+= ctl_frontend.c -SRCS+= ctl_frontend_cam_sim.c -SRCS+= ctl_frontend_ioctl.c -SRCS+= ctl_frontend_iscsi.c -SRCS+= ctl_ha.c -SRCS+= ctl_scsi_all.c -SRCS+= ctl_tpc.c -SRCS+= ctl_tpc_local.c -SRCS+= ctl_error.c -SRCS+= ctl_util.c -SRCS+= scsi_ctl.c -SRCS+= bus_if.h -SRCS+= device_if.h -SRCS+= vnode_if.h -SRCS+= icl_conn_if.h -SRCS+= opt_cam.h +KMOD= cfiscsi #CFLAGS+=-DICL_KERNEL_PROXY -MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m +MFILES= dev/iscsi/icl_conn_if.m +SRCS= ctl_frontend_iscsi.c icl_conn_if.h .include Modified: head/sys/modules/ctl/Makefile ============================================================================== --- head/sys/modules/ctl/Makefile Thu Mar 30 04:21:02 2017 (r316211) +++ head/sys/modules/ctl/Makefile Thu Mar 30 04:56:27 2017 (r316212) @@ -12,7 +12,6 @@ SRCS+= ctl_cmd_table.c SRCS+= ctl_frontend.c SRCS+= ctl_frontend_cam_sim.c SRCS+= ctl_frontend_ioctl.c -SRCS+= ctl_frontend_iscsi.c SRCS+= ctl_ha.c SRCS+= ctl_scsi_all.c SRCS+= ctl_tpc.c @@ -23,11 +22,10 @@ SRCS+= scsi_ctl.c SRCS+= bus_if.h SRCS+= device_if.h SRCS+= vnode_if.h -SRCS+= icl_conn_if.h SRCS+= opt_cam.h #CFLAGS+=-DICL_KERNEL_PROXY -MFILES= kern/bus_if.m kern/device_if.m dev/iscsi/icl_conn_if.m +MFILES= kern/bus_if.m kern/device_if.m .include Modified: head/usr.sbin/ctladm/Makefile ============================================================================== --- head/usr.sbin/ctladm/Makefile Thu Mar 30 04:21:02 2017 (r316211) +++ head/usr.sbin/ctladm/Makefile Thu Mar 30 04:56:27 2017 (r316212) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= ctladm SRCS= ctladm.c util.c ctl_util.c ctl_scsi_all.c .PATH: ${SRCTOP}/sys/cam/ctl @@ -17,4 +19,8 @@ WARNS?= 3 LIBADD= cam sbuf bsdxml util MAN= ctladm.8 +.if ${MK_ISCSI} != "no" +CFLAGS+= -DWANT_ISCSI +.endif + .include Modified: head/usr.sbin/ctladm/ctladm.c ============================================================================== --- head/usr.sbin/ctladm/ctladm.c Thu Mar 30 04:21:02 2017 (r316211) +++ head/usr.sbin/ctladm/ctladm.c Thu Mar 30 04:56:27 2017 (r316212) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -4152,6 +4153,13 @@ main(int argc, char **argv) retval = 1; goto bailout; } +#ifdef WANT_ISCSI + else { + if (modfind("cfiscsi") == -1 && + kldload("cfiscsi") == -1) + warn("couldn't load cfiscsi"); + } +#endif } else if ((command != CTLADM_CMD_HELP) && ((cmdargs & CTLADM_ARG_DEVICE) == 0)) { fprintf(stderr, "%s: you must specify a device with the " Modified: head/usr.sbin/ctld/Makefile ============================================================================== --- head/usr.sbin/ctld/Makefile Thu Mar 30 04:21:02 2017 (r316211) +++ head/usr.sbin/ctld/Makefile Thu Mar 30 04:56:27 2017 (r316212) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + CFLAGS+=-I${SRCTOP}/contrib/libucl/include .PATH: ${SRCTOP}/contrib/libucl/include @@ -21,4 +23,8 @@ CLEANFILES= y.tab.c y.tab.h y.output WARNS?= 6 NO_WMISSING_VARIABLE_DECLARATIONS= +.if ${MK_ISCSI} != "no" +CFLAGS+= -DWANT_ISCSI +.endif + .include Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Thu Mar 30 04:21:02 2017 (r316211) +++ head/usr.sbin/ctld/kernel.c Thu Mar 30 04:56:27 2017 (r316212) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -90,6 +91,14 @@ kernel_init(void) } if (ctl_fd < 0) log_err(1, "failed to open %s", CTL_DEFAULT_DEV); +#ifdef WANT_ISCSI + else { + saved_errno = errno; + if (modfind("cfiscsi") == -1 && kldload("cfiscsi") == -1) + log_warn("couldn't load cfiscsi"); + errno = saved_errno; + } +#endif } /* From owner-svn-src-all@freebsd.org Thu Mar 30 04:57:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95FED25D27; Thu, 30 Mar 2017 04:57:29 +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 7762F69; Thu, 30 Mar 2017 04:57:29 +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 v2U4vSX1072123; Thu, 30 Mar 2017 04:57:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U4vQJw072106; Thu, 30 Mar 2017 04:57:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703300457.v2U4vQJw072106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 Mar 2017 04:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316213 - in head: include lib/libc/include lib/libc/stdlib lib/libc/string lib/libc/tests/stdlib lib/libc/tests/string sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 04:57:29 -0000 Author: kib Date: Thu Mar 30 04:57:26 2017 New Revision: 316213 URL: https://svnweb.freebsd.org/changeset/base/316213 Log: Implement the memset_s(3) function as specified by the C11 ISO/IEC 9899:2011 Appendix K 3.7.4.1. Other needed supporting types, defines and constraint_handler infrastructure is added as specified in the C11 spec. Submitted by: Tom Rix Sponsored by: Juniper Networks Discussed with: ed MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D9903 Differential revision: https://reviews.freebsd.org/D10161 Added: head/lib/libc/stdlib/set_constraint_handler_s.c (contents, props changed) head/lib/libc/string/memset_s.c (contents, props changed) head/lib/libc/tests/stdlib/set_constraint_handler_s_test.c (contents, props changed) head/lib/libc/tests/string/memset_s_test.c (contents, props changed) Modified: head/include/stddef.h head/include/stdlib.h head/include/string.h head/lib/libc/include/libc_private.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/string/Makefile.inc head/lib/libc/string/Symbol.map head/lib/libc/tests/stdlib/Makefile head/lib/libc/tests/string/Makefile head/sys/sys/cdefs.h head/sys/sys/errno.h head/sys/sys/stdint.h Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/include/stddef.h Thu Mar 30 04:57:26 2017 (r316213) @@ -72,4 +72,12 @@ typedef __max_align_t max_align_t; #define offsetof(type, member) __offsetof(type, member) +#if __EXT1_VISIBLE +/* ISO/IEC 9899:2011 K.3.3.2 */ +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif +#endif /* __EXT1_VISIBLE */ + #endif /* _STDDEF_H_ */ Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/include/stdlib.h Thu Mar 30 04:57:26 2017 (r316213) @@ -323,6 +323,26 @@ __uint64_t extern char *suboptarg; /* getsubopt(3) external variable */ #endif /* __BSD_VISIBLE */ + +#if __EXT1_VISIBLE + +#ifndef _ERRNO_T_DEFINED +#define _ERRNO_T_DEFINED +typedef int errno_t; +#endif + +/* K.3.6 */ +typedef void (*constraint_handler_t)(const char * __restrict, + void * __restrict, errno_t); +/* K.3.6.1.1 */ +constraint_handler_t set_constraint_handler_s(constraint_handler_t handler); +/* K.3.6.1.2 */ +_Noreturn void abort_handler_s(const char * __restrict, void * __restrict, + errno_t); +/* K3.6.1.3 */ +void ignore_handler_s(const char * __restrict, void * __restrict, errno_t); +#endif /* __EXT1_VISIBLE */ + __END_DECLS __NULLABILITY_PRAGMA_POP Modified: head/include/string.h ============================================================================== --- head/include/string.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/include/string.h Thu Mar 30 04:57:26 2017 (r316213) @@ -141,6 +141,22 @@ int timingsafe_memcmp(const void *, con #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) #include #endif + +#if __EXT1_VISIBLE + +#ifndef _RSIZE_T_DEFINED +#define _RSIZE_T_DEFINED +typedef size_t rsize_t; +#endif + +#ifndef _ERRNO_T_DEFINED +#define _ERRNO_T_DEFINED +typedef int errno_t; +#endif + +/* ISO/IEC 9899:2011 K.3.7.4.1.1 */ +errno_t memset_s(void *, rsize_t, int, rsize_t); +#endif /* __EXT1_VISIBLE */ __END_DECLS #endif /* _STRING_H_ */ Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/include/libc_private.h Thu Mar 30 04:57:26 2017 (r316213) @@ -404,4 +404,6 @@ void __libc_map_stacks_exec(void); void _pthread_cancel_enter(int); void _pthread_cancel_leave(int); +void __throw_constraint_handler_s(const char * restrict msg, int error); + #endif /* _LIBC_PRIVATE_H_ */ Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/stdlib/Makefile.inc Thu Mar 30 04:57:26 2017 (r316213) @@ -13,8 +13,8 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ merge.c mergesort_b.c ptsname.c qsort.c qsort_r.c quick_exit.c \ radixsort.c rand.c \ - random.c reallocarray.c reallocf.c realpath.c remque.c strfmon.c \ - strtoimax.c \ + random.c reallocarray.c reallocf.c realpath.c remque.c \ + set_constraint_handler_s.c strfmon.c strtoimax.c \ strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/stdlib/Symbol.map Thu Mar 30 04:57:26 2017 (r316213) @@ -119,6 +119,9 @@ FBSD_1.4 { FBSD_1.5 { __cxa_thread_atexit; __cxa_thread_atexit_impl; + abort_handler_s; + ignore_handler_s; + set_constraint_handler_s; }; FBSDprivate_1.0 { Added: head/lib/libc/stdlib/set_constraint_handler_s.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/stdlib/set_constraint_handler_s.c Thu Mar 30 04:57:26 2017 (r316213) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2017 Juniper Networks. 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 REGENTS 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 REGENTS 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 "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * Rationale recommends allocating new memory each time. + */ +static constraint_handler_t *_ch = NULL; +static pthread_mutex_t ch_lock = PTHREAD_MUTEX_INITIALIZER; + +constraint_handler_t +set_constraint_handler_s(constraint_handler_t handler) +{ + constraint_handler_t *new, *old, ret; + + new = malloc(sizeof(constraint_handler_t)); + if (new == NULL) + return (NULL); + *new = handler; + if (__isthreaded) + _pthread_mutex_lock(&ch_lock); + old = _ch; + _ch = new; + if (__isthreaded) + _pthread_mutex_unlock(&ch_lock); + if (old == NULL) { + ret = NULL; + } else { + ret = *old; + free(old); + } + return (ret); +} + +void +__throw_constraint_handler_s(const char * restrict msg, errno_t error) +{ + constraint_handler_t ch; + + if (__isthreaded) + _pthread_mutex_lock(&ch_lock); + ch = _ch != NULL ? *_ch : NULL; + if (__isthreaded) + _pthread_mutex_unlock(&ch_lock); + if (ch != NULL) + ch(msg, NULL, error); +} + +void +abort_handler_s(const char * restrict msg __unused, + void * restrict ptr __unused, errno_t error __unused) +{ + + abort(); +} + +void +ignore_handler_s(const char * restrict msg __unused, + void * restrict ptr __unused, errno_t error __unused) +{ +} Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/string/Makefile.inc Thu Mar 30 04:57:26 2017 (r316213) @@ -10,7 +10,7 @@ CFLAGS+= -I${LIBC_SRCTOP}/locale MISRCS+=bcmp.c bcopy.c bzero.c explicit_bzero.c \ ffs.c ffsl.c ffsll.c fls.c flsl.c flsll.c \ memccpy.c memchr.c memrchr.c memcmp.c \ - memcpy.c memmem.c memmove.c memset.c \ + memcpy.c memmem.c memmove.c memset.c memset_s.c \ stpcpy.c stpncpy.c strcasecmp.c \ strcat.c strcasestr.c strchr.c strchrnul.c strcmp.c strcoll.c strcpy.c\ strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \ Modified: head/lib/libc/string/Symbol.map ============================================================================== --- head/lib/libc/string/Symbol.map Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/string/Symbol.map Thu Mar 30 04:57:26 2017 (r316213) @@ -105,6 +105,7 @@ FBSD_1.4 { }; FBSD_1.5 { + memset_s; timingsafe_bcmp; timingsafe_memcmp; }; Added: head/lib/libc/string/memset_s.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/memset_s.c Thu Mar 30 04:57:26 2017 (r316213) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2017 Juniper Networks. 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 REGENTS 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 REGENTS 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 "libc_private.h" + +/* ISO/IEC 9899:2011 K.3.7.4.1 */ +errno_t +memset_s(void *s, rsize_t smax, int c, rsize_t n) +{ + errno_t ret; + rsize_t lim; + unsigned char v; + volatile unsigned char *dst; + + ret = EINVAL; + lim = smax; + v = (unsigned char)c; + dst = (unsigned char *)s; + if (s == NULL) { + __throw_constraint_handler_s("memset_s : s is NULL", ret); + } else if (smax > RSIZE_MAX) { + __throw_constraint_handler_s("memset_s : smax > RSIZE_MAX", + ret); + } else if (n > RSIZE_MAX) { + __throw_constraint_handler_s("memset_s : n > RSIZE_MAX", ret); + } else { + if (n < smax) + lim = n; + while (lim > 0) + dst[--lim] = v; + ret = 0; + } + return (ret); +} Modified: head/lib/libc/tests/stdlib/Makefile ============================================================================== --- head/lib/libc/tests/stdlib/Makefile Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/tests/stdlib/Makefile Thu Mar 30 04:57:26 2017 (r316213) @@ -5,6 +5,7 @@ ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test +ATF_TESTS_C+= set_constraint_handler_s_test ATF_TESTS_C+= tsearch_test .if ${COMPILER_FEATURES:Mc++11} ATF_TESTS_CXX+= cxa_thread_atexit_test Added: head/lib/libc/tests/stdlib/set_constraint_handler_s_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/stdlib/set_constraint_handler_s_test.c Thu Mar 30 04:57:26 2017 (r316213) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2017 Juniper Networks. 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 REGENTS 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 REGENTS 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 + +/* null */ +ATF_TC_WITHOUT_HEAD(null_handler); +ATF_TC_BODY(null_handler, tc) +{ + assert(set_constraint_handler_s(abort_handler_s) == NULL); +} + +/* abort handler */ +ATF_TC_WITHOUT_HEAD(abort_handler); +ATF_TC_BODY(abort_handler, tc) +{ + set_constraint_handler_s(abort_handler_s); + assert(set_constraint_handler_s(ignore_handler_s) == abort_handler_s); +} + +/* ignore handler */ +ATF_TC_WITHOUT_HEAD(ignore_handler); +ATF_TC_BODY(ignore_handler, tc) +{ + set_constraint_handler_s(ignore_handler_s); + assert(set_constraint_handler_s(abort_handler_s) == ignore_handler_s); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, null_handler); + ATF_TP_ADD_TC(tp, abort_handler); + ATF_TP_ADD_TC(tp, ignore_handler); + return (atf_no_error()); +} Modified: head/lib/libc/tests/string/Makefile ============================================================================== --- head/lib/libc/tests/string/Makefile Thu Mar 30 04:56:27 2017 (r316212) +++ head/lib/libc/tests/string/Makefile Thu Mar 30 04:57:26 2017 (r316213) @@ -1,6 +1,7 @@ # $FreeBSD$ ATF_TESTS_C+= memcmp_test +ATF_TESTS_C+= memset_s_test ATF_TESTS_C+= stpncpy_test ATF_TESTS_C+= strerror2_test ATF_TESTS_C+= wcscasecmp_test Added: head/lib/libc/tests/string/memset_s_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/string/memset_s_test.c Thu Mar 30 04:57:26 2017 (r316213) @@ -0,0 +1,195 @@ +/*- + * Copyright (c) 2017 Juniper Networks. 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 REGENTS 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 REGENTS 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 + +static errno_t e; +static const char * restrict m; + +void +h(const char * restrict msg, void * restrict ptr __unused, errno_t error) +{ + e = error; + m = msg; +} + +/* null ptr */ +ATF_TC_WITHOUT_HEAD(null_ptr); +ATF_TC_BODY(null_ptr, tc) +{ + assert(memset_s(0, 1, 1, 1) != 0); +} + +/* smax > rmax */ +ATF_TC_WITHOUT_HEAD(smax_gt_rmax); +ATF_TC_BODY(smax_gt_rmax, tc) +{ + char b; + + assert(memset_s(&b, RSIZE_MAX + 1, 1, 1) != 0); +} + +/* smax < 0 */ +ATF_TC_WITHOUT_HEAD(smax_lt_zero); +ATF_TC_BODY(smax_lt_zero, tc) +{ + char b; + + assert(memset_s(&b, -1, 1, 1) != 0); +} + +/* normal */ +ATF_TC_WITHOUT_HEAD(normal); +ATF_TC_BODY(normal, tc) +{ + char b; + + b = 3; + assert(memset_s(&b, 1, 5, 1) == 0); + assert(b == 5); +} + +/* n > rmax */ +ATF_TC_WITHOUT_HEAD(n_gt_rmax); +ATF_TC_BODY(n_gt_rmax, tc) +{ + char b; + + assert(memset_s(&b, 1, 1, RSIZE_MAX + 1) != 0); +} + +/* n < 0 */ +ATF_TC_WITHOUT_HEAD(n_lt_zero); +ATF_TC_BODY(n_lt_zero, tc) +{ + char b; + + assert(memset_s(&b, 1, 1, -1) != 0); +} + +/* n < smax */ +ATF_TC_WITHOUT_HEAD(n_lt_smax); +ATF_TC_BODY(n_lt_smax, tc) +{ + char b[3] = {1, 2, 3}; + + assert(memset_s(&b[0], 3, 9, 1) == 0); + assert(b[0] == 9); + assert(b[1] == 2); + assert(b[2] == 3); +} + +/* n > smax */ +ATF_TC_WITHOUT_HEAD(n_gt_smax); +ATF_TC_BODY(n_gt_smax, tc) +{ + char b[3] = {1, 2, 3}; + + assert(memset_s(&b[0], 1, 9, 3) == 0); + assert(b[0] == 9); + assert(b[1] == 2); + assert(b[2] == 3); +} + +/* smax > rmax, handler */ +ATF_TC_WITHOUT_HEAD(smax_gt_rmax_handler); +ATF_TC_BODY(smax_gt_rmax_handler, tc) +{ + char b; + + e = 0; + m = NULL; + set_constraint_handler_s(h); + assert(memset_s(&b, RSIZE_MAX + 1, 1, 1) != 0); + assert(e > 0); + assert(strcmp(m, "memset_s : smax > RSIZE_MAX") == 0); +} + +/* smax < 0, handler */ +ATF_TC_WITHOUT_HEAD(smax_lt_zero_handler); +ATF_TC_BODY(smax_lt_zero_handler, tc) +{ + char b; + + e = 0; + m = NULL; + set_constraint_handler_s(h); + assert(memset_s(&b, -1, 1, 1) != 0); + assert(e > 0); + assert(strcmp(m, "memset_s : smax > RSIZE_MAX") == 0); +} + +/* n > rmax, handler */ +ATF_TC_WITHOUT_HEAD(n_gt_rmax_handler); +ATF_TC_BODY(n_gt_rmax_handler, tc) +{ + char b; + + e = 0; + m = NULL; + set_constraint_handler_s(h); + assert(memset_s(&b, 1, 1, RSIZE_MAX + 1) != 0); + assert(e > 0); + assert(strcmp(m, "memset_s : n > RSIZE_MAX") == 0); +} + +/* n < 0, handler */ +ATF_TC_WITHOUT_HEAD(n_lt_zero_handler); +ATF_TC_BODY(n_lt_zero_handler, tc) +{ + char b; + + e = 0; + m = NULL; + set_constraint_handler_s(h); + assert(memset_s(&b, 1, 1, -1) != 0); + assert(e > 0); + assert(strcmp(m, "memset_s : n > RSIZE_MAX") == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, null_ptr); + ATF_TP_ADD_TC(tp, smax_gt_rmax); + ATF_TP_ADD_TC(tp, smax_lt_zero); + ATF_TP_ADD_TC(tp, normal); + ATF_TP_ADD_TC(tp, n_gt_rmax); + ATF_TP_ADD_TC(tp, n_lt_zero); + ATF_TP_ADD_TC(tp, n_gt_smax); + ATF_TP_ADD_TC(tp, n_lt_smax); + ATF_TP_ADD_TC(tp, smax_gt_rmax_handler); + ATF_TP_ADD_TC(tp, smax_lt_zero_handler); + ATF_TP_ADD_TC(tp, n_gt_rmax_handler); + ATF_TP_ADD_TC(tp, n_lt_zero_handler); + return (atf_no_error()); +} Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/sys/sys/cdefs.h Thu Mar 30 04:57:26 2017 (r316213) @@ -750,24 +750,38 @@ #define __XSI_VISIBLE 0 #define __BSD_VISIBLE 0 #define __ISO_C_VISIBLE 1990 +#define __EXT1_VISIBLE 0 #elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ #define __POSIX_VISIBLE 0 #define __XSI_VISIBLE 0 #define __BSD_VISIBLE 0 #define __ISO_C_VISIBLE 1999 +#define __EXT1_VISIBLE 0 #elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ #define __POSIX_VISIBLE 0 #define __XSI_VISIBLE 0 #define __BSD_VISIBLE 0 #define __ISO_C_VISIBLE 2011 +#define __EXT1_VISIBLE 0 #else /* Default environment: show everything. */ #define __POSIX_VISIBLE 200809 #define __XSI_VISIBLE 700 #define __BSD_VISIBLE 1 #define __ISO_C_VISIBLE 2011 +#define __EXT1_VISIBLE 1 #endif #endif +/* User override __EXT1_VISIBLE */ +#if defined(__STDC_WANT_LIB_EXT1__) +#undef __EXT1_VISIBLE +#if __STDC_WANT_LIB_EXT1__ +#define __EXT1_VISIBLE 1 +#else +#define __EXT1_VISIBLE 0 +#endif +#endif /* __STDC_WANT_LIB_EXT1__ */ + #if defined(__mips) || defined(__powerpc64__) || defined(__riscv__) #define __NO_TLS 1 #endif Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/sys/sys/errno.h Thu Mar 30 04:57:26 2017 (r316213) @@ -193,4 +193,12 @@ __END_DECLS #define ERELOOKUP (-5) /* retry the directory lookup */ #endif +#if __EXT1_VISIBLE +/* ISO/IEC 9899:2011 K.3.2.2 */ +#ifndef _ERRNO_T_DEFINED +#define _ERRNO_T_DEFINED +typedef int errno_t; +#endif +#endif /* __EXT1_VISIBLE */ + #endif Modified: head/sys/sys/stdint.h ============================================================================== --- head/sys/sys/stdint.h Thu Mar 30 04:56:27 2017 (r316212) +++ head/sys/sys/stdint.h Thu Mar 30 04:57:26 2017 (r316213) @@ -66,4 +66,11 @@ typedef __uint_fast64_t uint_fast64_t; #define WCHAR_MIN __WCHAR_MIN #define WCHAR_MAX __WCHAR_MAX +#if __EXT1_VISIBLE +/* ISO/IEC 9899:2011 K.3.4.4 */ +#ifndef RSIZE_MAX +#define RSIZE_MAX (SIZE_MAX >> 1) +#endif +#endif /* __EXT1_VISIBLE */ + #endif /* !_SYS_STDINT_H_ */ From owner-svn-src-all@freebsd.org Thu Mar 30 05:00:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C37A8D25E20; Thu, 30 Mar 2017 05:00:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD59295; Thu, 30 Mar 2017 05:00:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2U50CpT015917 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 08:00:13 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2U50CpT015917 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2U50C46015916; Thu, 30 Mar 2017 08:00:12 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 Mar 2017 08:00:12 +0300 From: Konstantin Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316213 - in head: include lib/libc/include lib/libc/stdlib lib/libc/string lib/libc/tests/stdlib lib/libc/tests/string sys/sys Message-ID: <20170330050012.GW43712@kib.kiev.ua> References: <201703300457.v2U4vQJw072106@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703300457.v2U4vQJw072106@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:00:17 -0000 On Thu, Mar 30, 2017 at 04:57:26AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Thu Mar 30 04:57:26 2017 > New Revision: 316213 > URL: https://svnweb.freebsd.org/changeset/base/316213 > > Log: > Implement the memset_s(3) function as specified by the C11 ISO/IEC > 9899:2011 Appendix K 3.7.4.1. Due to (somewhat) controversial nature of the specification, it was agreed that only memset_s() is added, as the function which has real users, even if outside the tree. There is no plans to add other functions, unless somebody needs them. If people are curious what are the issues with the Appendix K, please see documents N1173 Rationale for TR 24731 Extensions to the C Library Part I: Bounds-checking interfaces http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1173.pdf N1967 Field Experience With Annex K http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm from the JTC1/SC22/WG14 - C working group. From owner-svn-src-all@freebsd.org Thu Mar 30 05:11:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71E2ED2525B; Thu, 30 Mar 2017 05:11:59 +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 41AD7CC3; Thu, 30 Mar 2017 05:11:59 +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 v2U5BwaK079892; Thu, 30 Mar 2017 05:11:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U5BwSv079891; Thu, 30 Mar 2017 05:11:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300511.v2U5BwSv079891@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:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316214 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:11:59 -0000 Author: ngie Date: Thu Mar 30 05:11:58 2017 New Revision: 316214 URL: https://svnweb.freebsd.org/changeset/base/316214 Log: Add an UPDATING entry for cfiscsi(4)'s addition in r316212 MFC after: 2 months X-MFC with: r316212 Requested by: mav (D10099) Sponsored by: Dell EMC Isilon Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Mar 30 04:57:26 2017 (r316213) +++ head/UPDATING Thu Mar 30 05:11:58 2017 (r316214) @@ -51,6 +51,19 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170329: + The ctl.ko module no longer implements the iSCSI target frontend: + cfiscsi.ko does instead. + + If building cfiscsi.ko as a kernel module, the module can be loaded + via one of the following methods: + - `cfiscsi_load="YES"` in loader.conf(5). + - Add `cfiscsi` to `$kld_list` in rc.conf(5). + - ctladm(8)/ctld(8), when compiled with iSCSI support + (`WITH_ISCSI=yes` in src.conf(5)) + + Please see cfiscsi(4) for more details. + 20170316: The mmcsd.ko module now additionally depends on geom_flashmap.ko. Also, mmc.ko and mmcsd.ko need to be a matching pair built from the From owner-svn-src-all@freebsd.org Thu Mar 30 05:13:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:13:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:14:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:15:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:16:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:17:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:17:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:17:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:18:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:19:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF087D25703 for ; Thu, 30 Mar 2017 05:19:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (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 7D715C03 for ; Thu, 30 Mar 2017 05:19:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id 190so68728807itm.0 for ; Wed, 29 Mar 2017 22:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=xGY5ikhyPopwNEZcGQgGn2rGdzGf/Ow3KoYNUnN25tk=; b=k9UmPPf9HfqD0tcSI25JLPGSxoDPt7jypR+klKsSxRqY/sD3UPooOmyYOalMpPd3q9 0wZ3BeTdKaDakhFI+oyZtH/2loYD9EJSy2betHUeaGcKusbipIqmgVz9aO6kX0BUqw3V XkofLPW+WhSMp1ta34riTSaqnLJ4GxUx9eIge7blUkQadSgKGvp/h89fq7yaUNOhFUq1 VivYx+elZgRoHsjJgjW6TByi0BifFFZc5XJ98cOdXZGeyfUBJofQDfo1nSDMHG6i1r9b xg8+9R6zZeqk8QoEkIfUyimi6VDl0s+4iLyA5+GMQjHEpsKH0TB0HKfYDIUuOSlP2UKy P3Ag== 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=xGY5ikhyPopwNEZcGQgGn2rGdzGf/Ow3KoYNUnN25tk=; b=mrahfW0ZinX7vHZ65tE88u+enZo3uQeG8fHWJA8c0Y6+274S0zUtosNMF4ydFdZN81 3f4lp438OC4mTVIqx7AxYqYpgpjt36znJLYgX88ZybNEf7iElt9DepUpR6w2L4WT34OP 7dBV1x+/6c2sxECf4JyhGtIGpCQUqb/Ww/URa1z/B1JVrw+PxJcwtq9bHSlvsCJGu4eJ mgGTg9Y/syYhJ8plDL3vR1y63vRltBCcKlc1FsoT6dDfnnaBfKZAUvaAYrkL5wPdaJVe MUYIn37ZK5JlIO1zZqz0BnjiMz16I/5+JdDO1bPtKapdf6FNuofSM/2y/iBjQchkAS4N wA7w== X-Gm-Message-State: AFeK/H0MHN3TUgzbTfts9N/soQX/2pEIMU0QnjgNq0Xdg5f5GbwKHL8VrQ+t8QfOjwd1qLN57IlzSeAb87txvw== X-Received: by 10.36.44.14 with SMTP id i14mr2326530iti.103.1490851182714; Wed, 29 Mar 2017 22:19:42 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 22:19:42 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> From: Warner Losh Date: Wed, 29 Mar 2017 23:19:42 -0600 X-Google-Sender-Auth: bmTD34NE7iu3C6CvadjZVMUj_HM Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Garrett Cooper Cc: John Baldwin , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Poul-Henning Kamp , src-committers , Toomas Soome Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:19:43 -0000 On Wed, Mar 29, 2017 at 7:24 PM, Warner Losh wrote: > > > On Mar 29, 2017 7:04 PM, "Ngie Cooper" wrote: > > On Wed, Mar 29, 2017 at 3:14 PM, Toomas Soome wrote: > > ... > >> One thing is - for now we know the boot2 has not changed and we do not >> really expect it to change in large scale anyhow. >> >> Second thing, yes the build process needs to be tested etc, and if needed >> we can issue statement which compiler we support or not. >> >> And finally - if the space limit is really-really on the way and no other >> way, then the alternate is to use freebsd-boot partition - nothing new about >> it. > > Great! I didn't figure that it could be changed (given recent > discussions). I'll add a nice comment and open a CR/get it right so > it's clear why it's 7680. I (for instance) didn't understand exactly > why the limit was that way. It helps to document these things for > interested parties :). > > > Because it's 8k minus 512 bytes that boot1 consumes. We could gain a few > bytes by combining the two, but that gets complicated. And I think people > are underestimatin just how ingrained this assumption is outside of file > system code... > > But this is just a legacy issue. Uefi kills these limits. > > I'm working on automating finding the optimal set of options to use for size > so it isn't tedious trial and error. It's totally a non issue today. 6.3 > isn't supported at all. Someday we may need to cope, but we have the luxury > of time on this. And also for some perspective, the original ZORK game was only 7720 bytes in length... Granted that was on the pdp-11 on 8th edition research Unix, but I spent more hours playing that came that I have interacting with boot2.... That's only 40 bytes more than the boot2 limit... Warner From owner-svn-src-all@freebsd.org Thu Mar 30 05:22:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:25:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:41:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:41:28 -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-all@freebsd.org Thu Mar 30 05:43:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:44:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:47:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:49:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:49:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:50:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:50:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:51:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D67AD255F8 for ; Thu, 30 Mar 2017 05:51:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm8-vm2.bullet.mail.ne1.yahoo.com (nm8-vm2.bullet.mail.ne1.yahoo.com [98.138.90.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F46F94 for ; Thu, 30 Mar 2017 05:51:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1490853084; bh=fsjEbjtvTH+j3F8FrfrEs9WhfEKRO+pRfBhdXrswhWk=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=NTols793xML1oeDpUIGKQtH3Upmerx1rLqZku/rgW+HDXjaUUVWfZie2f1OSLMHRWz7PoDW6s/Dl9TLsz00X5hrfGRxJYH23/+cAvCPjd6dVE82186gcYQjZ9haiR1sM1JzhZiB5YqYmOXjMnToXMHxu82Wr2UA5tqo24VCjfmEInQJpsl7pHBpA/dcXpjaMfcsjIqwdlE5vwhLADnDRzb0o0BWRWOemwR9Ho3rNv8QNueBZRZdu0XF0l8M722TbfksGjfP5A70fUX3PI+jaTFrSYuYREP1qdVlR0ALSw8eI8TQ7T7z86aISdKXBg8JwBOXomxyilrqteFnUBfAcsA== Received: from [98.138.101.128] by nm8.bullet.mail.ne1.yahoo.com with NNFMP; 30 Mar 2017 05:51:24 -0000 Received: from [98.138.104.116] by tm16.bullet.mail.ne1.yahoo.com with NNFMP; 30 Mar 2017 05:51:24 -0000 Received: from [127.0.0.1] by smtp225.mail.ne1.yahoo.com with NNFMP; 30 Mar 2017 05:51:24 -0000 X-Yahoo-Newman-Id: 9323.64614.bm@smtp225.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: HlWszdMVM1nCfUKqMiY6nKVlA8yjbsdUVT7ZG_qPNd9eY5m .Sj_oitChO5_y28J.iRLkoQp7lfxDslComQ.Ur9Lh.qH.Rbo_CMFSFNHTIgD kQfW_KfAFNiZHLu2Dtm4hYac4f8Kk8rAK8UL1FblxABzg6mewaZFhBugEx7K m9ikg0h8uHfEVkvsNH99wgfXd9_5gT03_h_hRtclCQ2xmf9OEPZpxH5W7Zqo 0sUFH2JHmJozRUf4vHxfIhtdYawUEZt5XHZ5gu0Hs28fflCwW9x00jDWcDjt OUV_nu8Sm3kmawVy0RFATunA.fKsp2I1a2bOFy8fOWPdxrUsFCKrndXOUfNc w18jZjswYMaXxSupiDQHJcX4uUZmKi7ifdkyM1PHVVfQACPbKAjUyNGg5II4 MW4Db2Lk27pNDbg3v6iYhKfvrAC379dlIQmQInYH_pB3T4vIX6.swWKDxoKn n8bTF_UaixxMz3YBDA6kmhTQxyucMXms.RaH4u27VP8y7pdFlHBZamOisgXk ab8cSSBveCSCn5JFWUQYyzqL0BAI3ZZ.RY8Rj3WL5.DdF X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r316213 - in head: include lib/libc/include lib/libc/stdlib lib/libc/string lib/libc/tests/stdlib lib/libc/tests/string sys/sys To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703300457.v2U4vQJw072106@repo.freebsd.org> <20170330050012.GW43712@kib.kiev.ua> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <82479073-92cf-380c-5f4c-c33aa31bb1b3@FreeBSD.org> Date: Thu, 30 Mar 2017 00:51:04 -0500 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: <20170330050012.GW43712@kib.kiev.ua> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 05:51:31 -0000 Thanks! On 30/3/2017 00:00, Konstantin Belousov wrote: > On Thu, Mar 30, 2017 at 04:57:26AM +0000, Konstantin Belousov wrote: >> Author: kib >> Date: Thu Mar 30 04:57:26 2017 >> New Revision: 316213 >> URL: https://svnweb.freebsd.org/changeset/base/316213 >> >> Log: >> Implement the memset_s(3) function as specified by the C11 ISO/IEC >> 9899:2011 Appendix K 3.7.4.1. > Due to (somewhat) controversial nature of the specification, it > was agreed that only memset_s() is added, as the function which > has real users, even if outside the tree. There is no plans to > add other functions, unless somebody needs them. Apple's libc also implemented memset_s() based on some draft implementation from NetBSD. This one looks better. > If people are curious what are the issues with the Appendix K, > please see documents > N1173 Rationale for TR 24731 Extensions to the C Library Part I: > Bounds-checking interfaces > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1173.pdf > N1967 Field Experience With Annex K > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm > from the JTC1/SC22/WG14 - C working group. > > Very interesting, thanks! We looked at the spec for a GSoC but ultimately we ended up spending a lot more time on FORTIFY_SOURCE and left it aside. Ultimately we also left FORTIFY_SOURCE aside but someone has to try such experiments :). The annex K is basically a Microsoft thing (I think I read about glibc adopting it experimentally though). I think it should be useful to have it as an external library for portability, not part of libc or even base. I also find interesting that you included an error handler. Perhaps this may be useful for other types of runtime bounds checking like the stack canaries, safe stack or even the sanitizers. I haven't really looked but we still depend on a GCC library (libssp) for the stack protector so we have a can of worms there. Pedro. From owner-svn-src-all@freebsd.org Thu Mar 30 05:54:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:55:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:57:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:57:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 05:58:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:00:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:00:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:02:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:02:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:04:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:05:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:06:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:06:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:06:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:07:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:07:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:09:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:11:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:13:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:13:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:14:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:14:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:20:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:21:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 06:23:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36021D258DF; Thu, 30 Mar 2017 06:23:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id BE599A61; Thu, 30 Mar 2017 06:23:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B1B004207D7; Thu, 30 Mar 2017 17:23:10 +1100 (AEDT) Date: Thu, 30 Mar 2017 17:23:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 In-Reply-To: Message-ID: <20170330165329.L1061@besplex.bde.org> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=WNavoyhcIkqDBiDOjgAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:23:13 -0000 On Wed, 29 Mar 2017, Warner Losh wrote: > On Wed, Mar 29, 2017 at 3:36 PM, Poul-Henning Kamp wrote: >> -------- >> In message <7448826.asYms2TLO2@ralph.baldwin.cx>, John Baldwin writes: >>> On Wednesday, March 29, 2017 09:30:03 AM Ngie Cooper wrote: >> >>>> Log: >>>> Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... >>>> >>>> This is being done to make it easier to change in the future--this action might be >>>> needed sooner rather than later because of gcc 6.3.0 bailing, stating that there >>>> is negative free space left (deficit) in the boot2 bootloader. >>>> ... >>> >>> This can't be changed. It's baked into the BSD disklabel format. >> >> No it is not, it is baked into FFS, and for UFS2 0, 8, 64 and 256K works. No, it is not. It is only in default disk layouts where the file system leaves space for a boot block and this space is actually used for a boot block, and someone with a name like phk changed the default layout long ago. > Technically, this is correct. Practically, I'm not sure we can ever > really change it. There are too many tools, scripts, etc that just You mean, practically this is correct :-). The ffs limit is irrelevant in theory except for small media, and even 80K floppies could afford a bit more than 8K for boot blocks in emergency. But in practice, the ffs1 limit is still relevant since default disk layouts were only changed 10-15 years ago. > know it's 8k, even though most UFS2 systems start 64k into the volume. > UFS1 systems are still around, and there the limit is a hard limit. > And if we grow it, we run the risk of corrupting data beyond the 8k > area we've traditionally used for this. ffs2 is not needed. I copy partitions a little higher to make space for boot blocks before all partitions. This is mostly on old disks that don't have room for expansion, but it is usually possible to find a spare 8M, possibly by removing the swap partition. But I haven't done this for my oldest disks, so still need the 8K boot blocks for portability. > So the constants are easy enough to change and it seems like it might > be OK. However, doing it in a safe, anti-foot-shooting way will be the > real elbow grease should someone seriously contemplate the change, > especially since the foot-shooting involved has the potential for > filesystem corruption... It takes me too long to move partitions manually. Doing this robustly in an automatic way would be difficult. > But gcc 6.3 likely just needs a little TLC experimenting with its > different code generation flags... I doubt that gcc-6.3 is very broken. Did its CFLAGS even have -Os? Kernel CFLAGS are still broken even for gcc-4.2, by sprinkling inline parameter magic that was more needed for gcc-3.3. The magic isn't really right for gcc-4.2, and breaks -Os for kernels. The magic might be wronger for gcc-6.3, though it would be a compiler bug to not just ignore it if it is nonsense. clang doesn't provide any control over inlining AFAIK, but ignores gcc directive to limit it and does too much. Bruce From owner-svn-src-all@freebsd.org Thu Mar 30 06:24:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F5A5D2599E; Thu, 30 Mar 2017 06:24:32 +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 1CA24C22; Thu, 30 Mar 2017 06:24:32 +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 v2U6OVpw011678; Thu, 30 Mar 2017 06:24:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U6OV9n011677; Thu, 30 Mar 2017 06:24:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201703300624.v2U6OV9n011677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 30 Mar 2017 06:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316258 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:24:32 -0000 Author: kib Date: Thu Mar 30 06:24:30 2017 New Revision: 316258 URL: https://svnweb.freebsd.org/changeset/base/316258 Log: Only activate __EXT1_VISIBLE block when using sys/errno.h in userspace. The prerequisite for '#if __EXT1_VISIBLE' functionality is the inclusion of sys/cdefs.h. errno.h only auto-includes the header for non-kernel environment, and EXT1 block only useful for non-kernel as well. Reported by: lwhsu Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/sys/errno.h Modified: head/sys/sys/errno.h ============================================================================== --- head/sys/sys/errno.h Thu Mar 30 06:20:58 2017 (r316257) +++ head/sys/sys/errno.h Thu Mar 30 06:24:30 2017 (r316258) @@ -193,6 +193,7 @@ __END_DECLS #define ERELOOKUP (-5) /* retry the directory lookup */ #endif +#ifndef _KERNEL #if __EXT1_VISIBLE /* ISO/IEC 9899:2011 K.3.2.2 */ #ifndef _ERRNO_T_DEFINED @@ -200,5 +201,6 @@ __END_DECLS typedef int errno_t; #endif #endif /* __EXT1_VISIBLE */ +#endif #endif From owner-svn-src-all@freebsd.org Thu Mar 30 06:34:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C3BD25C53; Thu, 30 Mar 2017 06:34:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8AF5D2DF; Thu, 30 Mar 2017 06:34:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2U6YMnm036639 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 09:34:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2U6YMnm036639 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2U6YMPZ036638; Thu, 30 Mar 2017 09:34:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 Mar 2017 09:34:22 +0300 From: Konstantin Belousov To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316213 - in head: include lib/libc/include lib/libc/stdlib lib/libc/string lib/libc/tests/stdlib lib/libc/tests/string sys/sys Message-ID: <20170330063422.GY43712@kib.kiev.ua> References: <201703300457.v2U4vQJw072106@repo.freebsd.org> <20170330050012.GW43712@kib.kiev.ua> <82479073-92cf-380c-5f4c-c33aa31bb1b3@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82479073-92cf-380c-5f4c-c33aa31bb1b3@FreeBSD.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:34:27 -0000 On Thu, Mar 30, 2017 at 12:51:04AM -0500, Pedro Giffuni wrote: > Thanks! > > On 30/3/2017 00:00, Konstantin Belousov wrote: > > On Thu, Mar 30, 2017 at 04:57:26AM +0000, Konstantin Belousov wrote: > >> Author: kib > >> Date: Thu Mar 30 04:57:26 2017 > >> New Revision: 316213 > >> URL: https://svnweb.freebsd.org/changeset/base/316213 > >> > >> Log: > >> Implement the memset_s(3) function as specified by the C11 ISO/IEC > >> 9899:2011 Appendix K 3.7.4.1. > > Due to (somewhat) controversial nature of the specification, it > > was agreed that only memset_s() is added, as the function which > > has real users, even if outside the tree. There is no plans to > > add other functions, unless somebody needs them. > > Apple's libc also implemented memset_s() based on some draft > implementation from NetBSD. This one looks better. > > > If people are curious what are the issues with the Appendix K, > > please see documents > > N1173 Rationale for TR 24731 Extensions to the C Library Part I: > > Bounds-checking interfaces > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1173.pdf > > N1967 Field Experience With Annex K > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1967.htm > > from the JTC1/SC22/WG14 - C working group. > > > > > > Very interesting, thanks! We looked at the spec for a GSoC but ultimately > we ended up spending a lot more time on FORTIFY_SOURCE and left it aside. > Ultimately we also left FORTIFY_SOURCE aside but someone has to try such > experiments :). > > The annex K is basically a Microsoft thing (I think I read about glibc > adopting > it experimentally though). I think it should be useful to have it as an > external > library for portability, not part of libc or even base. >From the 'Field Experience' document I cited above, it seems that glibc agressively rejected the proposal to implement it, but I did not investigated actual mailing lists. There are self-contained libraries implementation, again judging by the referenced document. If you and others strongly prefer this thing to be thrown out into separate library, I will do that. OTOH, it is C standard interfaces, even if optional, and its presence does not affect the runtime, comparing with other standards-mandated things, like C11 threading. > > I also find interesting that you included an error handler. Perhaps this may > be useful for other types of runtime bounds checking like the stack > canaries, > safe stack or even the sanitizers. I haven't really looked but we still > depend > on a GCC library (libssp) for the stack protector so we have a can of worms > there. My argument pro for providing the settable constraint handler was that even if implementing a single function from several dozens described by spec, we should provide all dependencies mandated by spec. People do not like the abitily to set the handler, see the referenced doc, but the patch implements relatively robust mitigation against usual objections. From owner-svn-src-all@freebsd.org Thu Mar 30 06:38:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14FB3D25D13 for ; Thu, 30 Mar 2017 06:38:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 CECF87B7 for ; Thu, 30 Mar 2017 06:38:48 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id b140so13197705iof.1 for ; Wed, 29 Mar 2017 23:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ePBQa3Ewh+uduxuLmUG0kDGjDwFBEaphYQyA3Vbgl98=; b=PZpbp+BIYcJorJRWSlo+MH5Gu89NuoZBwbek0tDCVI4cMCfnydfWJL3hCZG9HN9pDk aHe1NHMzywOv8LGNjTSpQqKtETt69RvFV6sk8gWH1spuBhFqxKxs3Imp9Md/YTL+9Qip 1WrHcoJ+Cy/Zlzrca5SP+nvLHvljxnSAjE5NpggRQzSLyt8g8XZWoHGwJtpkOG2tdVkq 8z2GJB4jZltIHOw3Px+wm+AhUbnqlcyC1X4bZP+bd/9gthXKk9QD3ol1Fg5Fg1NK8Uk9 yrivL9mo29rk11LJZ3ZtUCmPoRYDfOeGMaN2yLOfsD6y8hPAKC5IMhFaZrb2AnZ/sYTl iW8w== 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=ePBQa3Ewh+uduxuLmUG0kDGjDwFBEaphYQyA3Vbgl98=; b=dBoaozVU0sIoXD1gNQBWUro34FfnUKAvZr/sda9fTYLNVMC1YqZ5YiaWjClROsGWVu JhSWezMa7anao4f1moaCHkrxlhGrgq5qe4YZ3nkZZGzeuSB2gKaEc5liTmgo1s5cs5cq iFnc676fbi1rVd8VgEZJG1bL5lbDQbzF5T4HIa+v2dNjYeXyaZD/vnShSFoVWZrLuOUc Z5f+RYIezGQ8a/7A3fyjlBw3zhOVq6WtzD7Ooa9F+/DY1Bz2EAL6r8gaIxYJXavC2xAz rfZ5aF9/1Kg5y2KtIk3rkPzwVxAyQcIl10RFaujqEj7+OQyyvI+OPsNHqfP1mxQefIU0 u/iw== X-Gm-Message-State: AFeK/H1Ni/BYLYaL4s1HOeIC/nlb1iZcjajg2tE12LvV5Bgk3YnB37b0xT2OY1BXKUSWApJLdH/+cnv8eQOJmA== X-Received: by 10.107.174.220 with SMTP id n89mr5634095ioo.166.1490855928070; Wed, 29 Mar 2017 23:38:48 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 23:38:47 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:519c:a6cb:84ea:e021] In-Reply-To: <20170330165329.L1061@besplex.bde.org> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> <20170330165329.L1061@besplex.bde.org> From: Warner Losh Date: Thu, 30 Mar 2017 00:38:47 -0600 X-Google-Sender-Auth: KdVf0R50iInioMIyS8TMJESSMhY Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: Bruce Evans Cc: Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:38:49 -0000 On Thu, Mar 30, 2017 at 12:23 AM, Bruce Evans wrote: > I doubt that gcc-6.3 is very broken. Did its CFLAGS even have -Os? Yes. boot2 doesn't use the kernel CFLAGS. > Kernel CFLAGS are still broken even for gcc-4.2, by sprinkling inline > parameter magic that was more needed for gcc-3.3. The magic isn't > really right for gcc-4.2, and breaks -Os for kernels. There is different magic for boot2. >The magic might > be wronger for gcc-6.3, though it would be a compiler bug to not > just ignore it if it is nonsense. clang doesn't provide any control > over inlining AFAIK, but ignores gcc directive to limit it and does > too much. Yes. It does. Hence my glowing review of 6.3 :) But you are right. I'm likely being overly harsh without commanding enough facts to get past my preconceived notions... I don't know if this is a simple compiler bug, lack of proper options, or a need to do things differently. Latter day versions of gcc have many more knobs to turn here. I don't know yet if turning any of them will be helpful. I'm looking to automate the knob turning so that we can at least see which optimizer options have an effect on the size. I doubt more than half a dozen have any useful effect on the size, and finding the right combination likely will suffice. Or we wait for gcc 7 and hope for the best... But this is nothing new. gcc 5.4.0 has -504 bytes free. gcc 4.9.4 has the same. 4.8.5 has -472, etc. It's clear that the magic sweet spot we're in with the in-tree 4.2.1 compiler isn't the sweet spot for these compilers... Then again, clang generated bloated like this until we got boot2 into their test suit, and now we have 100 bytes to spare there. Warner From owner-svn-src-all@freebsd.org Thu Mar 30 06:39:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6256DD25D85; Thu, 30 Mar 2017 06:39:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3380903; Thu, 30 Mar 2017 06:39:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2U6ddvC037733 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 09:39:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2U6ddvC037733 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2U6ddZb037732; Thu, 30 Mar 2017 09:39:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 Mar 2017 09:39:39 +0300 From: Konstantin Belousov To: Robert Watson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316176 - in head/sys: conf modules/dtrace modules/dtrace/dtaudit security/audit Message-ID: <20170330063939.GZ43712@kib.kiev.ua> References: <201703291958.v2TJw0hT049410@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201703291958.v2TJw0hT049410@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:39:44 -0000 On Wed, Mar 29, 2017 at 07:58:00PM +0000, Robert Watson wrote: > Author: rwatson > Date: Wed Mar 29 19:58:00 2017 > New Revision: 316176 > URL: https://svnweb.freebsd.org/changeset/base/316176 > > Log: > Add an experimental DTrace audit provider, which allows users of DTrace to > instrument security event auditing rather than relying on conventional BSM > trail files or audit pipes: > > - Add a set of per-event 'commit' probes, which provide access to > particular auditable events at the time of commit in system-call return. > These probes gain access to audit data via the in-kernel audit_record > data structure, providing convenient access to system-call arguments and > return values in a single probe. > > - Add a set of per-event 'bsm' probes, which provide access to particular > auditable events at the time of BSM record generation in the audit > worker thread. These probes have access to the in-kernel audit_record > data structure and BSM representation as would be written to a trail > file or audit pipe -- i.e., asynchronously in the audit worker thread. > > DTrace probe arguments consist of the name of the audit event (to support > future mechanisms of instrumenting multiple events via a single probe -- > e.g., using classes), a pointer to the in-kernel audit record, and an > optional pointer to the BSM data and its length. For human convenience, > upper-case audit event names (AUE_...) are converted to lower case in > DTrace. > > DTrace scripts can now cause additional audit-based data to be collected > on system calls, and inspect internal and BSM representations of the data. > They do not affect data captured in the audit trail or audit pipes > configured in the system. auditd(8) must be configured and running in > order to provide a database of event information, as well as other audit > configuration parameters (e.g., to capture command-line arguments or > environmental variables) for the provider to operate. > > Reviewed by: gnn, jonathan, markj > Sponsored by: DARPA, AFRL > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D10149 On kernels configs which do not have AUDIT option (and no any DTRACE-related options), I get /usr/home/kostik/work/build/bsd/DEV/src/sys/security/audit/audit_dtrace.c:184:8: error: implicit declaration of function 'au_evnamemap_lookup' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ene = au_evnamemap_lookup(event); ^ /usr/home/kostik/work/build/bsd/DEV/src/sys/security/audit/audit_dtrace.c:184:6: error: incompatible integer to pointer conversion assigning to 'struct evname_elem *' from 'int' [-Werror,-Wint-conversion] ene = au_evnamemap_lookup(event); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/home/kostik/work/build/bsd/DEV/src/sys/security/audit/audit_dtrace.c:197:23: error: no member named 'ene_commit_probe_enabled' in 'struct evname_elem' probe_enabled = ene->ene_commit_probe_enabled || ~~~ ^ /usr/home/kostik/work/build/bsd/DEV/src/sys/security/audit/audit_dtrace.c:198:11: error: no member named 'ene_bsm_probe_enabled' in 'struct evname_elem' ene->ene_bsm_probe_enabled; ~~~ ^ /usr/home/kostik/work/build/bsd/DEV/src/sys/security/audit/audit_dtrace.c:220:35: error: no member named 'k_dtaudit_state' in 'struct kaudit_record' ene = (struct evname_elem *)kar->k_dtaudit_state; ~~~ ^ etc. From owner-svn-src-all@freebsd.org Thu Mar 30 06:42:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 119F2D25F83; Thu, 30 Mar 2017 06:42:04 +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 CE942D1D; Thu, 30 Mar 2017 06:42:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id g2so7657927pge.2; Wed, 29 Mar 2017 23:42:03 -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=4XhWuBSho/BNJjgUCqCOw2L6BznAIsICzejMlu8T4fY=; b=LZvKP+bTmp5FzIwcJ6Ytc0fYZBAmM+SGtOYs/J1OxG0L9pZxM6HXoX5queeZAF77g9 bj5v28ZbX45nxToY3eYiFaSnHuopxnybOnhF1Qu2NfgmoTyRedNebNqJXiG2tg07V8z/ 2vpSmJHqA9i4fp7rlf2YzVjGj69LnfbibK89Hl+RAhjYBfftIx+muW3WW0BHZe2b/NSK zGu0sQxU+QqKZRy9wq3SjKUoIQdPjC87f/zAImdy9SxdvjBGzVt59fLw3DHYmfWG+oxG jOQ1V1UvUXfV3PEd9XEijrKYTYjAXYJVZwmCphrXwOuCru9d6Y6JROOFUFHGA01Yj8+K IJ+g== 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=4XhWuBSho/BNJjgUCqCOw2L6BznAIsICzejMlu8T4fY=; b=JYgesql1LjmazZMPQCQJQeTQyWa6Ct5roGXe0eNroeVJ2yQQFWVhFccUP606aB/5r3 +8AqXhXhweqoCcKeJ+UVelzuawk0Di3fbXP9EaCCyL9xFYJEUZKvcGhb9Aa4/2DdVwpK 4F8EPr5o3FOD/7U0heOqrLwc7o6ETExaQ6jxU+sUqmLeIl5VJRIs0EMsiZ5GVpJ2jOzQ bKag8X+RIoY4SkM8JmV/fG+bluqnrYrjuFzsqvwPVpGQR0hIY8d5fFOQgXT4qS/npTLU 57dHPXqCDcbjInp1lwZEEQpBHfUqwQEVoCJ5Arq8Bxj+ct4XwkfeDbJZtBb2UE3Oi4Ed zYTg== X-Gm-Message-State: AFeK/H1wZNMhjTKQhQtg9IOzcrxnjJQbDzkZpj7HHI5VNbpK4SuC8I0GT/7mze0W2p4S3w== X-Received: by 10.84.218.138 with SMTP id r10mr5075026pli.165.1490856123396; Wed, 29 Mar 2017 23:42:03 -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 s3sm1972327pgn.55.2017.03.29.23.42.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Mar 2017 23:42:02 -0700 (PDT) Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_4880892A-64E4-45AC-B7EF-1A27C2BD117F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Wed, 29 Mar 2017 23:42:00 -0700 Cc: Bruce Evans , Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <6B63C559-C48C-4824-9D24-87FF89336FE4@gmail.com> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> <20170330165329.L1061@besplex.bde.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:42:04 -0000 --Apple-Mail=_4880892A-64E4-45AC-B7EF-1A27C2BD117F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 29, 2017, at 23:38, Warner Losh wrote: >=20 > On Thu, Mar 30, 2017 at 12:23 AM, Bruce Evans = wrote: >> I doubt that gcc-6.3 is very broken. Did its CFLAGS even have -Os? >=20 > Yes. boot2 doesn't use the kernel CFLAGS. >=20 >> Kernel CFLAGS are still broken even for gcc-4.2, by sprinkling inline >> parameter magic that was more needed for gcc-3.3. The magic isn't >> really right for gcc-4.2, and breaks -Os for kernels. >=20 > There is different magic for boot2. >=20 >> The magic might >> be wronger for gcc-6.3, though it would be a compiler bug to not >> just ignore it if it is nonsense. clang doesn't provide any control >> over inlining AFAIK, but ignores gcc directive to limit it and does >> too much. >=20 > Yes. It does. Hence my glowing review of 6.3 :) But you are right. I'm > likely being overly harsh without commanding enough facts to get past > my preconceived notions... I don't know if this is a simple compiler > bug, lack of proper options, or a need to do things differently. > Latter day versions of gcc have many more knobs to turn here. I don't > know yet if turning any of them will be helpful. I'm looking to > automate the knob turning so that we can at least see which optimizer > options have an effect on the size. I doubt more than half a dozen > have any useful effect on the size, and finding the right combination > likely will suffice. Or we wait for gcc 7 and hope for the best... >=20 > But this is nothing new. gcc 5.4.0 has -504 bytes free. gcc 4.9.4 has > the same. 4.8.5 has -472, etc. It's clear that the magic sweet spot > we're in with the in-tree 4.2.1 compiler isn't the sweet spot for > these compilers... Then again, clang generated bloated like this until > we got boot2 into their test suit, and now we have 100 bytes to spare > there. I know that a handful of people (several years ago) spent a lot of time = making clang work with boot2 and be under the limit. I=E2=80=99m not = entirely sure, but we could have done similar things (but in more = ominous ways in) gcc 4.2.1 to shrink down the boot loader. Just a thought >_>=E2=80=A6 -Ngie --Apple-Mail=_4880892A-64E4-45AC-B7EF-1A27C2BD117F 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 iQIcBAEBCgAGBQJY3Ki5AAoJEPWDqSZpMIYVJPkQANXbiVVyuAjHwsxFBz3CYqJl uSjq5TEXru0fKZFv+IRxLQyx7GkBV+Bwgr4UhKs5/9ZAClq0QklUFpi2YnkrvZHN LUsXc7bYoJPGtQGwpvbezJHohMaBwGogky4hsH+KcsFvPltAqOdxUeM3W4JiaCcX c3iKsb8yGeK2Ub3Z5bLq2pInZ3HrImaCUTWvPoJUW9e180glBYApywNdd4KbDoNB Dm32slE+qksLfbGM/KLHIzqKKaGsNTU4Kmj8o2fneOX7Y569/ZcDMo+dv8Eb6Bv0 IT2dnHQuhB3uUbcWhJe34xJPBYvFdE05HFjp2gjGbGnCi4eymOYkAnDobvYc194o OcIMRWJpmkG12pAnCu6uD49rmrbIXYNcHYyrfA9o0yfyrJDFj0lizhP7klS4UAN1 zqytCmWIL194CNHHVapNDYpggHlR/W8BFJeQqovyTzQ7sddj6SOF6h/0Iv8h9xwL jrK0IxS0AwAyJlAAxx55+DIpHnWnrAELwdrfxD2LQ4MM2jvi06TheWkdM55iNTI5 G635BMxX4+QeGjcJ1ca0EGLLSYtvYrjmQxJlrctPhYeq9H5rjTZjffVtZSra9FIj F/OKmWhtpCz/amqWV1oMV9izmeFbdbNAr8grqbFUYyPTKpGNzxCUzPDYcRkt21hY ftE3HwMEaER9m1/idEZH =XZce -----END PGP SIGNATURE----- --Apple-Mail=_4880892A-64E4-45AC-B7EF-1A27C2BD117F-- From owner-svn-src-all@freebsd.org Thu Mar 30 06:44:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2B5CD25020; Thu, 30 Mar 2017 06:44:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (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 702EBF13; Thu, 30 Mar 2017 06:44:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id o123so7710382pga.1; Wed, 29 Mar 2017 23:44:31 -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=kXj6JVi1RvL90ZlaNH1zxuzwlzGwFeFdyaDPlCy6HOQ=; b=CK+nDRDbuynW5+k0lyHOGedRDwI4jZ1tuVnBhwH/ELwoQPjfRaX83UMbBkwOysyK3Q llqdbcq9fw00/RhE+3KVRcKQWh4pIvxKOl/CkUtyXR3bAGviP+DkTS4wIzKIPoGDrU8A FouCmDoN6mmykcJnPzXTPm4TUuEDjbseZE5NcH2AmBPaMGMJuSmh2kZp+tVS7EgqZArS gYUWSPQ53kyLWRRxvARME/H/x1rv6d5s4HBLWqS18z0z2tqiz81tO2r2WQILWIDSqQGs i7COCV2qDte+FdigLBG53+SlQRqQY+LECZgULyzRKHrHa9Y/z89xS+ixS+iGKofPbMNj CWBA== 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=kXj6JVi1RvL90ZlaNH1zxuzwlzGwFeFdyaDPlCy6HOQ=; b=g3rO9typFT523y/AeK3g42ZG68neBe7E2XJGaqDzhfAvFozREhBgYdHCMwTTID9O3M a5VpW6pZCaja6ygwXznHLkDzh5IpveJXuiGO2TwpT3KBxkbU9eQGAT7A/5vdHcp6QJ94 DhCaSzeT2HyRsM4fr5OFrx8cGCJJBwJ/yV6f7zTJ6qIDLeDYEvdA/7mscH5qCDLhXBux E83Abej/olL2fmijw2KcuPKF6KGxlq5pZM9QqMdnte6FkqvW8aEQXh59jXQSvxa7j4ih gHsHM1QL3/64jHMgimXvw0PWpwFE4aENtSVnVWL2rlN2AMYt8jrwiKlYhq5lkWmkLCVL 7UWg== X-Gm-Message-State: AFeK/H3Fk+eaFC3UPJKOg8HCLa8Uz0YnLoJxKcE4yBPW/bzz6hsdLzV/zOzvgd43EZRY8g== X-Received: by 10.98.198.138 with SMTP id x10mr4448460pfk.85.1490856270854; Wed, 29 Mar 2017 23:44:30 -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 m194sm1982205pga.62.2017.03.29.23.44.29 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Mar 2017 23:44:29 -0700 (PDT) Subject: Re: svn commit: r316179 - head/contrib/netbsd-tests/lib/libc/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2EEB8795-A5CA-47C0-B90B-FAA621E6A05A"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201703292126.v2TLQEhP087162@repo.freebsd.org> Date: Wed, 29 Mar 2017 23:44:29 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <604E5ED9-584C-4B04-9633-6C8032EF428F@gmail.com> References: <201703292126.v2TLQEhP087162@repo.freebsd.org> To: Conrad Meyer X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:44:31 -0000 --Apple-Mail=_2EEB8795-A5CA-47C0-B90B-FAA621E6A05A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 29, 2017, at 14:26, Conrad Meyer wrote: >=20 > Author: cem > Date: Wed Mar 29 21:26:13 2017 > New Revision: 316179 > URL: https://svnweb.freebsd.org/changeset/base/316179 >=20 > Log: > t_msgsnd: Use msgsnd()'s msgsz argument correctly to avoid overflow >=20 > msgsnd's msgsz argument is the size of the message following the = 'long' > message type. Don't include the message type in the size of the = message > when invoking msgsnd(2). >=20 > Reported by: Coverity > CID: 1368712 > Sponsored by: Dell EMC Isilon (Replying to a message) Thank you for fixing these issues. Please send me an email = beforehand so I=E2=80=99m aware of these changes (especially since = I=E2=80=99ll be away from FreeBSD for 2 months in a couple days), and so = I know that they can be upstreamed to NetBSD. Take care, -Ngie --Apple-Mail=_2EEB8795-A5CA-47C0-B90B-FAA621E6A05A 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 iQIcBAEBCgAGBQJY3KlNAAoJEPWDqSZpMIYVAp4QAIbNuuY+7xK7QTAxSOvi9ikO 7kN/pb5Urqwnssks4CV6ximjN9+l81hvhgwVmZdEYdMvy2yObApq/B+/bbkN36/P MjAaez9R+dILX2qlRTfeUjRYBhPvVyk3a6Y6+V3w3Z8HpjPS4mI23/FCc/6uS9Eb Wq4n9XbYpb3n358Aj/H4jtMZl6I0CbAMl+D4pGziZTBU8rxv1UaSwE6czyQU/W9n /HiK3+pMUUXepRU4hch/4bn0Mw/vDtFr/MmMohfaEwE7GBrr8XynQih3m1hTNzK3 JMvq+OLqHcCf+7L4I6jAB/ZmAG2iXriTMttLmoHh0jaUP5JuFP/MuYn3C6yE0icl AnueqmY7UTLP/2q7RTlWW1MKKzsRS4CgF/ETlBQJZ1Gp6BJqdWnEoAR0Krg8br4J wtR2TRhq8S7a148O2D8/iwVtfH3tmGsbyAuFDLZL9raA0s212r4zXSsJvMU7N3dg 7atltHaTdLXCdtbtIGCedyeLFkv0VjiGUwMp35O/PvOAoBsoXavGQ1BPYSRfqJgK GlycDe92quIKwAPxNuln08Lmvz251PGARYxIyZV95ovb2UpezWDS7lhuGCzdVDRQ Gh+IWMHoG1J4qRtNJQsgMj+Z3/odD666z4GTRK8V42jNHt9aW0YOnaChWxW87Anf j3G7Ui4RGDfKlpDDs+Hr =x6nh -----END PGP SIGNATURE----- --Apple-Mail=_2EEB8795-A5CA-47C0-B90B-FAA621E6A05A-- From owner-svn-src-all@freebsd.org Thu Mar 30 06:47:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 849F2D25117 for ; Thu, 30 Mar 2017 06:47:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::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 47F7C167 for ; Thu, 30 Mar 2017 06:47:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x241.google.com with SMTP id f84so2054911ioj.0 for ; Wed, 29 Mar 2017 23:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=A6iCsqt0TvG5TvMoLlvkijAFRd3Lor8tjYVmEvDuXtE=; b=W7XUN8AdMpRKd3EtuNhuEe+8M+EQsG02JNLTkHQYlb/+2dL5EhzAo71IxEx5fXVWb9 pW3n1k4WBnm0dze3lo1+uPuDr3/p4aX6/n7CEQ/SOotnsm0A32a8L7ymsfUmrEt1XmR8 em6y61tx3MRzAyae3I0sLLR5iJPPAgtkMmLZc23Irr1NY6t2zIC7F6NL+SWuYawLK545 QsZpmFJ1oi4T+G3u5BebpYqvZCrYmyL7ZhiLPTX2BvTdBuNKFn1Uks8i9qQsxuco+7OF cs44/7kqrQi+2yWO2n4Yy8JNFr5LYDiTgyP/VnNoVOR6SPgluU0Nh7NySoGIoeHVlnt9 4aug== 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:content-transfer-encoding; bh=A6iCsqt0TvG5TvMoLlvkijAFRd3Lor8tjYVmEvDuXtE=; b=QeV95oElcVQYZBEjL9rdtm0qKIz6axtXsK2k4TNpR/HtFZXI0sadLb5F7+20Tgxa2B h4mwUafUy8ZtSlJMGCaZ3pwl9GMdsjcSoO315wcq2p3eo4q9nAbn4sbDr0XxQ/hFF0zl nfRAAmzCpJewj9F1E/E1ddMjHronkw7Qiw1EYDpkTTU3589BbOV2OIha3w47fz93Ozk0 M8gwC+mQ/pBos+DPfU0OMuNs1qH18SjTWavAADb5C/PCLJdbF9U+gSwR9ik28BiRxdkC VxDR4ESgYNmmK9gvSy6MpzpUzvHJchlENKANnqL4npOk4U4dr9ngS96T64UUPwqTH2OW eieQ== X-Gm-Message-State: AFeK/H3y+u85NC0ioOrxWMqWM07/REXEMXjqMHYx3R7LwtQt6IU0Fv4dYkpxmBTpN+leA/374mwKbKH5GowK/g== X-Received: by 10.107.174.220 with SMTP id n89mr5665683ioo.166.1490856471597; Wed, 29 Mar 2017 23:47:51 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.24 with HTTP; Wed, 29 Mar 2017 23:47:51 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:519c:a6cb:84ea:e021] In-Reply-To: <6B63C559-C48C-4824-9D24-87FF89336FE4@gmail.com> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> <20170330165329.L1061@besplex.bde.org> <6B63C559-C48C-4824-9D24-87FF89336FE4@gmail.com> From: Warner Losh Date: Thu, 30 Mar 2017 00:47:51 -0600 X-Google-Sender-Auth: RhnSRUFu-wAbl6kuFjJ2EYyXKbg Message-ID: Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 To: "Ngie Cooper (yaneurabeya)" Cc: Bruce Evans , Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 06:47:52 -0000 On Thu, Mar 30, 2017 at 12:42 AM, Ngie Cooper (yaneurabeya) wrote: > >> On Mar 29, 2017, at 23:38, Warner Losh wrote: >> >> On Thu, Mar 30, 2017 at 12:23 AM, Bruce Evans wro= te: >>> I doubt that gcc-6.3 is very broken. Did its CFLAGS even have -Os? >> >> Yes. boot2 doesn't use the kernel CFLAGS. >> >>> Kernel CFLAGS are still broken even for gcc-4.2, by sprinkling inline >>> parameter magic that was more needed for gcc-3.3. The magic isn't >>> really right for gcc-4.2, and breaks -Os for kernels. >> >> There is different magic for boot2. >> >>> The magic might >>> be wronger for gcc-6.3, though it would be a compiler bug to not >>> just ignore it if it is nonsense. clang doesn't provide any control >>> over inlining AFAIK, but ignores gcc directive to limit it and does >>> too much. >> >> Yes. It does. Hence my glowing review of 6.3 :) But you are right. I'm >> likely being overly harsh without commanding enough facts to get past >> my preconceived notions... I don't know if this is a simple compiler >> bug, lack of proper options, or a need to do things differently. >> Latter day versions of gcc have many more knobs to turn here. I don't >> know yet if turning any of them will be helpful. I'm looking to >> automate the knob turning so that we can at least see which optimizer >> options have an effect on the size. I doubt more than half a dozen >> have any useful effect on the size, and finding the right combination >> likely will suffice. Or we wait for gcc 7 and hope for the best... >> >> But this is nothing new. gcc 5.4.0 has -504 bytes free. gcc 4.9.4 has >> the same. 4.8.5 has -472, etc. It's clear that the magic sweet spot >> we're in with the in-tree 4.2.1 compiler isn't the sweet spot for >> these compilers... Then again, clang generated bloated like this until >> we got boot2 into their test suit, and now we have 100 bytes to spare >> there. > > I know that a handful of people (several years ago) spent a lot of time m= aking clang work with boot2 and be under the limit. I=E2=80=99m not entirel= y sure, but we could have done similar things (but in more ominous ways in)= gcc 4.2.1 to shrink down the boot loader. We did. In fact, with every single new gcc release we did unnatural things. I did some of those things on many occasions. This is literally nothing new. We've been hacking gcc options, code layout and other things to get it to produce code < 7.5k for maybe 20 years in the project. Nobody has done more than compile with newer gcc's. It's broken there, but has been since at least 4.7, released several years ago. I'd be surprised if it worked on 4.3 or 4.4, but don't have the time to track those down :) Warner From owner-svn-src-all@freebsd.org Thu Mar 30 07:13:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC160D25ADC; Thu, 30 Mar 2017 07:13: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 C6B7F863; Thu, 30 Mar 2017 07: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 v2U7Dl18031241; Thu, 30 Mar 2017 07:13:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2U7Dl2x031240; Thu, 30 Mar 2017 07:13:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703300713.v2U7Dl2x031240@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 07:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316260 - head/contrib/netbsd-tests/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 07:13:49 -0000 Author: ngie Date: Thu Mar 30 07:13:47 2017 New Revision: 316260 URL: https://svnweb.freebsd.org/changeset/base/316260 Log: Annotate all changes made in r316178-r316180 with __FreeBSD__ Restore the stock (upstream) code under an #else block, so it's easier for me to visualize and understand the code that needs to be upstreamed. MFC after: 2 months X-MFC with: r316178, r316179, r316180 Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Thu Mar 30 06:55:43 2017 (r316259) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c Thu Mar 30 07:13:47 2017 (r316260) @@ -203,7 +203,11 @@ ATF_TC_BODY(msgctl_pid, tc) if (pid == 0) { +#ifdef __FreeBSD__ (void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); +#else + (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); +#endif _exit(EXIT_SUCCESS); } @@ -314,7 +318,11 @@ ATF_TC_BODY(msgctl_time, tc) t = time(NULL); (void)memset(&msgds, 0, sizeof(struct msqid_ds)); +#ifdef __FreeBSD__ (void)msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); +#else + (void)msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); +#endif (void)msgctl(id, IPC_STAT, &msgds); if (llabs(t - msgds.msg_stime) > 1) Modified: head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Thu Mar 30 06:55:43 2017 (r316259) +++ head/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c Thu Mar 30 07:13:47 2017 (r316260) @@ -98,7 +98,11 @@ ATF_TC_BODY(msgsnd_block, tc) */ for (;;) { +#ifdef __FreeBSD__ if (msgsnd(id, &msg, sizeof(msg.buf), 0) < 0) +#else + if (msgsnd(id, &msg, sizeof(struct msg), 0) < 0) +#endif _exit(EXIT_FAILURE); } } @@ -140,7 +144,11 @@ ATF_TC_BODY(msgsnd_count, tc) for (;;) { errno = 0; +#ifdef __FreeBSD__ rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); +#else + rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); +#endif if (rv == 0) { i++; @@ -184,12 +192,20 @@ ATF_TC_BODY(msgsnd_err, tc) errno = 0; ATF_REQUIRE_ERRNO(EFAULT, msgsnd(id, (void *)-1, +#ifdef __FreeBSD__ sizeof(msg.buf), IPC_NOWAIT) == -1); +#else + sizeof(struct msg), IPC_NOWAIT) == -1); +#endif errno = 0; ATF_REQUIRE_ERRNO(EINVAL, msgsnd(-1, &msg, +#ifdef __FreeBSD__ sizeof(msg.buf), IPC_NOWAIT) == -1); +#else + sizeof(struct msg), IPC_NOWAIT) == -1); +#endif errno = 0; @@ -200,7 +216,11 @@ ATF_TC_BODY(msgsnd_err, tc) msg.mtype = 0; ATF_REQUIRE_ERRNO(EINVAL, msgsnd(id, &msg, +#ifdef __FreeBSD__ sizeof(msg.buf), IPC_NOWAIT) == -1); +#else + sizeof(struct msg), IPC_NOWAIT) == -1); +#endif ATF_REQUIRE(msgctl(id, IPC_RMID, 0) == 0); } @@ -234,7 +254,11 @@ ATF_TC_BODY(msgsnd_nonblock, tc) for (;;) { errno = 0; +#ifdef __FreeBSD__ rv = msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT); +#else + rv = msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT); +#endif if (rv == -1 && errno == EAGAIN) _exit(EXIT_SUCCESS); @@ -299,7 +323,11 @@ ATF_TC_BODY(msgsnd_perm, tc) errno = 0; +#ifdef __FreeBSD__ if (msgsnd(id, &msg, sizeof(msg.buf), IPC_NOWAIT) == 0) +#else + if (msgsnd(id, &msg, sizeof(struct msg), IPC_NOWAIT) == 0) +#endif _exit(EXIT_FAILURE); if (errno != EACCES) From owner-svn-src-all@freebsd.org Thu Mar 30 07:37:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD9E8D25F98; Thu, 30 Mar 2017 07:37:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 7BFD768F; Thu, 30 Mar 2017 07:37:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id F116A1041BC1; Thu, 30 Mar 2017 18:37:09 +1100 (AEDT) Date: Thu, 30 Mar 2017 18:37:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , Poul-Henning Kamp , John Baldwin , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316132 - head/sys/boot/i386/boot2 In-Reply-To: Message-ID: <20170330180304.O1655@besplex.bde.org> References: <201703290930.v2T9U3x9087583@repo.freebsd.org> <7448826.asYms2TLO2@ralph.baldwin.cx> <46812.1490823365@critter.freebsd.dk> <20170330165329.L1061@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=wo_gB0BMNUXkYWCB1KEA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 07:37:18 -0000 On Thu, 30 Mar 2017, Warner Losh wrote: > On Thu, Mar 30, 2017 at 12:23 AM, Bruce Evans wrote: >> I doubt that gcc-6.3 is very broken. Did its CFLAGS even have -Os? > > Yes. boot2 doesn't use the kernel CFLAGS. I know. I even understand most of the magic. My point was that with all the ifdef obfuscations, the flags might not even have -Os. The bug report didn't say. It showed a large set of CFLAGS with -O2 for an unrelated part of the build. >> Kernel CFLAGS are still broken even for gcc-4.2, by sprinkling inline >> parameter magic that was more needed for gcc-3.3. The magic isn't >> really right for gcc-4.2, and breaks -Os for kernels. > > There is different magic for boot2. I know that even better. boot2 is better tuned to save space since this is necessary and possible, but to tune it has to use even more specific flags which are more likely to break. >> The magic might >> be wronger for gcc-6.3, though it would be a compiler bug to not >> just ignore it if it is nonsense. clang doesn't provide any control >> over inlining AFAIK, but ignores gcc directive to limit it and does >> too much. > > Yes. It does. Hence my glowing review of 6.3 :) But you are right. I'm > likely being overly harsh without commanding enough facts to get past > my preconceived notions... I don't know if this is a simple compiler > bug, lack of proper options, or a need to do things differently. > Latter day versions of gcc have many more knobs to turn here. I don't > know yet if turning any of them will be helpful. I'm looking to But -Os should just work to save maximal space. For inlining, this usually means not doing it. But always inline if the result is smaller. boot2 has some manual inlining (static inline...) which might be a (small) problem. It is meant to save space, but might do the opposite. > automate the knob turning so that we can at least see which optimizer > options have an effect on the size. I doubt more than half a dozen > have any useful effect on the size, and finding the right combination > likely will suffice. Or we wait for gcc 7 and hope for the best... I tried changing all of -fomit-frame-pointer, -mrtd and -mregparam a few years ago. They all help a little. -mrtd and -mregparam are then main things that boot2 uses that biosboot did't. I still use biosboot, updated for elf and EDD and with many fixes. The only special CFLAGS that it needs are -Os -fomit-frame-pointer. This works for both gcc-3.3 and gcc-4.2.1, with the latter producing a result 16 bytes smaller. Bruce From owner-svn-src-all@freebsd.org Thu Mar 30 07:53:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50164D25632; Thu, 30 Mar 2017 07:53:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBDC6969; Thu, 30 Mar 2017 07:53:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2U7rnBx054127 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 10:53:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2U7rnBx054127 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2U7rnqH054126; Thu, 30 Mar 2017 10:53:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 Mar 2017 10:53:49 +0300 From: Konstantin Belousov To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316213 - in head: include lib/libc/include lib/libc/stdlib lib/libc/string lib/libc/tests/stdlib lib/libc/tests/string sys/sys Message-ID: <20170330075349.GA43712@kib.kiev.ua> References: <201703300457.v2U4vQJw072106@repo.freebsd.org> <20170330050012.GW43712@kib.kiev.ua> <82479073-92cf-380c-5f4c-c33aa31bb1b3@FreeBSD.org> <20170330063422.GY43712@kib.kiev.ua> <75f47d21-1ab8-ce42-c9b7-902f4da74f02@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75f47d21-1ab8-ce42-c9b7-902f4da74f02@FreeBSD.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 07:53:54 -0000 On Thu, Mar 30, 2017 at 02:10:55AM -0500, Pedro Giffuni wrote: > The thing about the Annex K is that it is not used by anything AFAICT, > so I guess it would be considered bloat but with Microsoft being such > a good open-source citizen lately perhaps it will find uses in the > near future. If you have a complete implementation and it is as clean > as this piece looks I think I would not object towards bringing it to > base in lib/. Eventually I guess people may ask to bring it into libc > as compliance to standards is never bad. Apparently it is used by some commercial code, as Apple and Juniper examples demonstrate. It is not my implementation, I worked as somewhat experienced commit monkey there, only bringing the proposed patch up to the libc expectations. I have no plans on working on this stuff at all. From owner-svn-src-all@freebsd.org Thu Mar 30 08:22:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A64D2314B; Thu, 30 Mar 2017 08:22:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 159A1D89; Thu, 30 Mar 2017 08:22:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 3746046BBA; Thu, 30 Mar 2017 04:22:08 -0400 (EDT) Date: Thu, 30 Mar 2017 09:22:07 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316182 - in head/sys: compat/freebsd32 kern sys In-Reply-To: <20170330034857.GU43712@kib.kiev.ua> Message-ID: References: <201703292233.v2TMXvot015371@repo.freebsd.org> <20170330034857.GU43712@kib.kiev.ua> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 08:22:09 -0000 On Thu, 30 Mar 2017, Konstantin Belousov wrote: >> Hook up new audit event identifiers for various non-Orange Book/CAPP >> system calls supported by OpenBSM 1.2-alpha5. >> >> Obtained from: TrustedBSD Project >> MFC after: 3 weeks >> Sponsored by: DARPA, AFRL >> >> Modified: >> head/sys/compat/freebsd32/freebsd32_proto.h >> head/sys/compat/freebsd32/freebsd32_sysent.c >> head/sys/compat/freebsd32/syscalls.master >> head/sys/kern/init_sysent.c >> head/sys/kern/syscalls.master >> head/sys/sys/sysproto.h > > This was already discussed somewhere, might be the place was not public > enough. > > The change, as committed, is impossible to read. Please do not mix > human-made changes and generated files in one commit. For head it is no much > harm to split the syscalls.master commits in way it was always done, for > sake of the people reading either commit mails or VCS diffs. > > I have no opinion on the split/single commit on stable branches. Hi Kostik: My apologies -- I'm afriad I lost track of that convention during the merge. I have to say, though, that if we want to make changes easier to follow, the problem here is not so much generated files as poor formatting in generated files. Reading syscalls.master changes is always hard when multiple system calls are affected, due to the choice of putting all metadata for a system call on one line in the file. We could fix this in the generated files easily, though, by having the structs in init_sysent.c add carriage returns after each field assignment -- in which case the generated changes would make it easier to understand what was going on for multi-syscall commits, and help catch errors better. (I.e., by having the assignment of various system-call-related fields in the struct each appear on their own line.) At which point I suspect I'd generally prefer to see the commits combined. (The other reason we used to not combine commits related to generated $FreeBSD$ IDs in the files .. but that seems to have gone away. Robert From owner-svn-src-all@freebsd.org Thu Mar 30 08:36:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 08:46:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 09:02:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA484D22134; Thu, 30 Mar 2017 09:02:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 826ABCFD; Thu, 30 Mar 2017 09:02:51 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v2U92kM5069518 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 30 Mar 2017 12:02:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v2U92kM5069518 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v2U92koC069517; Thu, 30 Mar 2017 12:02:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 30 Mar 2017 12:02:46 +0300 From: Konstantin Belousov To: Robert Watson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316182 - in head/sys: compat/freebsd32 kern sys Message-ID: <20170330090246.GB43712@kib.kiev.ua> References: <201703292233.v2TMXvot015371@repo.freebsd.org> <20170330034857.GU43712@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 09:02:52 -0000 On Thu, Mar 30, 2017 at 09:22:07AM +0100, Robert Watson wrote: > On Thu, 30 Mar 2017, Konstantin Belousov wrote: > > >> Hook up new audit event identifiers for various non-Orange Book/CAPP > >> system calls supported by OpenBSM 1.2-alpha5. > >> > >> Obtained from: TrustedBSD Project > >> MFC after: 3 weeks > >> Sponsored by: DARPA, AFRL > >> > >> Modified: > >> head/sys/compat/freebsd32/freebsd32_proto.h > >> head/sys/compat/freebsd32/freebsd32_sysent.c > >> head/sys/compat/freebsd32/syscalls.master > >> head/sys/kern/init_sysent.c > >> head/sys/kern/syscalls.master > >> head/sys/sys/sysproto.h > > > > This was already discussed somewhere, might be the place was not public > > enough. > > > > The change, as committed, is impossible to read. Please do not mix > > human-made changes and generated files in one commit. For head it is no much > > harm to split the syscalls.master commits in way it was always done, for > > sake of the people reading either commit mails or VCS diffs. > > > > I have no opinion on the split/single commit on stable branches. > > Hi Kostik: > > My apologies -- I'm afriad I lost track of that convention during > the merge. I have to say, though, that if we want to make changes > easier to follow, the problem here is not so much generated files as > poor formatting in generated files. Reading syscalls.master changes > is always hard when multiple system calls are affected, due to the > choice of putting all metadata for a system call on one line in the > file. We could fix this in the generated files easily, though, by > having the structs in init_sysent.c add carriage returns after each > field assignment -- in which case the generated changes would make > it easier to understand what was going on for multi-syscall commits, > and help catch errors better. (I.e., by having the assignment of > various system-call-related fields in the struct each appear on their > own line.) At which point I suspect I'd generally prefer to see the > commits combined. (The other reason we used to not combine commits > related to generated $FreeBSD$ IDs in the files .. but that seems to > have gone away. The generated files diff would still be in the diff. Reading this diff only makes sense when a bug in makesyscalls.sh is looked for. So the diff still wastes the time of the reader, even if microoptimized to reduce the size. IMO the solution there is to start auto-generating the syscall tables from metadata, similarly to vnode_if.src. Of course, the complication there is that the generated files are needed for installincludes and libc/libthr build. Until this is done, I would prefer to have the generated files to not contaminate human-readable diff with auto-generated changes. From owner-svn-src-all@freebsd.org Thu Mar 30 12:35:57 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F8DD22640; Thu, 30 Mar 2017 12:35:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27229D8E; Thu, 30 Mar 2017 12:35:57 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UCZuMb060522; Thu, 30 Mar 2017 12:35:56 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UCZuBD060521; Thu, 30 Mar 2017 12:35:56 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703301235.v2UCZuBD060521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Thu, 30 Mar 2017 12:35:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316271 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 12:35:57 -0000 Author: rwatson Date: Thu Mar 30 12:35:56 2017 New Revision: 316271 URL: https://svnweb.freebsd.org/changeset/base/316271 Log: Don't ifdef KDTRACE_HOOKS struct, variable, and function prototype definitions for the DTrace audit provider, so that the dtaudit module can compile in the absence of kernel DTrace support. This doesn't really make run-time sense (since the binary dependencies for the module won't be present), but it allows the dtaudit module to compile successfully regardless of the kernel configuration. MFC after: 3 weeks Sponsored by: DARPA, AFRL Reported by: kib Modified: head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Thu Mar 30 08:43:56 2017 (r316270) +++ head/sys/security/audit/audit_private.h Thu Mar 30 12:35:56 2017 (r316271) @@ -327,9 +327,7 @@ struct kaudit_record { void *k_udata; /* User data. */ u_int k_ulen; /* User data length. */ struct uthread *k_uthread; /* Audited thread. */ -#ifdef KDTRACE_HOOKS void *k_dtaudit_state; -#endif TAILQ_ENTRY(kaudit_record) k_q; }; TAILQ_HEAD(kaudit_queue, kaudit_record); @@ -401,7 +399,6 @@ struct evname_elem { LIST_ENTRY(evname_elem) ene_entry; /* (m) */ struct mtx ene_lock; -#ifdef KDTRACE_HOOKS /* DTrace probe IDs; 0 if not yet registered. */ uint32_t ene_commit_probe_id; /* (M) */ uint32_t ene_bsm_probe_id; /* (M) */ @@ -409,7 +406,6 @@ struct evname_elem { /* Flags indicating if the probes enabled or not. */ int ene_commit_probe_enabled; /* (M) */ int ene_bsm_probe_enabled; /* (M) */ -#endif }; #define EVNAME_LOCK(ene) mtx_lock(&(ene)->ene_lock) @@ -424,7 +420,6 @@ typedef void (*au_evnamemap_callback_t)( * DTrace audit provider (dtaudit) hooks -- to be set non-NULL when the audit * provider is loaded and ready to be called into. */ -#ifdef KDTRACE_HOOKS extern void *(*dtaudit_hook_preselect)(au_id_t auid, au_event_t event, au_class_t class); extern int (*dtaudit_hook_commit)(struct kaudit_record *kar, @@ -433,7 +428,6 @@ extern int (*dtaudit_hook_commit)(struct extern void (*dtaudit_hook_bsm)(struct kaudit_record *kar, au_id_t auid, au_event_t event, au_class_t class, int sorf, void *bsm_data, size_t bsm_len); -#endif /* !KDTRACE_HOOKS */ #include #include @@ -457,9 +451,7 @@ au_class_t au_event_class(au_event_t ev void au_evnamemap_init(void); void au_evnamemap_insert(au_event_t event, const char *name); void au_evnamemap_foreach(au_evnamemap_callback_t callback); -#ifdef KDTRACE_HOOKS struct evname_elem *au_evnamemap_lookup(au_event_t event); -#endif int au_event_name(au_event_t event, char *name); au_event_t audit_ctlname_to_sysctlevent(int name[], uint64_t valid_arg); au_event_t audit_flags_and_error_to_openevent(int oflags, int error); From owner-svn-src-all@freebsd.org Thu Mar 30 12:41:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 12:51:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 14:20:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 15:05:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 148F0D249CE; Thu, 30 Mar 2017 15:05:12 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8346F7C; Thu, 30 Mar 2017 15:05:11 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UF5A80022675; Thu, 30 Mar 2017 15:05:10 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UF5Al6022672; Thu, 30 Mar 2017 15:05:10 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201703301505.v2UF5Al6022672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 30 Mar 2017 15:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316275 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 15:05:12 -0000 Author: n_hibma Date: Thu Mar 30 15:05:10 2017 New Revision: 316275 URL: https://svnweb.freebsd.org/changeset/base/316275 Log: Add nctgpio conf lines so it can be compiled into the kernel. MFC after: 2 days Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Thu Mar 30 14:20:27 2017 (r316274) +++ head/sys/conf/files.amd64 Thu Mar 30 15:05:10 2017 (r316275) @@ -324,6 +324,7 @@ dev/hyperv/vmbus/vmbus_if.m optional dev/hyperv/vmbus/vmbus_xact.c optional hyperv dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv +dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_transport.c optional if_ntb Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Thu Mar 30 14:20:27 2017 (r316274) +++ head/sys/conf/files.i386 Thu Mar 30 15:05:10 2017 (r316275) @@ -267,6 +267,7 @@ dev/ipmi/ipmi_linux.c optional ipmi com dev/le/if_le_isa.c optional le isa dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa +dev/nctgpio/nctgpio.c optional nctgpio dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb dev/ntb/ntb_transport.c optional if_ntb From owner-svn-src-all@freebsd.org Thu Mar 30 15:05:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 15:06:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 15:42:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60684D26B15 for ; Thu, 30 Mar 2017 15:42:55 +0000 (UTC) (envelope-from kongkhemara31@outlook.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-oln040092254060.outbound.protection.outlook.com [40.92.254.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D138E659 for ; Thu, 30 Mar 2017 15:42:54 +0000 (UTC) (envelope-from kongkhemara31@outlook.com) Received: from HK2APC01FT011.eop-APC01.prod.protection.outlook.com (10.152.248.60) by HK2APC01HT027.eop-APC01.prod.protection.outlook.com (10.152.249.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1005.5; Thu, 30 Mar 2017 15:42:52 +0000 Received: from KL1PR03MB1573.apcprd03.prod.outlook.com (10.152.248.60) by HK2APC01FT011.mail.protection.outlook.com (10.152.248.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.5 via Frontend Transport; Thu, 30 Mar 2017 15:42:51 +0000 Received: from KL1PR03MB1573.apcprd03.prod.outlook.com ([fe80::89ea:ec64:1d8b:fddc]) by KL1PR03MB1573.apcprd03.prod.outlook.com ([fe80::89ea:ec64:1d8b:fddc%14]) with mapi id 15.01.1005.014; Thu, 30 Mar 2017 15:42:51 +0000 From: kong khemara To: svn-src-all Subject: !!!! Greetings !!!! Thread-Topic: !!!! Greetings !!!! Thread-Index: AQHSqWxJp/nHCmFSlEq+saZ8A00MHQ== Date: Thu, 30 Mar 2017 15:42:51 +0000 Message-ID: Reply-To: "Mr. Kong Khemara" Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=outlook.com; x-incomingtopheadermarker: OriginalChecksum:A0255D7F5384E1F81481408DE93FA414CC6EBBA5C028A1BEF26D3CB7F96BAD9F; UpperCasedChecksum:E2F2A0187A21D0E2376F880015F1D0242ADBAF348535B23753E20B38335227CE; SizeAsReceived:7855; Count:39 x-ms-exchange-messagesentrepresentingtype: 1 x-microsoft-exchange-diagnostics: 1; HK2APC01HT027; 5:3dagGDAEuf9Q2uO/yLG63rppD3izlYaglIf0DslxKiVQhos840x+HutNvCVmiw6UW9NorQNEbCzyc7+CFOFZTG1WP3nuiFUzf6V0mneL6P3QAs+2Um88FmI05zgjKsmPZOHo6F+ZTjmRc8P5a+ItEw==; 24:e2DtNqyPE7/J5XBa11y44kNJ6rq1ssDiw9x27GBSncYMqeF0gLcfRIBw/P0pAZ1ReZHqH/MFwyE9718nnQyH1/fX39splbFKzCFT8/olIJU=; 7:YuxsMwPZJCkXCFDLLuB31o09qDt+Ud9NEOdiVYXzqJAAjAeLi8LdjFFgUATNznOC0qtXodqUItHrzvYMyACDx83htMNARzjOshznDFnzMRJZntlE8Q1eqlnwHUaoIezbXAT78htxOXrRlr4/ZS0Q3vxujv7pcbLH1DkFJJm+9+6Bek+T3P+Orjx1Yv6T3968SxS2eMiQzkmQsfr/nT/rSLSo4mbr1LfQShrciOJXijQ97INRKrzi6v9FwspzH3zgXjPzdc8L0yDLEDfe6hM27DD8A1pYL/rjct/8EAjdyxwsmJQFAM+sTqVWe8Pm8x2O x-incomingheadercount: 39 x-eopattributedmessage: 0 x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT; SFP:1901; SCL:1; SRVR:HK2APC01HT027; H:KL1PR03MB1573.apcprd03.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: 487fb70e-8bb2-4db5-76ac-08d47783686e x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031322274)(1601125374)(1603101448)(1701031045); SRVR:HK2APC01HT027; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(444000031); SRVR:HK2APC01HT027; BCL:0; PCL:0; RULEID:; SRVR:HK2APC01HT027; x-forefront-prvs: 02622CEF0A spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2017 15:42:51.4188 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2APC01HT027 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 15:42:55 -0000 SGVsbG8sDQpJIGFtIEJhcnIgS29uZyBLaGVtYXJhLCBJIGh1bWJseSBhc2sgaWYgeW91IGFyZSBy ZWxhdGVkIHRvIG15IGNsaWVudCB3aG8gZGllZCBjb3VwbGUgb2YNCnllYXJzIGFnbyBpbiBhIGNh ciBhY2NpZGVudCBoZXJlIGluIG15IGNvdW50cnkgQ2FtYm9kaWEuIEkgd2lzaCB0byBhbHNvIGlu cXVpcmUgaWYNCml0IGlzIHBvc3NpYmxlIHRvIGhhdmUgZGlmZmVyZW50IGZhbWlsaWVzIHdpdGgg dGhlIHNhbWUgbGFzdCBuYW1lIGFzIHlvdXJzIGJ5IGNvaW5jaWRlbmNlDQp3aG8gZG8gbm90IHNo YXJlIHRoZSBzYW1lIGNvbW1vbiByb290cz8gS2luZGx5IGdldCBiYWNrIHRvIG1lIGlmIHlvdXIg ZW1haWwgaXMgc3RpbGwNClZhbGlkIHRvIGVuYWJsZSBtZSBnaXZlIHlvdSB0aGUgZGV0YWlscyBv ZiBteSBtZXNzYWdlIG9yIG1ha2UgaGVhZHdheSBpbiBteSBzZWFyY2guDQpSZWdhcmRzLA0KS29u ZyBLaGVtYXJhDQo= From owner-svn-src-all@freebsd.org Thu Mar 30 16:03:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7139AD26324; Thu, 30 Mar 2017 16:03:52 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40E2B8CF; Thu, 30 Mar 2017 16:03:52 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UG3pgZ048542; Thu, 30 Mar 2017 16:03:51 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UG3pYD048541; Thu, 30 Mar 2017 16:03:51 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201703301603.v2UG3pYD048541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 30 Mar 2017 16:03:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316278 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 16:03:52 -0000 Author: sbruno Date: Thu Mar 30 16:03:51 2017 New Revision: 316278 URL: https://svnweb.freebsd.org/changeset/base/316278 Log: Assert IFF_DRV_OACTIVE in iflib_timer() when the "hung" case is detected so that iflib's admin task can still process the reset directive and restore functionality. Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Mar 30 15:05:58 2017 (r316277) +++ head/sys/net/iflib.c Thu Mar 30 16:03:51 2017 (r316278) @@ -2114,7 +2114,7 @@ iflib_timer(void *arg) return; hung: CTX_LOCK(ctx); - if_setdrvflagbits(ctx->ifc_ifp, 0, IFF_DRV_RUNNING); + if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING); device_printf(ctx->ifc_dev, "TX(%d) desc avail = %d, pidx = %d\n", txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx); @@ -3516,8 +3516,11 @@ _task_fn_admin(void *context) iflib_txq_t txq; int i; - if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) - return; + if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) { + if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) { + return; + } + } CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { From owner-svn-src-all@freebsd.org Thu Mar 30 16:23:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C9E3D268E5; Thu, 30 Mar 2017 16:23:33 +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 DB8D96CE; Thu, 30 Mar 2017 16:23:32 +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 v2UGNVnt056788; Thu, 30 Mar 2017 16:23:31 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UGNVuM056787; Thu, 30 Mar 2017 16:23:31 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201703301623.v2UGNVuM056787@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 16:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316279 - head/sys/boot/efi/libefi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 16:23:33 -0000 Author: tsoome Date: Thu Mar 30 16:23:31 2017 New Revision: 316279 URL: https://svnweb.freebsd.org/changeset/base/316279 Log: loader: efipart should check disk size from partition table While testing 32bit UEFI OVMF (which has bug about how the disk size is presented), I did witness the errors from blkio->ReadBlocks(). It became apparent we can not entirely trust UEFI interfaces either, so additional checks are needed. So we use disk_ioctl(DIOCGMEDIASIZE) for disks, with fallback of Media->LastBlock for other media. In addition, we need to check if there is media present. + small fixes for error printout, and avoiding multiple blk * 512. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D10197 Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Thu Mar 30 16:03:51 2017 (r316278) +++ head/sys/boot/efi/libefi/efipart.c Thu Mar 30 16:23:31 2017 (r316279) @@ -834,8 +834,10 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i return (ENOSYS); } - if (EFI_ERROR(status)) - printf("%s: rw=%d, status=%lu\n", __func__, rw, (u_long)status); + if (EFI_ERROR(status)) { + printf("%s: rw=%d, blk=%ju size=%ju status=%lu\n", __func__, rw, + blk, nblks, EFI_ERROR_CODE(status)); + } return (efi_status_to_errno(status)); } @@ -859,6 +861,10 @@ efipart_strategy(void *devdata, int rw, if (pd == NULL) return (EINVAL); + if (pd->pd_blkio->Media->RemovableMedia && + !pd->pd_blkio->Media->MediaPresent) + return (EIO); + bcd.dv_strategy = efipart_realstrategy; bcd.dv_devdata = devdata; bcd.dv_cache = pd->pd_bcache; @@ -878,7 +884,7 @@ efipart_realstrategy(void *devdata, int pdinfo_list_t *pdi; pdinfo_t *pd; EFI_BLOCK_IO *blkio; - off_t off; + uint64_t off, disk_blocks, d_offset = 0; char *blkbuf; size_t blkoff, blksz; int error; @@ -902,11 +908,24 @@ efipart_realstrategy(void *devdata, int return (EIO); off = blk * 512; + /* + * Get disk blocks, this value is either for whole disk or for + * partition. + */ + disk_blocks = 0; + if (dev->d_dev->dv_type == DEVT_DISK) { + if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks) == 0) { + /* DIOCGMEDIASIZE does return bytes. */ + disk_blocks /= blkio->Media->BlockSize; + } + d_offset = dev->d_offset; + } + if (disk_blocks == 0) + disk_blocks = blkio->Media->LastBlock + 1 - d_offset; + /* make sure we don't read past disk end */ - if ((off + size) / blkio->Media->BlockSize - 1 > - blkio->Media->LastBlock) { - size = blkio->Media->LastBlock + 1 - - off / blkio->Media->BlockSize; + if ((off + size) / blkio->Media->BlockSize > d_offset + disk_blocks) { + size = d_offset + disk_blocks - off / blkio->Media->BlockSize; size = size * blkio->Media->BlockSize; } @@ -914,9 +933,9 @@ efipart_realstrategy(void *devdata, int *rsize = size; if ((size % blkio->Media->BlockSize == 0) && - ((blk * 512) % blkio->Media->BlockSize == 0)) + (off % blkio->Media->BlockSize == 0)) return (efipart_readwrite(blkio, rw, - blk * 512 / blkio->Media->BlockSize, + off / blkio->Media->BlockSize, size / blkio->Media->BlockSize, buf)); /* From owner-svn-src-all@freebsd.org Thu Mar 30 16:31:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42257D26B2F; Thu, 30 Mar 2017 16:31:36 +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 1C785C71; Thu, 30 Mar 2017 16:31:36 +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 v2UGVZ2T060583; Thu, 30 Mar 2017 16:31:35 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UGVZhe060582; Thu, 30 Mar 2017 16:31:35 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201703301631.v2UGVZhe060582@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 16:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316280 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 16:31:36 -0000 Author: tsoome Date: Thu Mar 30 16:31:35 2017 New Revision: 316280 URL: https://svnweb.freebsd.org/changeset/base/316280 Log: loader: simplify efi_zfs_probe and avoid double probing for zfs. The current efi_zfs_probe() is overcomplicated and can be made simpler. Still we need to pick up the device handle for our boot disk first, because the ESP does not have to be the first partition on the disk. Once we do have the handle for boot disk, we probe that disk with pointer for pool GUID. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D10198 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Thu Mar 30 16:23:31 2017 (r316279) +++ head/sys/boot/efi/loader/main.c Thu Mar 30 16:31:35 2017 (r316280) @@ -796,66 +796,45 @@ COMMAND_SET(fdt, "fdt", "flattened devic #ifdef EFI_ZFS_BOOT static void -efipart_probe_img(pdinfo_list_t *hdi) +efi_zfs_probe(void) { + pdinfo_list_t *hdi; + pdinfo_t *hd, *pd = NULL; EFI_GUID imgid = LOADED_IMAGE_PROTOCOL; EFI_LOADED_IMAGE *img; - pdinfo_t *hd, *pd = NULL; + EFI_HANDLE boot_disk = NULL; char devname[SPECNAMELEN + 1]; + uint64_t *guidp = NULL; BS->HandleProtocol(IH, &imgid, (VOID**)&img); - /* - * Search for the booted image device handle from hard disk list. - * Note, this does also include usb sticks, and we assume there is no - * ZFS on floppies nor cd. - * However, we might have booted from floppy (unlikely) or CD, - * so we should not surprised if we can not find the handle. - */ + /* Find the handle for the boot disk. */ + hdi = efiblk_get_pdinfo_list(&efipart_hddev); STAILQ_FOREACH(hd, hdi, pd_link) { - if (hd->pd_handle == img->DeviceHandle) - break; STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { if (pd->pd_handle == img->DeviceHandle) - break; + boot_disk = hd->pd_handle; } - if (pd != NULL) - break; } - if (hd != NULL) { - if (pd != NULL) { - snprintf(devname, sizeof(devname), "%s%dp%d:", - efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); - } else { - snprintf(devname, sizeof(devname), "%s%d:", - efipart_hddev.dv_name, hd->pd_unit); - } - (void) zfs_probe_dev(devname, &pool_guid); - } -} -static void -efi_zfs_probe(void) -{ - pdinfo_list_t *hdi; - pdinfo_t *hd; - char devname[SPECNAMELEN + 1]; - - hdi = efiblk_get_pdinfo_list(&efipart_hddev); /* - * First probe the boot device (from where loader.efi was read), - * and set pool_guid global variable if we are booting from zfs. - * Since loader is running, we do have an access to the device, - * however, it might not be zfs. + * We provide non-NULL guid pointer if the disk was used for boot, + * and reset after the first found pool. + * Technically this solution is not very correct, we assume the boot + * pool is the first pool on this disk. */ - if (pool_guid == 0) - efipart_probe_img(hdi); - STAILQ_FOREACH(hd, hdi, pd_link) { - snprintf(devname, sizeof(devname), "%s%d:", - efipart_hddev.dv_name, hd->pd_unit); - (void) zfs_probe_dev(devname, NULL); + if (hd->pd_handle == boot_disk) + guidp = &pool_guid; + + STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { + snprintf(devname, sizeof(devname), "%s%dp%d:", + efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit); + (void) zfs_probe_dev(devname, guidp); + if (guidp != NULL && pool_guid != 0) + guidp = NULL; + } } } #endif From owner-svn-src-all@freebsd.org Thu Mar 30 16:54:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26510D26B57; Thu, 30 Mar 2017 16:54:03 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA1D4989; Thu, 30 Mar 2017 16:54:02 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UGs2Kp068837; Thu, 30 Mar 2017 16:54:02 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UGs2ZV068836; Thu, 30 Mar 2017 16:54:02 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201703301654.v2UGs2ZV068836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 30 Mar 2017 16:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316281 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 16:54:03 -0000 Author: sbruno Date: Thu Mar 30 16:54:01 2017 New Revision: 316281 URL: https://svnweb.freebsd.org/changeset/base/316281 Log: Don't call init functions directly from the timer/watchdog function. Enqueue this in the admin task now that it can process it. Submitted by: Matt Macy Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Mar 30 16:31:35 2017 (r316280) +++ head/sys/net/iflib.c Thu Mar 30 16:54:01 2017 (r316281) @@ -1441,15 +1441,17 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t driver_filter_t filter, driver_intr_t handler, void *arg, char *name) { - int rc; + int rc, flags; struct resource *res; - void *tag; + void *tag = NULL; device_t dev = ctx->ifc_dev; + flags = RF_ACTIVE; + if (ctx->ifc_flags & IFC_LEGACY) + flags |= RF_SHAREABLE; MPASS(rid < 512); irq->ii_rid = rid; - res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq->ii_rid, - RF_SHAREABLE | RF_ACTIVE); + res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irq->ii_rid, flags); if (res == NULL) { device_printf(dev, "failed to allocate IRQ for rid %d, name %s.\n", rid, name); @@ -2122,7 +2124,8 @@ hung: ctx->ifc_watchdog_events++; ctx->ifc_pause_frames = 0; - iflib_init_locked(ctx); + ctx->ifc_flags |= IFC_DO_RESET; + iflib_admin_intr_deferred(ctx); CTX_UNLOCK(ctx); } @@ -2600,7 +2603,7 @@ txq_max_rs_deferred(iflib_txq_t txq) return (notify_count >> 1); if (txq->ift_in_use > minthresh) return (notify_count >> 2); - return (notify_count >> 4); + return (2); } #define M_CSUM_FLAGS(m) ((m)->m_pkthdr.csum_flags) From owner-svn-src-all@freebsd.org Thu Mar 30 17:23:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 17:31:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A08BFD26BAC; Thu, 30 Mar 2017 17:31:13 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0A3E24; Thu, 30 Mar 2017 17:31:13 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UHVCq4082107; Thu, 30 Mar 2017 17:31:12 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UHVCLc082106; Thu, 30 Mar 2017 17:31:12 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201703301731.v2UHVCLc082106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 30 Mar 2017 17:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316283 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 17:31:13 -0000 Author: n_hibma Date: Thu Mar 30 17:31:12 2017 New Revision: 316283 URL: https://svnweb.freebsd.org/changeset/base/316283 Log: Allow superseding the lease renewal and rebind times. Also make sure that the renewal is never more than 1/2 * expiry and rebind never more than 7/4 * renewal (the default values in the spec). This should allow adjusting high values from the server as well as making sure the values from the server make sense. Renewal and rebind times will be adjusted down if the expiry time is set very high in a server, not the other way around. This change just makes sure the values keep making sense. Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Thu Mar 30 17:23:40 2017 (r316282) +++ head/sbin/dhclient/dhclient.c Thu Mar 30 17:31:12 2017 (r316283) @@ -769,21 +769,34 @@ dhcpack(struct packet *packet) if (ip->client->new->expiry < 60) ip->client->new->expiry = 60; - /* Take the server-provided renewal time if there is one; - otherwise figure it out according to the spec. */ - if (ip->client->new->options[DHO_DHCP_RENEWAL_TIME].len) + /* Unless overridden in the config, take the server-provided renewal + * time if there is one; otherwise figure it out according to the spec. + * Also make sure the renewal time does not exceed the expiry time. + */ + if (ip->client->config->default_actions[DHO_DHCP_RENEWAL_TIME] == + ACTION_SUPERSEDE) + ip->client->new->renewal = getULong( + ip->client->config->defaults[DHO_DHCP_RENEWAL_TIME].data); + else if (ip->client->new->options[DHO_DHCP_RENEWAL_TIME].len) ip->client->new->renewal = getULong( ip->client->new->options[DHO_DHCP_RENEWAL_TIME].data); else ip->client->new->renewal = ip->client->new->expiry / 2; + if (ip->client->new->renewal > ip->client->new->expiry / 2) + ip->client->new->renewal = ip->client->new->expiry / 2; /* Same deal with the rebind time. */ - if (ip->client->new->options[DHO_DHCP_REBINDING_TIME].len) + if (ip->client->config->default_actions[DHO_DHCP_REBINDING_TIME] == + ACTION_SUPERSEDE) + ip->client->new->rebind = getULong( + ip->client->config->defaults[DHO_DHCP_REBINDING_TIME].data); + else if (ip->client->new->options[DHO_DHCP_REBINDING_TIME].len) ip->client->new->rebind = getULong( ip->client->new->options[DHO_DHCP_REBINDING_TIME].data); else - ip->client->new->rebind = ip->client->new->renewal + - ip->client->new->renewal / 2 + ip->client->new->renewal / 4; + ip->client->new->rebind = ip->client->new->renewal * 7 / 4; + if (ip->client->new->rebind > ip->client->new->renewal * 7 / 4) + ip->client->new->rebind = ip->client->new->renewal * 7 / 4; ip->client->new->expiry += cur_time; /* Lease lengths can never be negative. */ From owner-svn-src-all@freebsd.org Thu Mar 30 17:37:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778A2D26E6B; Thu, 30 Mar 2017 17:37:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447FA308; Thu, 30 Mar 2017 17:37:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UHbCQh085445; Thu, 30 Mar 2017 17:37:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UHbCkX085444; Thu, 30 Mar 2017 17:37:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201703301737.v2UHbCkX085444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 30 Mar 2017 17:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316284 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 17:37:13 -0000 Author: emaste Date: Thu Mar 30 17:37:12 2017 New Revision: 316284 URL: https://svnweb.freebsd.org/changeset/base/316284 Log: elfcopy: remove temporary ELF file when converting from binary Previously a command like objcopy --input-target binary --output-target elf64-x86-64-freebsd \ binary_file object.o would leave a temporary file behind. ELF Tool Chain ticket #543 Reported by: Roger Marquis MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/main.c Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Thu Mar 30 17:31:12 2017 (r316283) +++ head/contrib/elftoolchain/elfcopy/main.c Thu Mar 30 17:37:12 2017 (r316284) @@ -674,6 +674,8 @@ create_file(struct elfcopy *ecp, const c if ((ifd = open(elftemp, O_RDONLY)) == -1) err(EXIT_FAILURE, "open %s failed", src); close(efd); + if (unlink(elftemp) < 0) + err(EXIT_FAILURE, "unlink %s failed", elftemp); free(elftemp); } From owner-svn-src-all@freebsd.org Thu Mar 30 17:57:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 18:20:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B032D26E9D; Thu, 30 Mar 2017 18:20:05 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB40934; Thu, 30 Mar 2017 18:20:05 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UIK4mX001578; Thu, 30 Mar 2017 18:20:04 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UIK416001577; Thu, 30 Mar 2017 18:20:04 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201703301820.v2UIK416001577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 30 Mar 2017 18:20:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316285 - head/sbin/dhclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 18:20:05 -0000 Author: n_hibma Date: Thu Mar 30 18:20:04 2017 New Revision: 316285 URL: https://svnweb.freebsd.org/changeset/base/316285 Log: Make dhcp-lease-time option supersedable as well. Note: It is not recommended to set this value to above the value that the server provided, unless that value is bogus. Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Thu Mar 30 17:37:12 2017 (r316284) +++ head/sbin/dhclient/dhclient.c Thu Mar 30 18:20:04 2017 (r316285) @@ -756,7 +756,11 @@ dhcpack(struct packet *packet) cancel_timeout(send_request, ip); /* Figure out the lease time. */ - if (ip->client->new->options[DHO_DHCP_LEASE_TIME].data) + if (ip->client->config->default_actions[DHO_DHCP_LEASE_TIME] == + ACTION_SUPERSEDE) + ip->client->new->expiry = getULong( + ip->client->config->defaults[DHO_DHCP_LEASE_TIME].data); + else if (ip->client->new->options[DHO_DHCP_LEASE_TIME].data) ip->client->new->expiry = getULong( ip->client->new->options[DHO_DHCP_LEASE_TIME].data); else From owner-svn-src-all@freebsd.org Thu Mar 30 18:21:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0EF0D26FA3; Thu, 30 Mar 2017 18:21:39 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EF00D3C; Thu, 30 Mar 2017 18:21:39 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UILclK005152; Thu, 30 Mar 2017 18:21:38 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UILbYW005136; Thu, 30 Mar 2017 18:21:37 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201703301821.v2UILbYW005136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 30 Mar 2017 18:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316286 - in head: lib/libprocstat sys/kern sys/sys usr.bin/gcore usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 18:21:39 -0000 Author: tychon Date: Thu Mar 30 18:21:36 2017 New Revision: 316286 URL: https://svnweb.freebsd.org/changeset/base/316286 Log: Add support for capturing 'struct ptrace_lwpinfo' for signals resulting in a process dumping core in the corefile. Also extend procstat to view select members of 'struct ptrace_lwpinfo' from the contents of the note. Sponsored by: Dell EMC Isilon Added: head/usr.bin/procstat/procstat_ptlwpinfo.c (contents, props changed) Modified: head/lib/libprocstat/Symbol.map head/lib/libprocstat/core.c head/lib/libprocstat/core.h head/lib/libprocstat/libprocstat.c head/lib/libprocstat/libprocstat.h head/sys/kern/imgact_elf.c head/sys/kern/kern_sig.c head/sys/kern/sys_process.c head/sys/sys/elf_common.h head/sys/sys/proc.h head/usr.bin/gcore/elfcore.c head/usr.bin/procstat/Makefile head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h Modified: head/lib/libprocstat/Symbol.map ============================================================================== --- head/lib/libprocstat/Symbol.map Thu Mar 30 18:20:04 2017 (r316285) +++ head/lib/libprocstat/Symbol.map Thu Mar 30 18:21:36 2017 (r316286) @@ -36,3 +36,8 @@ FBSD_1.3 { procstat_getvmmap; procstat_open_core; }; + +FBSD_1.5 { + procstat_freeptlwpinfo; + procstat_getptlwpinfo; +}; Modified: head/lib/libprocstat/core.c ============================================================================== --- head/lib/libprocstat/core.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/lib/libprocstat/core.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Mikolaj Golub + * Copyright (c) 2017 Dell EMC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -56,6 +58,24 @@ struct procstat_core GElf_Phdr pc_phdr; }; +static struct psc_type_info { + unsigned int n_type; + int structsize; +} psc_type_info[PSC_TYPE_MAX] = { + { .n_type = NT_PROCSTAT_PROC, .structsize = sizeof(struct kinfo_proc) }, + { .n_type = NT_PROCSTAT_FILES, .structsize = sizeof(struct kinfo_file) }, + { .n_type = NT_PROCSTAT_VMMAP, .structsize = sizeof(struct kinfo_vmentry) }, + { .n_type = NT_PROCSTAT_GROUPS, .structsize = sizeof(gid_t) }, + { .n_type = NT_PROCSTAT_UMASK, .structsize = sizeof(u_short) }, + { .n_type = NT_PROCSTAT_RLIMIT, .structsize = sizeof(struct rlimit) * RLIM_NLIMITS }, + { .n_type = NT_PROCSTAT_OSREL, .structsize = sizeof(int) }, + { .n_type = NT_PROCSTAT_PSSTRINGS, .structsize = sizeof(vm_offset_t) }, + { .n_type = NT_PROCSTAT_PSSTRINGS, .structsize = sizeof(vm_offset_t) }, + { .n_type = NT_PROCSTAT_PSSTRINGS, .structsize = sizeof(vm_offset_t) }, + { .n_type = NT_PROCSTAT_AUXV, .structsize = sizeof(Elf_Auxinfo) }, + { .n_type = NT_PTLWPINFO, .structsize = sizeof(struct ptrace_lwpinfo) }, +}; + static bool core_offset(struct procstat_core *core, off_t offset); static bool core_read(struct procstat_core *core, void *buf, size_t len); static ssize_t core_read_mem(struct procstat_core *core, void *buf, @@ -154,59 +174,20 @@ procstat_core_get(struct procstat_core * off_t offset, eoffset; vm_offset_t psstrings; void *freebuf; - size_t len; - u_int32_t n_type; - int cstructsize, structsize; + size_t len, curlen; + int cstructsize; char nbuf[8]; assert(core->pc_magic == PROCSTAT_CORE_MAGIC); - switch(type) { - case PSC_TYPE_PROC: - n_type = NT_PROCSTAT_PROC; - structsize = sizeof(struct kinfo_proc); - break; - case PSC_TYPE_FILES: - n_type = NT_PROCSTAT_FILES; - structsize = sizeof(struct kinfo_file); - break; - case PSC_TYPE_VMMAP: - n_type = NT_PROCSTAT_VMMAP; - structsize = sizeof(struct kinfo_vmentry); - break; - case PSC_TYPE_GROUPS: - n_type = NT_PROCSTAT_GROUPS; - structsize = sizeof(gid_t); - break; - case PSC_TYPE_UMASK: - n_type = NT_PROCSTAT_UMASK; - structsize = sizeof(u_short); - break; - case PSC_TYPE_RLIMIT: - n_type = NT_PROCSTAT_RLIMIT; - structsize = sizeof(struct rlimit) * RLIM_NLIMITS; - break; - case PSC_TYPE_OSREL: - n_type = NT_PROCSTAT_OSREL; - structsize = sizeof(int); - break; - case PSC_TYPE_PSSTRINGS: - case PSC_TYPE_ARGV: - case PSC_TYPE_ENVV: - n_type = NT_PROCSTAT_PSSTRINGS; - structsize = sizeof(vm_offset_t); - break; - case PSC_TYPE_AUXV: - n_type = NT_PROCSTAT_AUXV; - structsize = sizeof(Elf_Auxinfo); - break; - default: + if (type >= PSC_TYPE_MAX) { warnx("unknown core stat type: %d", type); return (NULL); } offset = core->pc_phdr.p_offset; eoffset = offset + core->pc_phdr.p_filesz; + curlen = 0; while (offset < eoffset) { if (!core_offset(core, offset)) @@ -220,7 +201,7 @@ procstat_core_get(struct procstat_core * if (nhdr.n_namesz == 0 && nhdr.n_descsz == 0) break; - if (nhdr.n_type != n_type) + if (nhdr.n_type != psc_type_info[type].n_type) continue; if (nhdr.n_namesz != 8) continue; @@ -234,7 +215,7 @@ procstat_core_get(struct procstat_core * } if (!core_read(core, &cstructsize, sizeof(cstructsize))) return (NULL); - if (cstructsize != structsize) { + if (cstructsize != psc_type_info[type].structsize) { warnx("version mismatch"); return (NULL); } @@ -251,7 +232,7 @@ procstat_core_get(struct procstat_core * return (NULL); } } - if (!core_read(core, buf, len)) { + if (!core_read(core, (char *)buf + curlen, len)) { free(freebuf); return (NULL); } @@ -267,11 +248,20 @@ procstat_core_get(struct procstat_core * buf = NULL; free(freebuf); buf = get_args(core, psstrings, type, buf, &len); + } else if (type == PSC_TYPE_PTLWPINFO) { + *lenp -= len; + curlen += len; + continue; } *lenp = len; return (buf); } + if (curlen != 0) { + *lenp = curlen; + return (buf); + } + return (NULL); } @@ -431,3 +421,57 @@ done: free(argv); return (args); } + +int +procstat_core_note_count(struct procstat_core *core, enum psc_type type) +{ + Elf_Note nhdr; + off_t offset, eoffset; + int cstructsize; + char nbuf[8]; + int n; + + if (type >= PSC_TYPE_MAX) { + warnx("unknown core stat type: %d", type); + return (0); + } + + offset = core->pc_phdr.p_offset; + eoffset = offset + core->pc_phdr.p_filesz; + + for (n = 0; offset < eoffset; n++) { + if (!core_offset(core, offset)) + return (0); + if (!core_read(core, &nhdr, sizeof(nhdr))) + return (0); + + offset += sizeof(nhdr) + + roundup2(nhdr.n_namesz, sizeof(Elf32_Size)) + + roundup2(nhdr.n_descsz, sizeof(Elf32_Size)); + + if (nhdr.n_namesz == 0 && nhdr.n_descsz == 0) + break; + if (nhdr.n_type != psc_type_info[type].n_type) + continue; + if (nhdr.n_namesz != 8) + continue; + if (!core_read(core, nbuf, sizeof(nbuf))) + return (0); + if (strcmp(nbuf, "FreeBSD") != 0) + continue; + if (nhdr.n_descsz < sizeof(cstructsize)) { + warnx("corrupted core file"); + return (0); + } + if (!core_read(core, &cstructsize, sizeof(cstructsize))) + return (0); + if (cstructsize != psc_type_info[type].structsize) { + warnx("version mismatch"); + return (0); + } + if (nhdr.n_descsz - sizeof(cstructsize) == 0) + return (0); + } + + return (n); +} Modified: head/lib/libprocstat/core.h ============================================================================== --- head/lib/libprocstat/core.h Thu Mar 30 18:20:04 2017 (r316285) +++ head/lib/libprocstat/core.h Thu Mar 30 18:21:36 2017 (r316286) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Mikolaj Golub + * Copyright (c) 2017 Dell EMC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,6 +42,8 @@ enum psc_type { PSC_TYPE_ARGV, PSC_TYPE_ENVV, PSC_TYPE_AUXV, + PSC_TYPE_PTLWPINFO, + PSC_TYPE_MAX }; struct procstat_core; @@ -48,6 +51,7 @@ struct procstat_core; void procstat_core_close(struct procstat_core *core); void *procstat_core_get(struct procstat_core *core, enum psc_type type, void * buf, size_t *lenp); +int procstat_core_note_count(struct procstat_core *core, enum psc_type type); struct procstat_core *procstat_core_open(const char *filename); #endif /* !_CORE_H_ */ Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/lib/libprocstat/libprocstat.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 Dell EMC * Copyright (c) 2009 Stanislav Sedov * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. @@ -65,6 +66,7 @@ __FBSDID("$FreeBSD$"); #define _KERNEL #include #include +#include #include #include #include @@ -2470,6 +2472,48 @@ procstat_freeauxv(struct procstat *procs free(auxv); } +static struct ptrace_lwpinfo * +procstat_getptlwpinfo_core(struct procstat_core *core, unsigned int *cntp) +{ + void *buf; + struct ptrace_lwpinfo *pl; + unsigned int cnt; + size_t len; + + cnt = procstat_core_note_count(core, PSC_TYPE_PTLWPINFO); + if (cnt == 0) + return (NULL); + + len = cnt * sizeof(*pl); + buf = calloc(1, len); + pl = procstat_core_get(core, PSC_TYPE_PTLWPINFO, buf, &len); + if (pl == NULL) { + free(buf); + return (NULL); + } + *cntp = len / sizeof(*pl); + return (pl); +} + +struct ptrace_lwpinfo * +procstat_getptlwpinfo(struct procstat *procstat, unsigned int *cntp) +{ + switch (procstat->type) { + case PROCSTAT_CORE: + return (procstat_getptlwpinfo_core(procstat->core, cntp)); + default: + warnx("unknown access method: %d", procstat->type); + return (NULL); + } +} + +void +procstat_freeptlwpinfo(struct procstat *procstat __unused, + struct ptrace_lwpinfo *pl) +{ + free(pl); +} + static struct kinfo_kstack * procstat_getkstack_sysctl(pid_t pid, int *cntp) { Modified: head/lib/libprocstat/libprocstat.h ============================================================================== --- head/lib/libprocstat/libprocstat.h Thu Mar 30 18:20:04 2017 (r316285) +++ head/lib/libprocstat/libprocstat.h Thu Mar 30 18:21:36 2017 (r316286) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009 Stanislav Sedov + * Copyright (c) 2017 Dell EMC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -101,6 +102,7 @@ struct kinfo_kstack; struct kinfo_vmentry; struct procstat; +struct ptrace_lwpinfo; struct rlimit; struct filestat { int fs_type; /* Descriptor type. */ @@ -172,6 +174,8 @@ void procstat_freekstack(struct procstat void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc *p); void procstat_freefiles(struct procstat *procstat, struct filestat_list *head); +void procstat_freeptlwpinfo(struct procstat *procstat, + struct ptrace_lwpinfo *pl); void procstat_freevmmap(struct procstat *procstat, struct kinfo_vmentry *vmmap); struct filestat_list *procstat_getfiles(struct procstat *procstat, @@ -196,6 +200,8 @@ char **procstat_getargv(struct procstat Elf_Auxinfo *procstat_getauxv(struct procstat *procstat, struct kinfo_proc *kp, unsigned int *cntp); #endif +struct ptrace_lwpinfo *procstat_getptlwpinfo(struct procstat *procstat, + unsigned int *cntp); char **procstat_getenvv(struct procstat *procstat, struct kinfo_proc *p, size_t nchr); gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc *kp, Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/sys/kern/imgact_elf.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 Dell EMC * Copyright (c) 2000 David O'Brien * Copyright (c) 1995-1996 Søren Schmidt * Copyright (c) 1996 Peter Wemm @@ -52,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1202,6 +1204,7 @@ static void __elfN(note_prpsinfo)(void * static void __elfN(note_prstatus)(void *, struct sbuf *, size_t *); static void __elfN(note_threadmd)(void *, struct sbuf *, size_t *); static void __elfN(note_thrmisc)(void *, struct sbuf *, size_t *); +static void __elfN(note_ptlwpinfo)(void *, struct sbuf *, size_t *); static void __elfN(note_procstat_auxv)(void *, struct sbuf *, size_t *); static void __elfN(note_procstat_proc)(void *, struct sbuf *, size_t *); static void __elfN(note_procstat_psstrings)(void *, struct sbuf *, size_t *); @@ -1628,6 +1631,8 @@ __elfN(prepare_notes)(struct thread *td, __elfN(note_fpregset), thr); size += register_note(list, NT_THRMISC, __elfN(note_thrmisc), thr); + size += register_note(list, NT_PTLWPINFO, + __elfN(note_ptlwpinfo), thr); size += register_note(list, -1, __elfN(note_threadmd), thr); @@ -2018,6 +2023,37 @@ __elfN(note_thrmisc)(void *arg, struct s *sizep = sizeof(thrmisc); } +static void +__elfN(note_ptlwpinfo)(void *arg, struct sbuf *sb, size_t *sizep) +{ + struct thread *td; + size_t size; + int structsize; + struct ptrace_lwpinfo pl; + + td = (struct thread *)arg; + size = sizeof(structsize) + sizeof(struct ptrace_lwpinfo); + if (sb != NULL) { + KASSERT(*sizep == size, ("invalid size")); + structsize = sizeof(struct ptrace_lwpinfo); + sbuf_bcat(sb, &structsize, sizeof(structsize)); + bzero(&pl, sizeof(pl)); + pl.pl_lwpid = td->td_tid; + pl.pl_event = PL_EVENT_NONE; + pl.pl_sigmask = td->td_sigmask; + pl.pl_siglist = td->td_siglist; + if (td->td_si.si_signo != 0) { + pl.pl_event = PL_EVENT_SIGNAL; + pl.pl_flags |= PL_FLAG_SI; + pl.pl_siginfo = td->td_si; + } + strcpy(pl.pl_tdname, td->td_name); + /* XXX TODO: supply more information in struct ptrace_lwpinfo*/ + sbuf_bcat(sb, &pl, sizeof(struct ptrace_lwpinfo)); + } + *sizep = size; +} + /* * Allow for MD specific notes, as well as any MD * specific preparations for writing MI notes. Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/sys/kern/kern_sig.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1226,6 +1226,19 @@ sys_sigwaitinfo(struct thread *td, struc return (error); } +static void +proc_td_siginfo_capture(struct thread *td, siginfo_t *si) +{ + struct thread *thr; + + FOREACH_THREAD_IN_PROC(td->td_proc, thr) { + if (thr == td) + thr->td_si = *si; + else + thr->td_si.si_signo = 0; + } +} + int kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, struct timespec *timeout) @@ -1334,8 +1347,10 @@ kern_sigtimedwait(struct thread *td, sig ktrpsig(sig, action, &td->td_sigmask, ksi->ksi_code); } #endif - if (sig == SIGKILL) + if (sig == SIGKILL) { + proc_td_siginfo_capture(td, &ksi->ksi_info); sigexit(td, sig); + } } PROC_UNLOCK(p); return (error); @@ -2756,6 +2771,7 @@ issignal(struct thread *td) struct sigqueue *queue; sigset_t sigpending; int sig, prop; + ksiginfo_t ksi; p = td->td_proc; ps = p->p_sigacts; @@ -2811,14 +2827,15 @@ issignal(struct thread *td) * be thrown away. */ queue = &td->td_sigqueue; - td->td_dbgksi.ksi_signo = 0; - if (sigqueue_get(queue, sig, &td->td_dbgksi) == 0) { + ksiginfo_init(&ksi); + if (sigqueue_get(queue, sig, &ksi) == 0) { queue = &p->p_sigqueue; - sigqueue_get(queue, sig, &td->td_dbgksi); + sigqueue_get(queue, sig, &ksi); } + td->td_si = ksi.ksi_info; mtx_unlock(&ps->ps_mtx); - sig = ptracestop(td, sig, &td->td_dbgksi); + sig = ptracestop(td, sig, &ksi); mtx_lock(&ps->ps_mtx); /* @@ -2989,6 +3006,7 @@ postsig(sig) * the process. (Other cases were ignored above.) */ mtx_unlock(&ps->ps_mtx); + proc_td_siginfo_capture(td, &ksi.ksi_info); sigexit(td, sig); /* NOTREACHED */ } else { Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/sys/kern/sys_process.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1306,7 +1306,7 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags = 0; if (td2->td_dbgflags & TDB_XSIG) { pl->pl_event = PL_EVENT_SIGNAL; - if (td2->td_dbgksi.ksi_signo != 0 && + if (td2->td_si.si_signo != 0 && #ifdef COMPAT_FREEBSD32 ((!wrap32 && data >= offsetof(struct ptrace_lwpinfo, pl_siginfo) + sizeof(pl->pl_siginfo)) || @@ -1318,7 +1318,7 @@ kern_ptrace(struct thread *td, int req, #endif ){ pl->pl_flags |= PL_FLAG_SI; - pl->pl_siginfo = td2->td_dbgksi.ksi_info; + pl->pl_siginfo = td2->td_si; } } if ((pl->pl_flags & PL_FLAG_SI) == 0) Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Thu Mar 30 18:20:04 2017 (r316285) +++ head/sys/sys/elf_common.h Thu Mar 30 18:21:36 2017 (r316286) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 Dell EMC * Copyright (c) 2000, 2001, 2008, 2011, David E. O'Brien * Copyright (c) 1998 John D. Polstra. * All rights reserved. @@ -753,6 +754,7 @@ typedef struct { #define NT_PROCSTAT_OSREL 14 /* Procstat osreldate data. */ #define NT_PROCSTAT_PSSTRINGS 15 /* Procstat ps_strings data. */ #define NT_PROCSTAT_AUXV 16 /* Procstat auxv data. */ +#define NT_PTLWPINFO 17 /* Thread ptrace miscellaneous info. */ #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ #define NT_X86_XSTATE 0x202 /* x86 XSAVE extended state. */ Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Mar 30 18:20:04 2017 (r316285) +++ head/sys/sys/proc.h Thu Mar 30 18:21:36 2017 (r316286) @@ -274,7 +274,7 @@ struct thread { char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ struct file *td_fpop; /* (k) file referencing cdev under op */ int td_dbgflags; /* (c) Userland debugger flags */ - struct ksiginfo td_dbgksi; /* (c) ksi reflected to debugger. */ + siginfo_t td_si; /* (c) For debugger or core file */ int td_ng_outbound; /* (k) Thread entered ng from above. */ struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/usr.bin/gcore/elfcore.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 Dell EMC * Copyright (c) 2007 Sandvine Incorporated * Copyright (c) 1998 John D. Polstra * All rights reserved. @@ -102,6 +103,7 @@ static void *elf_note_fpregset(void *, s static void *elf_note_prpsinfo(void *, size_t *); static void *elf_note_prstatus(void *, size_t *); static void *elf_note_thrmisc(void *, size_t *); +static void *elf_note_ptlwpinfo(void *, size_t *); #if defined(__i386__) || defined(__amd64__) static void *elf_note_x86_xstate(void *, size_t *); #endif @@ -360,6 +362,7 @@ elf_putnotes(pid_t pid, struct sbuf *sb, elf_putnote(NT_PRSTATUS, elf_note_prstatus, tids + i, sb); elf_putnote(NT_FPREGSET, elf_note_fpregset, tids + i, sb); elf_putnote(NT_THRMISC, elf_note_thrmisc, tids + i, sb); + elf_putnote(NT_PTLWPINFO, elf_note_ptlwpinfo, tids + i, sb); #if defined(__i386__) || defined(__amd64__) elf_putnote(NT_X86_XSTATE, elf_note_x86_xstate, tids + i, sb); #endif @@ -689,6 +692,24 @@ elf_note_thrmisc(void *arg, size_t *size return (thrmisc); } +static void * +elf_note_ptlwpinfo(void *arg, size_t *sizep) +{ + lwpid_t tid; + void *p; + + tid = *(lwpid_t *)arg; + p = calloc(1, sizeof(int) + sizeof(struct ptrace_lwpinfo)); + if (p == NULL) + errx(1, "out of memory"); + *(int *)p = sizeof(struct ptrace_lwpinfo); + ptrace(PT_LWPINFO, tid, + (char *)p + sizeof (int), sizeof(struct ptrace_lwpinfo)); + + *sizep = sizeof(int) + sizeof(struct ptrace_lwpinfo); + return (p); +} + #if defined(__i386__) || defined(__amd64__) static void * elf_note_x86_xstate(void *arg, size_t *sizep) Modified: head/usr.bin/procstat/Makefile ============================================================================== --- head/usr.bin/procstat/Makefile Thu Mar 30 18:20:04 2017 (r316285) +++ head/usr.bin/procstat/Makefile Thu Mar 30 18:21:36 2017 (r316286) @@ -11,6 +11,7 @@ SRCS= procstat.c \ procstat_cs.c \ procstat_files.c \ procstat_kstack.c \ + procstat_ptlwpinfo.c \ procstat_rlimit.c \ procstat_rusage.c \ procstat_sigs.c \ Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Thu Mar 30 18:20:04 2017 (r316285) +++ head/usr.bin/procstat/procstat.1 Thu Mar 30 18:21:36 2017 (r316286) @@ -36,7 +36,7 @@ .Op Fl -libxo .Op Fl CHhn .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | r | s | S | t | v | x +.Op Fl b | c | e | f | i | j | k | l | L | r | s | S | t | v | x .Op Fl a | Ar pid | Ar core ... .Sh DESCRIPTION The @@ -79,6 +79,8 @@ If the flag is repeated, function offset printed. .It Fl l Display resource limits for the process. +.It Fl L +Display LWP info for the process pertaining to it's signal driven exit. .It Fl r Display resource usage information for the process. .It Fl s Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Thu Mar 30 18:20:04 2017 (r316285) +++ head/usr.bin/procstat/procstat.c Thu Mar 30 18:21:36 2017 (r316286) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2007, 2011 Robert N. M. Watson * Copyright (c) 2015 Allan Jude + * Copyright (c) 2017 Dell EMC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,8 +42,8 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, lflag, rflag; -static int sflag, tflag, vflag, xflag, Sflag; +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag; +static int lflag, Lflag, rflag, sflag, tflag, vflag, xflag, Sflag; int hflag, nflag, Cflag, Hflag; static void @@ -84,6 +85,8 @@ procstat(struct procstat *prstat, struct procstat_kstack(prstat, kipp, kflag); else if (lflag) procstat_rlimit(prstat, kipp); + else if (Lflag) + procstat_ptlwpinfo(prstat); else if (rflag) procstat_rusage(prstat, kipp); else if (sflag) @@ -161,7 +164,7 @@ main(int argc, char *argv[]) argc = xo_parse_args(argc, argv); xocontainer = "basic"; - while ((ch = getopt(argc, argv, "CHN:M:abcefijklhrsStvw:x")) != -1) { + while ((ch = getopt(argc, argv, "CHN:M:abcefijklLhrsStvw:x")) != -1) { switch (ch) { case 'C': Cflag++; @@ -225,6 +228,11 @@ main(int argc, char *argv[]) xocontainer = "rlimit"; break; + case 'L': + Lflag++; + xocontainer = "ptlwpinfo"; + break; + case 'n': nflag++; break; Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Thu Mar 30 18:20:04 2017 (r316285) +++ head/usr.bin/procstat/procstat.h Thu Mar 30 18:21:36 2017 (r316286) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2007 Robert N. M. Watson * Copyright (c) 2015 Allan Jude + * Copyright (c) 2017 Dell EMC * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,6 +51,7 @@ void procstat_env(struct procstat *prsta void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, int kflag); +void procstat_ptlwpinfo(struct procstat *prstat); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rusage(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Added: head/usr.bin/procstat/procstat_ptlwpinfo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/procstat/procstat_ptlwpinfo.c Thu Mar 30 18:21:36 2017 (r316286) @@ -0,0 +1,91 @@ +/*- + * Copyright (c) 2017 Dell EMC + * 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 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 "procstat.h" + +void +procstat_ptlwpinfo(struct procstat *prstat) +{ + struct ptrace_lwpinfo *pl; + unsigned int count, i; + + pl = procstat_getptlwpinfo(prstat, &count); + if (pl == NULL) + return; + + if (!hflag) + xo_emit("{:/%6s %7s %5s %5s %5s %6s %5s} {[:/%d}{:/%s}{]:}" + " {:/%s}\n", + "LWPID", "EVENT", "SIGNO", "CODE", "ERRNO", "PID", "UID", + 2 * sizeof(void *) + 2, "ADDR", "TDNAME"); + + for (i = 0; i < count; i++) { + xo_emit("{:lpwid/%6d} ", pl[i].pl_lwpid); + switch (pl[i].pl_event) { + case PL_EVENT_NONE: + xo_emit("{eq:event/none}{d:event/%7s} ", "none"); + break; + case PL_EVENT_SIGNAL: + xo_emit("{eq:event/signal}{d:event/%7s} ", "signal"); + break; + default: + xo_emit("{eq:event/unknown}{d:event/%7s} ", "?"); + break; + } + if ((pl[i].pl_flags & PL_FLAG_SI) != 0) { + siginfo_t *si; + + si = &pl[i].pl_siginfo; + xo_emit("{:signal_number/%5d} ", si->si_signo); + xo_emit("{:code/%5d} ", si->si_code); + xo_emit("{:signal_errno/%5d} ", si->si_errno); + xo_emit("{:process_id/%6d} ", si->si_pid); + xo_emit("{:user_id/%5d} ", si->si_uid); + xo_emit("{[:/%d}{:address/%p}{]:} ", + 2 * sizeof(void *) + 2, si->si_addr); + } else { + xo_emit("{:signal_number/%5s} ", "-"); + xo_emit("{:code/%5s} ", "-"); + xo_emit("{:signal_errno/%5s} ", "-"); + xo_emit("{:process_id/%6s} ", "-"); + xo_emit("{:user_id/%5s} ", "-"); + xo_emit("{[:/%d}{:address/%s}{]:} ", + 2 * sizeof(void *) + 2, "-"); + } + xo_emit("{:tdname/%s}\n", pl[i].pl_tdname); + } + + procstat_freeptlwpinfo(prstat, pl); +} From owner-svn-src-all@freebsd.org Thu Mar 30 18:33:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06877D264AD; Thu, 30 Mar 2017 18:33:53 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from sasl.smtp.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE11E874; Thu, 30 Mar 2017 18:33:52 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id F41DC6D524; Thu, 30 Mar 2017 14:28:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from :content-type:content-transfer-encoding:mime-version:subject :date:references:to:in-reply-to:message-id; s=sasl; bh=PnJvfuVw9 SZlhJDxM97LGDxKU0c=; b=FgMFkrC50Kiz5netB60webjPqfvPt4Yy92xI1s71Q po+xxj1YwzVzMgCVKHlEtp0iI46HDvpYz8HqHczs5oZuJaEGFZZhIDfobjp9g5xm KFb3sKVmPZj58BemJ4tJ3acpAyyEmLSMAzoA99RmPdKbdePljL4TQIo6MCooonxv yk= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id EB9EC6D522; Thu, 30 Mar 2017 14:28:50 -0400 (EDT) Received: from [10.0.1.10] (unknown [209.6.121.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 322FE6D51F; Thu, 30 Mar 2017 14:28:50 -0400 (EDT) From: Tycho Nightingale Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r316286 - in head: lib/libprocstat sys/kern sys/sys usr.bin/gcore usr.bin/procstat Date: Thu, 30 Mar 2017 14:28:49 -0400 References: <201703301821.v2UILbYW005136@repo.freebsd.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <201703301821.v2UILbYW005136@repo.freebsd.org> Message-Id: X-Mailer: Apple Mail (2.3273) X-Pobox-Relay-ID: B873139C-1576-11E7-A407-FC50AE2156B6-09779102!pb-smtp2.pobox.com X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 18:33:53 -0000 Additionally: Differential Revision: https://reviews.freebsd.org/D9995 Tycho > On Mar 30, 2017, at 2:21 PM, Tycho Nightingale = wrote: >=20 > Author: tychon > Date: Thu Mar 30 18:21:36 2017 > New Revision: 316286 > URL: https://svnweb.freebsd.org/changeset/base/316286 >=20 > Log: > Add support for capturing 'struct ptrace_lwpinfo' for signals > resulting in a process dumping core in the corefile. >=20 > Also extend procstat to view select members of 'struct = ptrace_lwpinfo' > from the contents of the note. >=20 > Sponsored by: Dell EMC Isilon >=20 > Added: > head/usr.bin/procstat/procstat_ptlwpinfo.c (contents, props = changed) > Modified: > head/lib/libprocstat/Symbol.map > head/lib/libprocstat/core.c > head/lib/libprocstat/core.h > head/lib/libprocstat/libprocstat.c > head/lib/libprocstat/libprocstat.h > head/sys/kern/imgact_elf.c > head/sys/kern/kern_sig.c > head/sys/kern/sys_process.c > head/sys/sys/elf_common.h > head/sys/sys/proc.h > head/usr.bin/gcore/elfcore.c > head/usr.bin/procstat/Makefile > head/usr.bin/procstat/procstat.1 > head/usr.bin/procstat/procstat.c > head/usr.bin/procstat/procstat.h >=20 > Modified: head/lib/libprocstat/Symbol.map > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libprocstat/Symbol.map Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/lib/libprocstat/Symbol.map Thu Mar 30 18:21:36 2017 = (r316286) > @@ -36,3 +36,8 @@ FBSD_1.3 { > procstat_getvmmap; > procstat_open_core; > }; > + > +FBSD_1.5 { > + procstat_freeptlwpinfo; > + procstat_getptlwpinfo; > +}; >=20 > Modified: head/lib/libprocstat/core.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libprocstat/core.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/lib/libprocstat/core.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2013 Mikolaj Golub > + * Copyright (c) 2017 Dell EMC > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -30,6 +31,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include >=20 > #include > @@ -56,6 +58,24 @@ struct procstat_core > GElf_Phdr pc_phdr; > }; >=20 > +static struct psc_type_info { > + unsigned int n_type; > + int structsize; > +} psc_type_info[PSC_TYPE_MAX] =3D { > + { .n_type =3D NT_PROCSTAT_PROC, .structsize =3D sizeof(struct = kinfo_proc) }, > + { .n_type =3D NT_PROCSTAT_FILES, .structsize =3D sizeof(struct = kinfo_file) }, > + { .n_type =3D NT_PROCSTAT_VMMAP, .structsize =3D sizeof(struct = kinfo_vmentry) }, > + { .n_type =3D NT_PROCSTAT_GROUPS, .structsize =3D sizeof(gid_t) = }, > + { .n_type =3D NT_PROCSTAT_UMASK, .structsize =3D sizeof(u_short) = }, > + { .n_type =3D NT_PROCSTAT_RLIMIT, .structsize =3D sizeof(struct = rlimit) * RLIM_NLIMITS }, > + { .n_type =3D NT_PROCSTAT_OSREL, .structsize =3D sizeof(int) }, > + { .n_type =3D NT_PROCSTAT_PSSTRINGS, .structsize =3D = sizeof(vm_offset_t) }, > + { .n_type =3D NT_PROCSTAT_PSSTRINGS, .structsize =3D = sizeof(vm_offset_t) }, > + { .n_type =3D NT_PROCSTAT_PSSTRINGS, .structsize =3D = sizeof(vm_offset_t) }, > + { .n_type =3D NT_PROCSTAT_AUXV, .structsize =3D = sizeof(Elf_Auxinfo) }, > + { .n_type =3D NT_PTLWPINFO, .structsize =3D sizeof(struct = ptrace_lwpinfo) }, > +}; > + > static bool core_offset(struct procstat_core *core, off_t offset); > static bool core_read(struct procstat_core *core, void *buf, size_t = len); > static ssize_t core_read_mem(struct procstat_core *core, void = *buf, > @@ -154,59 +174,20 @@ procstat_core_get(struct procstat_core * > off_t offset, eoffset; > vm_offset_t psstrings; > void *freebuf; > - size_t len; > - u_int32_t n_type; > - int cstructsize, structsize; > + size_t len, curlen; > + int cstructsize; > char nbuf[8]; >=20 > assert(core->pc_magic =3D=3D PROCSTAT_CORE_MAGIC); >=20 > - switch(type) { > - case PSC_TYPE_PROC: > - n_type =3D NT_PROCSTAT_PROC; > - structsize =3D sizeof(struct kinfo_proc); > - break; > - case PSC_TYPE_FILES: > - n_type =3D NT_PROCSTAT_FILES; > - structsize =3D sizeof(struct kinfo_file); > - break; > - case PSC_TYPE_VMMAP: > - n_type =3D NT_PROCSTAT_VMMAP; > - structsize =3D sizeof(struct kinfo_vmentry); > - break; > - case PSC_TYPE_GROUPS: > - n_type =3D NT_PROCSTAT_GROUPS; > - structsize =3D sizeof(gid_t); > - break; > - case PSC_TYPE_UMASK: > - n_type =3D NT_PROCSTAT_UMASK; > - structsize =3D sizeof(u_short); > - break; > - case PSC_TYPE_RLIMIT: > - n_type =3D NT_PROCSTAT_RLIMIT; > - structsize =3D sizeof(struct rlimit) * RLIM_NLIMITS; > - break; > - case PSC_TYPE_OSREL: > - n_type =3D NT_PROCSTAT_OSREL; > - structsize =3D sizeof(int); > - break; > - case PSC_TYPE_PSSTRINGS: > - case PSC_TYPE_ARGV: > - case PSC_TYPE_ENVV: > - n_type =3D NT_PROCSTAT_PSSTRINGS; > - structsize =3D sizeof(vm_offset_t); > - break; > - case PSC_TYPE_AUXV: > - n_type =3D NT_PROCSTAT_AUXV; > - structsize =3D sizeof(Elf_Auxinfo); > - break; > - default: > + if (type >=3D PSC_TYPE_MAX) { > warnx("unknown core stat type: %d", type); > return (NULL); > } >=20 > offset =3D core->pc_phdr.p_offset; > eoffset =3D offset + core->pc_phdr.p_filesz; > + curlen =3D 0; >=20 > while (offset < eoffset) { > if (!core_offset(core, offset)) > @@ -220,7 +201,7 @@ procstat_core_get(struct procstat_core * >=20 > if (nhdr.n_namesz =3D=3D 0 && nhdr.n_descsz =3D=3D 0) > break; > - if (nhdr.n_type !=3D n_type) > + if (nhdr.n_type !=3D psc_type_info[type].n_type) > continue; > if (nhdr.n_namesz !=3D 8) > continue; > @@ -234,7 +215,7 @@ procstat_core_get(struct procstat_core * > } > if (!core_read(core, &cstructsize, sizeof(cstructsize))) > return (NULL); > - if (cstructsize !=3D structsize) { > + if (cstructsize !=3D psc_type_info[type].structsize) { > warnx("version mismatch"); > return (NULL); > } > @@ -251,7 +232,7 @@ procstat_core_get(struct procstat_core * > return (NULL); > } > } > - if (!core_read(core, buf, len)) { > + if (!core_read(core, (char *)buf + curlen, len)) { > free(freebuf); > return (NULL); > } > @@ -267,11 +248,20 @@ procstat_core_get(struct procstat_core * > buf =3D NULL; > free(freebuf); > buf =3D get_args(core, psstrings, type, buf, = &len); > + } else if (type =3D=3D PSC_TYPE_PTLWPINFO) { > + *lenp -=3D len; > + curlen +=3D len; > + continue; > } > *lenp =3D len; > return (buf); > } >=20 > + if (curlen !=3D 0) { > + *lenp =3D curlen; > + return (buf); > + } > + > return (NULL); > } >=20 > @@ -431,3 +421,57 @@ done: > free(argv); > return (args); > } > + > +int > +procstat_core_note_count(struct procstat_core *core, enum psc_type = type) > +{ > + Elf_Note nhdr; > + off_t offset, eoffset; > + int cstructsize; > + char nbuf[8]; > + int n; > + > + if (type >=3D PSC_TYPE_MAX) { > + warnx("unknown core stat type: %d", type); > + return (0); > + } > + > + offset =3D core->pc_phdr.p_offset; > + eoffset =3D offset + core->pc_phdr.p_filesz; > + > + for (n =3D 0; offset < eoffset; n++) { > + if (!core_offset(core, offset)) > + return (0); > + if (!core_read(core, &nhdr, sizeof(nhdr))) > + return (0); > + > + offset +=3D sizeof(nhdr) + > + roundup2(nhdr.n_namesz, sizeof(Elf32_Size)) + > + roundup2(nhdr.n_descsz, sizeof(Elf32_Size)); > + > + if (nhdr.n_namesz =3D=3D 0 && nhdr.n_descsz =3D=3D 0) > + break; > + if (nhdr.n_type !=3D psc_type_info[type].n_type) > + continue; > + if (nhdr.n_namesz !=3D 8) > + continue; > + if (!core_read(core, nbuf, sizeof(nbuf))) > + return (0); > + if (strcmp(nbuf, "FreeBSD") !=3D 0) > + continue; > + if (nhdr.n_descsz < sizeof(cstructsize)) { > + warnx("corrupted core file"); > + return (0); > + } > + if (!core_read(core, &cstructsize, sizeof(cstructsize))) > + return (0); > + if (cstructsize !=3D psc_type_info[type].structsize) { > + warnx("version mismatch"); > + return (0); > + } > + if (nhdr.n_descsz - sizeof(cstructsize) =3D=3D 0) > + return (0); > + } > + > + return (n); > +} >=20 > Modified: head/lib/libprocstat/core.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libprocstat/core.h Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/lib/libprocstat/core.h Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2013 Mikolaj Golub > + * Copyright (c) 2017 Dell EMC > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -41,6 +42,8 @@ enum psc_type { > PSC_TYPE_ARGV, > PSC_TYPE_ENVV, > PSC_TYPE_AUXV, > + PSC_TYPE_PTLWPINFO, > + PSC_TYPE_MAX > }; >=20 > struct procstat_core; > @@ -48,6 +51,7 @@ struct procstat_core; > void procstat_core_close(struct procstat_core *core); > void *procstat_core_get(struct procstat_core *core, enum psc_type = type, > void * buf, size_t *lenp); > +int procstat_core_note_count(struct procstat_core *core, enum = psc_type type); > struct procstat_core *procstat_core_open(const char *filename); >=20 > #endif /* !_CORE_H_ */ >=20 > Modified: head/lib/libprocstat/libprocstat.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libprocstat/libprocstat.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/lib/libprocstat/libprocstat.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,4 +1,5 @@ > /*- > + * Copyright (c) 2017 Dell EMC > * Copyright (c) 2009 Stanislav Sedov > * Copyright (c) 1988, 1993 > * The Regents of the University of California. All rights = reserved. > @@ -65,6 +66,7 @@ __FBSDID("$FreeBSD$"); > #define _KERNEL > #include > #include > +#include > #include > #include > #include > @@ -2470,6 +2472,48 @@ procstat_freeauxv(struct procstat *procs > free(auxv); > } >=20 > +static struct ptrace_lwpinfo * > +procstat_getptlwpinfo_core(struct procstat_core *core, unsigned int = *cntp) > +{ > + void *buf; > + struct ptrace_lwpinfo *pl; > + unsigned int cnt; > + size_t len; > + > + cnt =3D procstat_core_note_count(core, PSC_TYPE_PTLWPINFO); > + if (cnt =3D=3D 0) > + return (NULL); > + > + len =3D cnt * sizeof(*pl); > + buf =3D calloc(1, len); > + pl =3D procstat_core_get(core, PSC_TYPE_PTLWPINFO, buf, &len); > + if (pl =3D=3D NULL) { > + free(buf); > + return (NULL); > + } > + *cntp =3D len / sizeof(*pl); > + return (pl); > +} > + > +struct ptrace_lwpinfo * > +procstat_getptlwpinfo(struct procstat *procstat, unsigned int *cntp) > +{ > + switch (procstat->type) { > + case PROCSTAT_CORE: > + return (procstat_getptlwpinfo_core(procstat->core, = cntp)); > + default: > + warnx("unknown access method: %d", procstat->type); > + return (NULL); > + } > +} > + > +void > +procstat_freeptlwpinfo(struct procstat *procstat __unused, > + struct ptrace_lwpinfo *pl) > +{ > + free(pl); > +} > + > static struct kinfo_kstack * > procstat_getkstack_sysctl(pid_t pid, int *cntp) > { >=20 > Modified: head/lib/libprocstat/libprocstat.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/lib/libprocstat/libprocstat.h Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/lib/libprocstat/libprocstat.h Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2009 Stanislav Sedov > + * Copyright (c) 2017 Dell EMC > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -101,6 +102,7 @@ > struct kinfo_kstack; > struct kinfo_vmentry; > struct procstat; > +struct ptrace_lwpinfo; > struct rlimit; > struct filestat { > int fs_type; /* Descriptor type. */ > @@ -172,6 +174,8 @@ void procstat_freekstack(struct procstat > void procstat_freeprocs(struct procstat *procstat, struct kinfo_proc = *p); > void procstat_freefiles(struct procstat *procstat, > struct filestat_list *head); > +void procstat_freeptlwpinfo(struct procstat *procstat, > + struct ptrace_lwpinfo *pl); > void procstat_freevmmap(struct procstat *procstat, > struct kinfo_vmentry *vmmap); > struct filestat_list *procstat_getfiles(struct procstat *procstat, > @@ -196,6 +200,8 @@ char **procstat_getargv(struct procstat=20 > Elf_Auxinfo *procstat_getauxv(struct procstat *procstat, > struct kinfo_proc *kp, unsigned int *cntp); > #endif > +struct ptrace_lwpinfo *procstat_getptlwpinfo(struct procstat = *procstat, > + unsigned int *cntp); > char **procstat_getenvv(struct procstat *procstat, struct kinfo_proc = *p, > size_t nchr); > gid_t *procstat_getgroups(struct procstat *procstat, struct kinfo_proc = *kp, >=20 > Modified: head/sys/kern/imgact_elf.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/imgact_elf.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/sys/kern/imgact_elf.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,4 +1,5 @@ > /*- > + * Copyright (c) 2017 Dell EMC > * Copyright (c) 2000 David O'Brien > * Copyright (c) 1995-1996 S=C3=B8ren Schmidt > * Copyright (c) 1996 Peter Wemm > @@ -52,6 +53,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -1202,6 +1204,7 @@ static void __elfN(note_prpsinfo)(void * > static void __elfN(note_prstatus)(void *, struct sbuf *, size_t *); > static void __elfN(note_threadmd)(void *, struct sbuf *, size_t *); > static void __elfN(note_thrmisc)(void *, struct sbuf *, size_t *); > +static void __elfN(note_ptlwpinfo)(void *, struct sbuf *, size_t *); > static void __elfN(note_procstat_auxv)(void *, struct sbuf *, size_t = *); > static void __elfN(note_procstat_proc)(void *, struct sbuf *, size_t = *); > static void __elfN(note_procstat_psstrings)(void *, struct sbuf *, = size_t *); > @@ -1628,6 +1631,8 @@ __elfN(prepare_notes)(struct thread *td, > __elfN(note_fpregset), thr); > size +=3D register_note(list, NT_THRMISC, > __elfN(note_thrmisc), thr); > + size +=3D register_note(list, NT_PTLWPINFO, > + __elfN(note_ptlwpinfo), thr); > size +=3D register_note(list, -1, > __elfN(note_threadmd), thr); >=20 > @@ -2018,6 +2023,37 @@ __elfN(note_thrmisc)(void *arg, struct s > *sizep =3D sizeof(thrmisc); > } >=20 > +static void > +__elfN(note_ptlwpinfo)(void *arg, struct sbuf *sb, size_t *sizep) > +{ > + struct thread *td; > + size_t size; > + int structsize; > + struct ptrace_lwpinfo pl; > + > + td =3D (struct thread *)arg; > + size =3D sizeof(structsize) + sizeof(struct ptrace_lwpinfo); > + if (sb !=3D NULL) { > + KASSERT(*sizep =3D=3D size, ("invalid size")); > + structsize =3D sizeof(struct ptrace_lwpinfo); > + sbuf_bcat(sb, &structsize, sizeof(structsize)); > + bzero(&pl, sizeof(pl)); > + pl.pl_lwpid =3D td->td_tid; > + pl.pl_event =3D PL_EVENT_NONE; > + pl.pl_sigmask =3D td->td_sigmask; > + pl.pl_siglist =3D td->td_siglist; > + if (td->td_si.si_signo !=3D 0) { > + pl.pl_event =3D PL_EVENT_SIGNAL; > + pl.pl_flags |=3D PL_FLAG_SI; > + pl.pl_siginfo =3D td->td_si; > + } > + strcpy(pl.pl_tdname, td->td_name); > + /* XXX TODO: supply more information in struct = ptrace_lwpinfo*/ > + sbuf_bcat(sb, &pl, sizeof(struct ptrace_lwpinfo)); > + } > + *sizep =3D size; > +} > + > /* > * Allow for MD specific notes, as well as any MD > * specific preparations for writing MI notes. >=20 > Modified: head/sys/kern/kern_sig.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/kern_sig.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/sys/kern/kern_sig.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1226,6 +1226,19 @@ sys_sigwaitinfo(struct thread *td, struc > return (error); > } >=20 > +static void > +proc_td_siginfo_capture(struct thread *td, siginfo_t *si) > +{ > + struct thread *thr; > + > + FOREACH_THREAD_IN_PROC(td->td_proc, thr) { > + if (thr =3D=3D td) > + thr->td_si =3D *si; > + else > + thr->td_si.si_signo =3D 0; > + } > +} > + > int > kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t = *ksi, > struct timespec *timeout) > @@ -1334,8 +1347,10 @@ kern_sigtimedwait(struct thread *td, sig > ktrpsig(sig, action, &td->td_sigmask, = ksi->ksi_code); > } > #endif > - if (sig =3D=3D SIGKILL) > + if (sig =3D=3D SIGKILL) { > + proc_td_siginfo_capture(td, &ksi->ksi_info); > sigexit(td, sig); > + } > } > PROC_UNLOCK(p); > return (error); > @@ -2756,6 +2771,7 @@ issignal(struct thread *td) > struct sigqueue *queue; > sigset_t sigpending; > int sig, prop; > + ksiginfo_t ksi; >=20 > p =3D td->td_proc; > ps =3D p->p_sigacts; > @@ -2811,14 +2827,15 @@ issignal(struct thread *td) > * be thrown away. > */ > queue =3D &td->td_sigqueue; > - td->td_dbgksi.ksi_signo =3D 0; > - if (sigqueue_get(queue, sig, &td->td_dbgksi) =3D=3D= 0) { > + ksiginfo_init(&ksi); > + if (sigqueue_get(queue, sig, &ksi) =3D=3D 0) { > queue =3D &p->p_sigqueue; > - sigqueue_get(queue, sig, = &td->td_dbgksi); > + sigqueue_get(queue, sig, &ksi); > } > + td->td_si =3D ksi.ksi_info; >=20 > mtx_unlock(&ps->ps_mtx); > - sig =3D ptracestop(td, sig, &td->td_dbgksi); > + sig =3D ptracestop(td, sig, &ksi); > mtx_lock(&ps->ps_mtx); >=20 > /*=20 > @@ -2989,6 +3006,7 @@ postsig(sig) > * the process. (Other cases were ignored above.) > */ > mtx_unlock(&ps->ps_mtx); > + proc_td_siginfo_capture(td, &ksi.ksi_info); > sigexit(td, sig); > /* NOTREACHED */ > } else { >=20 > Modified: head/sys/kern/sys_process.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/sys_process.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/sys/kern/sys_process.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1306,7 +1306,7 @@ kern_ptrace(struct thread *td, int req,=20 > pl->pl_flags =3D 0; > if (td2->td_dbgflags & TDB_XSIG) { > pl->pl_event =3D PL_EVENT_SIGNAL; > - if (td2->td_dbgksi.ksi_signo !=3D 0 && > + if (td2->td_si.si_signo !=3D 0 && > #ifdef COMPAT_FREEBSD32 > ((!wrap32 && data >=3D offsetof(struct = ptrace_lwpinfo, > pl_siginfo) + sizeof(pl->pl_siginfo)) || > @@ -1318,7 +1318,7 @@ kern_ptrace(struct thread *td, int req,=20 > #endif > ){ > pl->pl_flags |=3D PL_FLAG_SI; > - pl->pl_siginfo =3D = td2->td_dbgksi.ksi_info; > + pl->pl_siginfo =3D td2->td_si; > } > } > if ((pl->pl_flags & PL_FLAG_SI) =3D=3D 0) >=20 > Modified: head/sys/sys/elf_common.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/sys/elf_common.h Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/sys/sys/elf_common.h Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,4 +1,5 @@ > /*- > + * Copyright (c) 2017 Dell EMC > * Copyright (c) 2000, 2001, 2008, 2011, David E. O'Brien > * Copyright (c) 1998 John D. Polstra. > * All rights reserved. > @@ -753,6 +754,7 @@ typedef struct { > #define NT_PROCSTAT_OSREL 14 /* Procstat osreldate = data. */ > #define NT_PROCSTAT_PSSTRINGS 15 /* Procstat ps_strings = data. */ > #define NT_PROCSTAT_AUXV 16 /* Procstat auxv data. = */ > +#define NT_PTLWPINFO 17 /* Thread ptrace = miscellaneous info. */ > #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers = */ > #define NT_X86_XSTATE 0x202 /* x86 XSAVE extended state. */ >=20 >=20 > Modified: head/sys/sys/proc.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/sys/proc.h Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/sys/sys/proc.h Thu Mar 30 18:21:36 2017 = (r316286) > @@ -274,7 +274,7 @@ struct thread { > char td_name[MAXCOMLEN + 1]; /* (*) Thread name. */ > struct file *td_fpop; /* (k) file referencing cdev = under op */ > int td_dbgflags; /* (c) Userland debugger flags = */ > - struct ksiginfo td_dbgksi; /* (c) ksi reflected to = debugger. */ > + siginfo_t td_si; /* (c) For debugger or core file = */ > int td_ng_outbound; /* (k) Thread entered ng from = above. */ > struct osd td_osd; /* (k) Object specific data. */ > struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. = */ >=20 > Modified: head/usr.bin/gcore/elfcore.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/gcore/elfcore.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/usr.bin/gcore/elfcore.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,4 +1,5 @@ > /*- > + * Copyright (c) 2017 Dell EMC > * Copyright (c) 2007 Sandvine Incorporated > * Copyright (c) 1998 John D. Polstra > * All rights reserved. > @@ -102,6 +103,7 @@ static void *elf_note_fpregset(void *, s > static void *elf_note_prpsinfo(void *, size_t *); > static void *elf_note_prstatus(void *, size_t *); > static void *elf_note_thrmisc(void *, size_t *); > +static void *elf_note_ptlwpinfo(void *, size_t *); > #if defined(__i386__) || defined(__amd64__) > static void *elf_note_x86_xstate(void *, size_t *); > #endif > @@ -360,6 +362,7 @@ elf_putnotes(pid_t pid, struct sbuf *sb, > elf_putnote(NT_PRSTATUS, elf_note_prstatus, tids + i, = sb); > elf_putnote(NT_FPREGSET, elf_note_fpregset, tids + i, = sb); > elf_putnote(NT_THRMISC, elf_note_thrmisc, tids + i, sb); > + elf_putnote(NT_PTLWPINFO, elf_note_ptlwpinfo, tids + i, = sb); > #if defined(__i386__) || defined(__amd64__) > elf_putnote(NT_X86_XSTATE, elf_note_x86_xstate, tids + = i, sb); > #endif > @@ -689,6 +692,24 @@ elf_note_thrmisc(void *arg, size_t *size > return (thrmisc); > } >=20 > +static void * > +elf_note_ptlwpinfo(void *arg, size_t *sizep) > +{ > + lwpid_t tid; > + void *p; > + > + tid =3D *(lwpid_t *)arg; > + p =3D calloc(1, sizeof(int) + sizeof(struct ptrace_lwpinfo)); > + if (p =3D=3D NULL) > + errx(1, "out of memory"); > + *(int *)p =3D sizeof(struct ptrace_lwpinfo); > + ptrace(PT_LWPINFO, tid, > + (char *)p + sizeof (int), sizeof(struct ptrace_lwpinfo)); > + > + *sizep =3D sizeof(int) + sizeof(struct ptrace_lwpinfo); > + return (p); > +} > + > #if defined(__i386__) || defined(__amd64__) > static void * > elf_note_x86_xstate(void *arg, size_t *sizep) >=20 > Modified: head/usr.bin/procstat/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/procstat/Makefile Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/usr.bin/procstat/Makefile Thu Mar 30 18:21:36 2017 = (r316286) > @@ -11,6 +11,7 @@ SRCS=3D procstat.c \ > procstat_cs.c \ > procstat_files.c \ > procstat_kstack.c \ > + procstat_ptlwpinfo.c \ > procstat_rlimit.c \ > procstat_rusage.c \ > procstat_sigs.c \ >=20 > Modified: head/usr.bin/procstat/procstat.1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/procstat/procstat.1 Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/usr.bin/procstat/procstat.1 Thu Mar 30 18:21:36 2017 = (r316286) > @@ -36,7 +36,7 @@ > .Op Fl -libxo > .Op Fl CHhn > .Op Fl w Ar interval > -.Op Fl b | c | e | f | i | j | k | l | r | s | S | t | v | x > +.Op Fl b | c | e | f | i | j | k | l | L | r | s | S | t | v | x > .Op Fl a | Ar pid | Ar core ... > .Sh DESCRIPTION > The > @@ -79,6 +79,8 @@ If the flag is repeated, function offset > printed. > .It Fl l > Display resource limits for the process. > +.It Fl L > +Display LWP info for the process pertaining to it's signal driven = exit. > .It Fl r > Display resource usage information for the process. > .It Fl s >=20 > Modified: head/usr.bin/procstat/procstat.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/procstat/procstat.c Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/usr.bin/procstat/procstat.c Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,6 +1,7 @@ > /*- > * Copyright (c) 2007, 2011 Robert N. M. Watson > * Copyright (c) 2015 Allan Jude > + * Copyright (c) 2017 Dell EMC > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -41,8 +42,8 @@ >=20 > #include "procstat.h" >=20 > -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag, = lflag, rflag; > -static int sflag, tflag, vflag, xflag, Sflag; > +static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag; > +static int lflag, Lflag, rflag, sflag, tflag, vflag, xflag, Sflag; > int hflag, nflag, Cflag, Hflag; >=20 > static void > @@ -84,6 +85,8 @@ procstat(struct procstat *prstat, struct > procstat_kstack(prstat, kipp, kflag); > else if (lflag) > procstat_rlimit(prstat, kipp); > + else if (Lflag) > + procstat_ptlwpinfo(prstat); > else if (rflag) > procstat_rusage(prstat, kipp); > else if (sflag) > @@ -161,7 +164,7 @@ main(int argc, char *argv[]) > argc =3D xo_parse_args(argc, argv); > xocontainer =3D "basic"; >=20 > - while ((ch =3D getopt(argc, argv, "CHN:M:abcefijklhrsStvw:x")) = !=3D -1) { > + while ((ch =3D getopt(argc, argv, "CHN:M:abcefijklLhrsStvw:x")) = !=3D -1) { > switch (ch) { > case 'C': > Cflag++; > @@ -225,6 +228,11 @@ main(int argc, char *argv[]) > xocontainer =3D "rlimit"; > break; >=20 > + case 'L': > + Lflag++; > + xocontainer =3D "ptlwpinfo"; > + break; > + > case 'n': > nflag++; > break; >=20 > Modified: head/usr.bin/procstat/procstat.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/procstat/procstat.h Thu Mar 30 18:20:04 2017 = (r316285) > +++ head/usr.bin/procstat/procstat.h Thu Mar 30 18:21:36 2017 = (r316286) > @@ -1,6 +1,7 @@ > /*- > * Copyright (c) 2007 Robert N. M. Watson > * Copyright (c) 2015 Allan Jude > + * Copyright (c) 2017 Dell EMC > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -50,6 +51,7 @@ void procstat_env(struct procstat *prsta > void procstat_files(struct procstat *prstat, struct kinfo_proc = *kipp); > void procstat_kstack(struct procstat *prstat, struct kinfo_proc = *kipp, > int kflag); > +void procstat_ptlwpinfo(struct procstat *prstat); > void procstat_rlimit(struct procstat *prstat, struct kinfo_proc = *kipp); > void procstat_rusage(struct procstat *prstat, struct kinfo_proc = *kipp); > void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); >=20 > Added: head/usr.bin/procstat/procstat_ptlwpinfo.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/procstat/procstat_ptlwpinfo.c Thu Mar 30 = 18:21:36 2017 (r316286) > @@ -0,0 +1,91 @@ > +/*- > + * Copyright (c) 2017 Dell EMC > + * 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 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 "procstat.h" > + > +void > +procstat_ptlwpinfo(struct procstat *prstat) > +{ > + struct ptrace_lwpinfo *pl; > + unsigned int count, i; > + > + pl =3D procstat_getptlwpinfo(prstat, &count); > + if (pl =3D=3D NULL) > + return; > + > + if (!hflag) > + xo_emit("{:/%6s %7s %5s %5s %5s %6s %5s} = {[:/%d}{:/%s}{]:}" > + " {:/%s}\n", > + "LWPID", "EVENT", "SIGNO", "CODE", "ERRNO", "PID", = "UID", > + 2 * sizeof(void *) + 2, "ADDR", "TDNAME"); > + > + for (i =3D 0; i < count; i++) { > + xo_emit("{:lpwid/%6d} ", pl[i].pl_lwpid); > + switch (pl[i].pl_event) { > + case PL_EVENT_NONE: > + xo_emit("{eq:event/none}{d:event/%7s} ", = "none"); > + break; > + case PL_EVENT_SIGNAL: > + xo_emit("{eq:event/signal}{d:event/%7s} ", = "signal"); > + break; > + default: > + xo_emit("{eq:event/unknown}{d:event/%7s} ", = "?"); > + break; > + } > + if ((pl[i].pl_flags & PL_FLAG_SI) !=3D 0) { > + siginfo_t *si; > + > + si =3D &pl[i].pl_siginfo; > + xo_emit("{:signal_number/%5d} ", si->si_signo); > + xo_emit("{:code/%5d} ", si->si_code); > + xo_emit("{:signal_errno/%5d} ", si->si_errno); > + xo_emit("{:process_id/%6d} ", si->si_pid); > + xo_emit("{:user_id/%5d} ", si->si_uid); > + xo_emit("{[:/%d}{:address/%p}{]:} ", > + 2 * sizeof(void *) + 2, si->si_addr); > + } else { > + xo_emit("{:signal_number/%5s} ", "-"); > + xo_emit("{:code/%5s} ", "-"); > + xo_emit("{:signal_errno/%5s} ", "-"); > + xo_emit("{:process_id/%6s} ", "-"); > + xo_emit("{:user_id/%5s} ", "-"); > + xo_emit("{[:/%d}{:address/%s}{]:} ", > + 2 * sizeof(void *) + 2, "-"); > + } > + xo_emit("{:tdname/%s}\n", pl[i].pl_tdname); > + } > + > + procstat_freeptlwpinfo(prstat, pl); > +} >=20 From owner-svn-src-all@freebsd.org Thu Mar 30 19:32:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C0ED26A0F; Thu, 30 Mar 2017 19:32:26 +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 82E0CB86; Thu, 30 Mar 2017 19:32:26 +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 v2UJWPVc033274; Thu, 30 Mar 2017 19:32:25 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UJWPOo033271; Thu, 30 Mar 2017 19:32:25 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201703301932.v2UJWPOo033271@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 19:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316287 - in head: lib/libstand sys/boot/i386/libi386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 19:32:26 -0000 Author: tsoome Date: Thu Mar 30 19:32:25 2017 New Revision: 316287 URL: https://svnweb.freebsd.org/changeset/base/316287 Log: Remove OLD_NFSV2 from loader and libstand We have parallel NFSv2 and NFSv3 reader implementations, only configurable at build time, defaulting to v3. Remove v2. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D10206 Modified: head/lib/libstand/nfs.c head/lib/libstand/nfsv2.h head/sys/boot/i386/libi386/pxe.c Modified: head/lib/libstand/nfs.c ============================================================================== --- head/lib/libstand/nfs.c Thu Mar 30 18:21:36 2017 (r316286) +++ head/lib/libstand/nfs.c Thu Mar 30 19:32:25 2017 (r316287) @@ -54,73 +54,6 @@ __FBSDID("$FreeBSD$"); #define NFSREAD_MIN_SIZE 1024 #define NFSREAD_MAX_SIZE 4096 -/* Define our own NFS attributes without NQNFS stuff. */ -#ifdef OLD_NFSV2 -struct nfsv2_fattrs { - n_long fa_type; - n_long fa_mode; - n_long fa_nlink; - n_long fa_uid; - n_long fa_gid; - n_long fa_size; - n_long fa_blocksize; - n_long fa_rdev; - n_long fa_blocks; - n_long fa_fsid; - n_long fa_fileid; - struct nfsv2_time fa_atime; - struct nfsv2_time fa_mtime; - struct nfsv2_time fa_ctime; -}; - -struct nfs_read_args { - u_char fh[NFS_FHSIZE]; - n_long off; - n_long len; - n_long xxx; /* XXX what's this for? */ -}; - -/* Data part of nfs rpc reply (also the largest thing we receive) */ -struct nfs_read_repl { - n_long errno; - struct nfsv2_fattrs fa; - n_long count; - u_char data[NFSREAD_MAX_SIZE]; -}; - -#ifndef NFS_NOSYMLINK -struct nfs_readlnk_repl { - n_long errno; - n_long len; - char path[NFS_MAXPATHLEN]; -}; -#endif - -struct nfs_readdir_args { - u_char fh[NFS_FHSIZE]; - n_long cookie; - n_long count; -}; - -struct nfs_readdir_data { - n_long fileid; - n_long len; - char name[0]; -}; - -struct nfs_readdir_off { - n_long cookie; - n_long follows; -}; - -struct nfs_iodesc { - struct iodesc *iodesc; - off_t off; - u_char fh[NFS_FHSIZE]; - struct nfsv2_fattrs fa; /* all in network order */ -}; -#else /* !OLD_NFSV2 */ - /* NFSv3 definitions */ #define NFS_V3MAXFHSIZE 64 #define NFS_VER3 3 @@ -185,7 +118,6 @@ struct nfs_iodesc { struct nfsv3_fattrs fa; /* all in network order */ uint64_t cookie; }; -#endif /* OLD_NFSV2 */ /* * XXX interactions with tftp? See nfswrapper.c for a confusing @@ -246,612 +178,6 @@ set_nfs_read_size(void) setenv("nfs.read_size", buf, 1); } -#ifdef OLD_NFSV2 -/* - * Fetch the root file handle (call mount daemon) - * Return zero or error number. - */ -int -nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp) -{ - int len; - struct args { - n_long len; - char path[FNAME_SIZE]; - } *args; - struct repl { - n_long errno; - u_char fh[NFS_FHSIZE]; - } *repl; - struct { - n_long h[RPC_HEADER_WORDS]; - struct args d; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct repl d; - } rdata; - size_t cc; - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_getrootfh: %s\n", path); -#endif - - args = &sdata.d; - repl = &rdata.d; - - bzero(args, sizeof(*args)); - len = strlen(path); - if (len > sizeof(args->path)) - len = sizeof(args->path); - args->len = htonl(len); - bcopy(path, args->path, len); - len = 4 + roundup(len, 4); - - cc = rpc_call(d, RPCPROG_MNT, RPCMNT_VER1, RPCMNT_MOUNT, - args, len, repl, sizeof(*repl)); - if (cc == -1) { - /* errno was set by rpc_call */ - return (errno); - } - if (cc < 4) - return (EBADRPC); - if (repl->errno) - return (ntohl(repl->errno)); - bcopy(repl->fh, fhp, sizeof(repl->fh)); - - set_nfs_read_size(); - return (0); -} - -/* - * Lookup a file. Store handle and attributes. - * Return zero or error number. - */ -int -nfs_lookupfh(struct nfs_iodesc *d, const char *name, struct nfs_iodesc *newfd) -{ - int len, rlen; - struct args { - u_char fh[NFS_FHSIZE]; - n_long len; - char name[FNAME_SIZE]; - } *args; - struct repl { - n_long errno; - u_char fh[NFS_FHSIZE]; - struct nfsv2_fattrs fa; - } *repl; - struct { - n_long h[RPC_HEADER_WORDS]; - struct args d; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct repl d; - } rdata; - ssize_t cc; - -#ifdef NFS_DEBUG - if (debug) - printf("lookupfh: called\n"); -#endif - - args = &sdata.d; - repl = &rdata.d; - - bzero(args, sizeof(*args)); - bcopy(d->fh, args->fh, sizeof(args->fh)); - len = strlen(name); - if (len > sizeof(args->name)) - len = sizeof(args->name); - bcopy(name, args->name, len); - args->len = htonl(len); - len = 4 + roundup(len, 4); - len += NFS_FHSIZE; - - rlen = sizeof(*repl); - - cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_LOOKUP, - args, len, repl, rlen); - if (cc == -1) - return (errno); /* XXX - from rpc_call */ - if (cc < 4) - return (EIO); - if (repl->errno) { - /* saerrno.h now matches NFS error numbers. */ - return (ntohl(repl->errno)); - } - bcopy( repl->fh, &newfd->fh, sizeof(newfd->fh)); - bcopy(&repl->fa, &newfd->fa, sizeof(newfd->fa)); - return (0); -} - -#ifndef NFS_NOSYMLINK -/* - * Get the destination of a symbolic link. - */ -int -nfs_readlink(struct nfs_iodesc *d, char *buf) -{ - struct { - n_long h[RPC_HEADER_WORDS]; - u_char fh[NFS_FHSIZE]; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_readlnk_repl d; - } rdata; - ssize_t cc; - -#ifdef NFS_DEBUG - if (debug) - printf("readlink: called\n"); -#endif - - bcopy(d->fh, sdata.fh, NFS_FHSIZE); - cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READLINK, - sdata.fh, NFS_FHSIZE, - &rdata.d, sizeof(rdata.d)); - if (cc == -1) - return (errno); - - if (cc < 4) - return (EIO); - - if (rdata.d.errno) - return (ntohl(rdata.d.errno)); - - rdata.d.len = ntohl(rdata.d.len); - if (rdata.d.len > NFS_MAXPATHLEN) - return (ENAMETOOLONG); - - bcopy(rdata.d.path, buf, rdata.d.len); - buf[rdata.d.len] = 0; - return (0); -} -#endif - -/* - * Read data from a file. - * Return transfer count or -1 (and set errno) - */ -ssize_t -nfs_readdata(struct nfs_iodesc *d, off_t off, void *addr, size_t len) -{ - struct nfs_read_args *args; - struct nfs_read_repl *repl; - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_read_args d; - } sdata; - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_read_repl d; - } rdata; - size_t cc; - long x; - int hlen, rlen; - - args = &sdata.d; - repl = &rdata.d; - - bcopy(d->fh, args->fh, NFS_FHSIZE); - args->off = htonl((n_long)off); - if (len > nfs_read_size) - len = nfs_read_size; - args->len = htonl((n_long)len); - args->xxx = htonl((n_long)0); - hlen = offsetof(struct nfs_read_rpl, data[0]); - - cc = rpc_call(d->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READ, - args, sizeof(*args), - repl, sizeof(*repl)); - if (cc == -1) { - /* errno was already set by rpc_call */ - return (-1); - } - if (cc < hlen) { - errno = EBADRPC; - return (-1); - } - if (repl->errno) { - errno = ntohl(repl->errno); - return (-1); - } - rlen = cc - hlen; - x = ntohl(repl->count); - if (rlen < x) { - printf("nfsread: short packet, %d < %ld\n", rlen, x); - errno = EBADRPC; - return(-1); - } - bcopy(repl->data, addr, x); - return (x); -} - -/* - * Open a file. - * return zero or error number - */ -int -nfs_open(const char *upath, struct open_file *f) -{ - struct iodesc *desc; - struct nfs_iodesc *currfd; - char buf[2 * NFS_FHSIZE + 3]; - u_char *fh; - char *cp; - int i; -#ifndef NFS_NOSYMLINK - struct nfs_iodesc *newfd; - struct nfsv2_fattrs *fa; - char *ncp; - int c; - char namebuf[NFS_MAXPATHLEN + 1]; - char linkbuf[NFS_MAXPATHLEN + 1]; - int nlinks = 0; -#endif - int error; - char *path; - - if (netproto != NET_NFS) - return (EINVAL); - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_open: %s (rootpath=%s)\n", upath, rootpath); -#endif - if (!rootpath[0]) { - printf("no rootpath, no nfs\n"); - return (ENXIO); - } - - /* - * This is silly - we should look at dv_type but that value is - * arch dependant and we can't use it here. - */ -#ifndef __i386__ - if (strcmp(f->f_dev->dv_name, "net") != 0) - return(EINVAL); -#else - if (strcmp(f->f_dev->dv_name, "pxe") != 0) - return(EINVAL); -#endif - - if (!(desc = socktodesc(*(int *)(f->f_devdata)))) - return(EINVAL); - - /* Bind to a reserved port. */ - desc->myport = htons(--rpc_port); - desc->destip = rootip; - if ((error = nfs_getrootfh(desc, rootpath, nfs_root_node.fh))) - return (error); - nfs_root_node.fa.fa_type = htonl(NFDIR); - nfs_root_node.fa.fa_mode = htonl(0755); - nfs_root_node.fa.fa_nlink = htonl(2); - nfs_root_node.iodesc = desc; - - fh = &nfs_root_node.fh[0]; - buf[0] = 'X'; - cp = &buf[1]; - for (i = 0; i < NFS_FHSIZE; i++, cp += 2) - sprintf(cp, "%02x", fh[i]); - sprintf(cp, "X"); - setenv("boot.nfsroot.server", inet_ntoa(rootip), 1); - setenv("boot.nfsroot.path", rootpath, 1); - setenv("boot.nfsroot.nfshandle", buf, 1); - - /* Allocate file system specific data structure */ - currfd = malloc(sizeof(*newfd)); - if (currfd == NULL) { - error = ENOMEM; - goto out; - } - -#ifndef NFS_NOSYMLINK - bcopy(&nfs_root_node, currfd, sizeof(*currfd)); - newfd = NULL; - - cp = path = strdup(upath); - if (path == NULL) { - error = ENOMEM; - goto out; - } - while (*cp) { - /* - * Remove extra separators - */ - while (*cp == '/') - cp++; - - if (*cp == '\0') - break; - /* - * Check that current node is a directory. - */ - if (currfd->fa.fa_type != htonl(NFDIR)) { - error = ENOTDIR; - goto out; - } - - /* allocate file system specific data structure */ - newfd = malloc(sizeof(*newfd)); - newfd->iodesc = currfd->iodesc; - - /* - * Get next component of path name. - */ - { - int len = 0; - - ncp = cp; - while ((c = *cp) != '\0' && c != '/') { - if (++len > NFS_MAXNAMLEN) { - error = ENOENT; - goto out; - } - cp++; - } - *cp = '\0'; - } - - /* lookup a file handle */ - error = nfs_lookupfh(currfd, ncp, newfd); - *cp = c; - if (error) - goto out; - - /* - * Check for symbolic link - */ - if (newfd->fa.fa_type == htonl(NFLNK)) { - int link_len, len; - - error = nfs_readlink(newfd, linkbuf); - if (error) - goto out; - - link_len = strlen(linkbuf); - len = strlen(cp); - - if (link_len + len > MAXPATHLEN - || ++nlinks > MAXSYMLINKS) { - error = ENOENT; - goto out; - } - - bcopy(cp, &namebuf[link_len], len + 1); - bcopy(linkbuf, namebuf, link_len); - - /* - * If absolute pathname, restart at root. - * If relative pathname, restart at parent directory. - */ - cp = namebuf; - if (*cp == '/') - bcopy(&nfs_root_node, currfd, sizeof(*currfd)); - - free(newfd); - newfd = NULL; - - continue; - } - - free(currfd); - currfd = newfd; - newfd = NULL; - } - - error = 0; - -out: - free(newfd); - free(path); -#else - currfd->iodesc = desc; - - error = nfs_lookupfh(&nfs_root_node, upath, currfd); -#endif - if (!error) { - currfd->off = 0; - f->f_fsdata = (void *)currfd; - return (0); - } - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_open: %s lookupfh failed: %s\n", - path, strerror(error)); -#endif - free(currfd); - - return (error); -} - -int -nfs_close(struct open_file *f) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_close: fp=0x%lx\n", (u_long)fp); -#endif - - if (fp) - free(fp); - f->f_fsdata = (void *)0; - - return (0); -} - -/* - * read a portion of a file - */ -int -nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - ssize_t cc; - char *addr = buf; - -#ifdef NFS_DEBUG - if (debug) - printf("nfs_read: size=%lu off=%d\n", (u_long)size, - (int)fp->off); -#endif - while ((int)size > 0) { - twiddle(16); - cc = nfs_readdata(fp, fp->off, (void *)addr, size); - /* XXX maybe should retry on certain errors */ - if (cc == -1) { -#ifdef NFS_DEBUG - if (debug) - printf("nfs_read: read: %s", strerror(errno)); -#endif - return (errno); /* XXX - from nfs_readdata */ - } - if (cc == 0) { -#ifdef NFS_DEBUG - if (debug) - printf("nfs_read: hit EOF unexpectantly"); -#endif - goto ret; - } - fp->off += cc; - addr += cc; - size -= cc; - } -ret: - if (resid) - *resid = size; - - return (0); -} - -/* - * Not implemented. - */ -int -nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid) -{ - return (EROFS); -} - -off_t -nfs_seek(struct open_file *f, off_t offset, int where) -{ - struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata; - n_long size = ntohl(d->fa.fa_size); - - switch (where) { - case SEEK_SET: - d->off = offset; - break; - case SEEK_CUR: - d->off += offset; - break; - case SEEK_END: - d->off = size - offset; - break; - default: - errno = EINVAL; - return (-1); - } - - return (d->off); -} - -/* NFNON=0, NFREG=1, NFDIR=2, NFBLK=3, NFCHR=4, NFLNK=5 */ -int nfs_stat_types[8] = { - 0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, 0 }; - -int -nfs_stat(struct open_file *f, struct stat *sb) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - n_long ftype, mode; - - ftype = ntohl(fp->fa.fa_type); - mode = ntohl(fp->fa.fa_mode); - mode |= nfs_stat_types[ftype & 7]; - - sb->st_mode = mode; - sb->st_nlink = ntohl(fp->fa.fa_nlink); - sb->st_uid = ntohl(fp->fa.fa_uid); - sb->st_gid = ntohl(fp->fa.fa_gid); - sb->st_size = ntohl(fp->fa.fa_size); - - return (0); -} - -static int -nfs_readdir(struct open_file *f, struct dirent *d) -{ - struct nfs_iodesc *fp = (struct nfs_iodesc *)f->f_fsdata; - struct nfs_readdir_args *args; - struct nfs_readdir_data *rd; - struct nfs_readdir_off *roff = NULL; - static char *buf; - static struct nfs_iodesc *pfp = NULL; - static n_long cookie = 0; - size_t cc; - n_long eof; - - struct { - n_long h[RPC_HEADER_WORDS]; - struct nfs_readdir_args d; - } sdata; - static struct { - n_long h[RPC_HEADER_WORDS]; - u_char d[NFS_READDIRSIZE]; - } rdata; - - if (fp != pfp || fp->off != cookie) { - pfp = NULL; - refill: - args = &sdata.d; - bzero(args, sizeof(*args)); - - bcopy(fp->fh, args->fh, NFS_FHSIZE); - args->cookie = htonl(fp->off); - args->count = htonl(NFS_READDIRSIZE); - - cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, - args, sizeof(*args), - rdata.d, sizeof(rdata.d)); - buf = rdata.d; - roff = (struct nfs_readdir_off *)buf; - if (ntohl(roff->cookie) != 0) - return EIO; - pfp = fp; - cookie = fp->off; - } - roff = (struct nfs_readdir_off *)buf; - - if (ntohl(roff->follows) == 0) { - eof = ntohl((roff+1)->cookie); - if (eof) { - cookie = 0; - return ENOENT; - } - goto refill; - } - - buf += sizeof(struct nfs_readdir_off); - rd = (struct nfs_readdir_data *)buf; - d->d_namlen = ntohl(rd->len); - bcopy(rd->name, d->d_name, d->d_namlen); - d->d_name[d->d_namlen] = '\0'; - - buf += (sizeof(struct nfs_readdir_data) + roundup(htonl(rd->len),4)); - roff = (struct nfs_readdir_off *)buf; - fp->off = cookie = ntohl(roff->cookie); - return 0; -} -#else /* !OLD_NFSV2 */ /* * Fetch the root file handle (call mount daemon) * Return zero or error number. @@ -1517,4 +843,3 @@ nfs_readdir(struct open_file *f, struct buf = (u_char *)&rent->nameplus[pos]; return (0); } -#endif /* OLD_NFSV2 */ Modified: head/lib/libstand/nfsv2.h ============================================================================== --- head/lib/libstand/nfsv2.h Thu Mar 30 18:21:36 2017 (r316286) +++ head/lib/libstand/nfsv2.h Thu Mar 30 19:32:25 2017 (r316287) @@ -119,46 +119,3 @@ typedef enum { NFCHR=4, NFLNK=5 } nfstype; - -/* Structs for common parts of the rpc's */ -struct nfsv2_time { - n_long nfs_sec; - n_long nfs_usec; -}; - -/* - * File attributes and setable attributes. - */ -struct nfsv2_fattr { - n_long fa_type; - n_long fa_mode; - n_long fa_nlink; - n_long fa_uid; - n_long fa_gid; - n_long fa_size; - n_long fa_blocksize; - n_long fa_rdev; - n_long fa_blocks; - n_long fa_fsid; - n_long fa_fileid; - struct nfsv2_time fa_atime; - struct nfsv2_time fa_mtime; - struct nfsv2_time fa_ctime; -}; - -struct nfsv2_sattr { - n_long sa_mode; - n_long sa_uid; - n_long sa_gid; - n_long sa_size; - struct nfsv2_time sa_atime; - struct nfsv2_time sa_mtime; -}; - -struct nfsv2_statfs { - n_long sf_tsize; - n_long sf_bsize; - n_long sf_blocks; - n_long sf_bfree; - n_long sf_bavail; -}; Modified: head/sys/boot/i386/libi386/pxe.c ============================================================================== --- head/sys/boot/i386/libi386/pxe.c Thu Mar 30 18:21:36 2017 (r316286) +++ head/sys/boot/i386/libi386/pxe.c Thu Mar 30 19:32:25 2017 (r316287) @@ -88,11 +88,7 @@ static int pxe_netif_get(struct iodesc * static int pxe_netif_put(struct iodesc *desc, void *pkt, size_t len); static void pxe_netif_end(struct netif *nif); -#ifdef OLD_NFSV2 -int nfs_getrootfh(struct iodesc*, char*, u_char*); -#else int nfs_getrootfh(struct iodesc*, char*, uint32_t*, u_char*); -#endif extern struct netif_stats pxe_st[]; extern u_int16_t __bangpxeseg; @@ -468,56 +464,6 @@ pxe_perror(int err) * Reach inside the libstand NFS code and dig out an NFS handle * for the root filesystem. */ -#ifdef OLD_NFSV2 -struct nfs_iodesc { - struct iodesc *iodesc; - off_t off; - u_char fh[NFS_FHSIZE]; - /* structure truncated here */ -}; -extern struct nfs_iodesc nfs_root_node; -extern int rpc_port; - -static void -pxe_rpcmountcall() -{ - struct iodesc *d; - int error; - - if (!(d = socktodesc(pxe_sock))) - return; - d->myport = htons(--rpc_port); - d->destip = rootip; - if ((error = nfs_getrootfh(d, rootpath, nfs_root_node.fh)) != 0) - printf("NFS MOUNT RPC error: %d\n", error); - nfs_root_node.iodesc = d; -} - -static void -pxe_setnfshandle(char *rootpath) -{ - int i; - u_char *fh; - char buf[2 * NFS_FHSIZE + 3], *cp; - - /* - * If NFS files were never opened, we need to do mount call - * ourselves. Use nfs_root_node.iodesc as flag indicating - * previous NFS usage. - */ - if (nfs_root_node.iodesc == NULL) - pxe_rpcmountcall(); - - fh = &nfs_root_node.fh[0]; - buf[0] = 'X'; - cp = &buf[1]; - for (i = 0; i < NFS_FHSIZE; i++, cp += 2) - sprintf(cp, "%02x", fh[i]); - sprintf(cp, "X"); - setenv("boot.nfsroot.nfshandle", buf, 1); -} -#else /* !OLD_NFSV2 */ - #define NFS_V3MAXFHSIZE 64 struct nfs_iodesc { @@ -573,7 +519,6 @@ pxe_setnfshandle(char *rootpath) sprintf(buf, "%d", nfs_root_node.fhsize); setenv("boot.nfsroot.nfshandlelen", buf, 1); } -#endif /* OLD_NFSV2 */ void pxenv_call(int func) From owner-svn-src-all@freebsd.org Thu Mar 30 19:42:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF932D26CA0; Thu, 30 Mar 2017 19:42: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 85658377; Thu, 30 Mar 2017 19:42: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 v2UJgn10037262; Thu, 30 Mar 2017 19:42:49 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UJgnqb037260; Thu, 30 Mar 2017 19:42:49 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703301942.v2UJgnqb037260@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:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316288 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 19:42:50 -0000 Author: dchagin Date: Thu Mar 30 19:42:49 2017 New Revision: 316288 URL: https://svnweb.freebsd.org/changeset/base/316288 Log: Add kern_mincore() helper for micore() syscall. Suggested by: kib@ Reviewed by: kib@ MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10143 Modified: head/sys/sys/syscallsubr.h head/sys/vm/vm_mmap.c Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Thu Mar 30 19:32:25 2017 (r316287) +++ head/sys/sys/syscallsubr.h Thu Mar 30 19:42:49 2017 (r316288) @@ -152,6 +152,7 @@ int kern_lseek(struct thread *td, int fd int kern_lutimes(struct thread *td, char *path, enum uio_seg pathseg, struct timeval *tptr, enum uio_seg tptrseg); int kern_madvise(struct thread *td, uintptr_t addr, size_t len, int behav); +int kern_mincore(struct thread *td, uintptr_t addr, size_t len, char *vec); int kern_mkdirat(struct thread *td, int fd, char *path, enum uio_seg segflg, int mode); int kern_mkfifoat(struct thread *td, int fd, char *path, Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu Mar 30 19:32:25 2017 (r316287) +++ head/sys/vm/vm_mmap.c Thu Mar 30 19:42:49 2017 (r316288) @@ -711,11 +711,17 @@ struct mincore_args { int sys_mincore(struct thread *td, struct mincore_args *uap) { + + return (kern_mincore(td, (uintptr_t)uap->addr, uap->len, uap->vec)); +} + +int +kern_mincore(struct thread *td, uintptr_t addr0, size_t len, char *vec) +{ vm_offset_t addr, first_addr; vm_offset_t end, cend; pmap_t pmap; vm_map_t map; - char *vec; int error = 0; int vecindex, lastvecindex; vm_map_entry_t current; @@ -732,17 +738,12 @@ sys_mincore(struct thread *td, struct mi * Make sure that the addresses presented are valid for user * mode. */ - first_addr = addr = trunc_page((vm_offset_t) uap->addr); - end = addr + (vm_size_t)round_page(uap->len); + first_addr = addr = trunc_page(addr0); + end = addr + (vm_size_t)round_page(len); map = &td->td_proc->p_vmspace->vm_map; if (end > vm_map_max(map) || end < addr) return (ENOMEM); - /* - * Address of byte vector - */ - vec = uap->vec; - pmap = vmspace_pmap(td->td_proc->p_vmspace); vm_map_lock_read(map); From owner-svn-src-all@freebsd.org Thu Mar 30 19:45:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208C2D26D36; Thu, 30 Mar 2017 19:45:09 +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 E4BEA7EA; Thu, 30 Mar 2017 19:45:08 +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 v2UJj8hH037398; Thu, 30 Mar 2017 19:45:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UJj8Bh037397; Thu, 30 Mar 2017 19:45:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703301945.v2UJj8Bh037397@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:45:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316289 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 19:45:09 -0000 Author: dchagin Date: Thu Mar 30 19:45:07 2017 New Revision: 316289 URL: https://svnweb.freebsd.org/changeset/base/316289 Log: Use kern_mincore() helper instead of abusing syscall entry. Suggested by: kib@ Reviewed by: kib@ MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10143 Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Thu Mar 30 19:42:49 2017 (r316288) +++ head/sys/compat/linux/linux_misc.c Thu Mar 30 19:45:07 2017 (r316289) @@ -2538,13 +2538,9 @@ linux_getrandom(struct thread *td, struc int linux_mincore(struct thread *td, struct linux_mincore_args *args) { - struct mincore_args bsd_args; /* Needs to be page-aligned */ if (args->start & PAGE_MASK) return (EINVAL); - bsd_args.addr = PTRIN(args->start); - bsd_args.len = args->len; - bsd_args.vec = args->vec; - return (sys_mincore(td, &bsd_args)); + return (kern_mincore(td, args->start, args->len, args->vec)); } From owner-svn-src-all@freebsd.org Thu Mar 30 19:56:42 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 19:59:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:00:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:02:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:03:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:04:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:05:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:08:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:09:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:10:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:12:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:13:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:14:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:27:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Thu Mar 30 20:42:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 299F1D2640F; Thu, 30 Mar 2017 20:42:18 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7C0A663; Thu, 30 Mar 2017 20:42:17 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UKgHt8062642; Thu, 30 Mar 2017 20:42:17 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UKgH0A062641; Thu, 30 Mar 2017 20:42:17 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201703302042.v2UKgH0A062641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 30 Mar 2017 20:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316304 - head/lib/libprocstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 20:42:18 -0000 Author: tychon Date: Thu Mar 30 20:42:16 2017 New Revision: 316304 URL: https://svnweb.freebsd.org/changeset/base/316304 Log: Reorder includes to placate MIPS build. Reported by: markj Sponsored by: Dell EMC Isilon Modified: head/lib/libprocstat/libprocstat.c Modified: head/lib/libprocstat/libprocstat.c ============================================================================== --- head/lib/libprocstat/libprocstat.c Thu Mar 30 20:18:34 2017 (r316303) +++ head/lib/libprocstat/libprocstat.c Thu Mar 30 20:42:16 2017 (r316304) @@ -63,10 +63,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define _KERNEL #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Thu Mar 30 21:39:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB87ED24F5B; Thu, 30 Mar 2017 21:39:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1D66CBA; Thu, 30 Mar 2017 21:39:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2ULd30J083801; Thu, 30 Mar 2017 21:39:03 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2ULd3Gn083800; Thu, 30 Mar 2017 21:39:03 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703302139.v2ULd3Gn083800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Thu, 30 Mar 2017 21:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316305 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 21:39:05 -0000 Author: rwatson Date: Thu Mar 30 21:39:03 2017 New Revision: 316305 URL: https://svnweb.freebsd.org/changeset/base/316305 Log: Various BSM generation improvements when auditing AUE_ACCEPT, AUE_PROCCTL, AUE_SENDFILE, AUE_ACL_*, and AUE_POSIX_FALLOCATE. Audit AUE_SHMUNLINK path in the path token rather than as a text string, and AUE_SHMOPEN flags as an integer token rather than a System V IPC address token. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Thu Mar 30 20:42:16 2017 (r316304) +++ head/sys/security/audit/audit_bsm.c Thu Mar 30 21:39:03 2017 (r316305) @@ -530,6 +530,23 @@ kaudit_to_bsm(struct kaudit_record *kar, */ switch(ar->ar_event) { case AUE_ACCEPT: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_SADDRINET)) { + tok = au_to_sock_inet((struct sockaddr_in *) + &ar->ar_arg_sockaddr); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_SADDRUNIX)) { + tok = au_to_sock_unix((struct sockaddr_un *) + &ar->ar_arg_sockaddr); + kau_write(rec, tok); + UPATH1_TOKENS; + } + break; + case AUE_BIND: case AUE_LISTEN: case AUE_CONNECT: @@ -537,7 +554,6 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_RECVFROM: case AUE_RECVMSG: case AUE_SEND: - case AUE_SENDFILE: case AUE_SENDMSG: case AUE_SENDTO: /* @@ -576,6 +592,22 @@ kaudit_to_bsm(struct kaudit_record *kar, } break; + case AUE_SENDFILE: + FD_VNODE1_TOKENS; + if (ARG_IS_VALID(kar, ARG_SADDRINET)) { + tok = au_to_sock_inet((struct sockaddr_in *) + &ar->ar_arg_sockaddr); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_SADDRUNIX)) { + tok = au_to_sock_unix((struct sockaddr_un *) + &ar->ar_arg_sockaddr); + kau_write(rec, tok); + UPATH1_TOKENS; + } + /* XXX Need to handle ARG_SADDRINET6 */ + break; + case AUE_SOCKET: case AUE_SOCKETPAIR: if (ARG_IS_VALID(kar, ARG_SOCKINFO)) { @@ -749,6 +781,26 @@ kaudit_to_bsm(struct kaudit_record *kar, */ break; + case AUE_ACL_DELETE_FD: + case AUE_ACL_DELETE_FILE: + case AUE_ACL_CHECK_FD: + case AUE_ACL_CHECK_FILE: + case AUE_ACL_CHECK_LINK: + case AUE_ACL_DELETE_LINK: + case AUE_ACL_GET_FD: + case AUE_ACL_GET_FILE: + case AUE_ACL_GET_LINK: + case AUE_ACL_SET_FD: + case AUE_ACL_SET_FILE: + case AUE_ACL_SET_LINK: + if (ARG_IS_VALID(kar, ARG_VALUE)) { + tok = au_to_arg32(1, "type", ar->ar_arg_value); + kau_write(rec, tok); + } + ATFD1_TOKENS(1); + UPATH1_VNODE1_TOKENS; + break; + case AUE_CHDIR: case AUE_CHROOT: case AUE_FSTATAT: @@ -959,6 +1011,7 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_GETDIRENTRIESATTR: case AUE_LSEEK: case AUE_POLL: + case AUE_POSIX_FALLOCATE: case AUE_PREAD: case AUE_PWRITE: case AUE_READ: @@ -1245,6 +1298,18 @@ kaudit_to_bsm(struct kaudit_record *kar, UPATH1_VNODE1_TOKENS; break; + case AUE_PROCCTL: + if (ARG_IS_VALID(kar, ARG_VALUE)) { + tok = au_to_arg32(1, "idtype", ar->ar_arg_value); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_CMD)) { + tok = au_to_arg32(2, "com", ar->ar_arg_cmd); + kau_write(rec, tok); + } + PROCESS_PID_TOKENS(3); + break; + case AUE_PTRACE: if (ARG_IS_VALID(kar, ARG_CMD)) { tok = au_to_arg32(1, "request", ar->ar_arg_cmd); @@ -1499,7 +1564,7 @@ kaudit_to_bsm(struct kaudit_record *kar, /* AUE_SHMOPEN, AUE_SHMUNLINK, AUE_SEMOPEN, AUE_SEMCLOSE * and AUE_SEMUNLINK are Posix IPC */ case AUE_SHMOPEN: - if (ARG_IS_VALID(kar, ARG_SVIPC_ADDR)) { + if (ARG_IS_VALID(kar, ARG_FFLAGS)) { tok = au_to_arg32(2, "flags", ar->ar_arg_fflags); kau_write(rec, tok); } @@ -1510,10 +1575,7 @@ kaudit_to_bsm(struct kaudit_record *kar, /* FALLTHROUGH */ case AUE_SHMUNLINK: - if (ARG_IS_VALID(kar, ARG_TEXT)) { - tok = au_to_text(ar->ar_arg_text); - kau_write(rec, tok); - } + UPATH1_TOKENS; if (ARG_IS_VALID(kar, ARG_POSIX_IPC_PERM)) { struct ipc_perm perm; From owner-svn-src-all@freebsd.org Thu Mar 30 21:54:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACED2D254FE; Thu, 30 Mar 2017 21:54:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7187CC02; Thu, 30 Mar 2017 21:54:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2ULsvWe091508; Thu, 30 Mar 2017 21:54:57 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2ULsvHG091507; Thu, 30 Mar 2017 21:54:57 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201703302154.v2ULsvHG091507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 30 Mar 2017 21:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316306 - head/sys/arm/ti/am335x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 21:54:58 -0000 Author: gonzo Date: Thu Mar 30 21:54:57 2017 New Revision: 316306 URL: https://svnweb.freebsd.org/changeset/base/316306 Log: [am335x] Fix HDMI suport for Beaglebone Black Fallback to Linux video interface bindings introduced in r313068 worked with then current DTS but that DTS turned out to be not conformant to the the bindings spec. DTS import in r314854 fixed the conformancy but broke the functionality. This commit syncs up functionality to the actual spec. Reported by: manu@ Modified: head/sys/arm/ti/am335x/am335x_lcd.c Modified: head/sys/arm/ti/am335x/am335x_lcd.c ============================================================================== --- head/sys/arm/ti/am335x/am335x_lcd.c Thu Mar 30 21:39:03 2017 (r316305) +++ head/sys/arm/ti/am335x/am335x_lcd.c Thu Mar 30 21:54:57 2017 (r316306) @@ -342,7 +342,7 @@ am335x_mode_is_valid(const struct videom static void am335x_read_hdmi_property(device_t dev) { - phandle_t node; + phandle_t node, xref; phandle_t endpoint; phandle_t hdmi_xref; struct am335x_lcd_softc *sc; @@ -372,13 +372,15 @@ am335x_read_hdmi_property(device_t dev) return; for (endpoint = OF_child(node); endpoint != 0; endpoint = OF_peer(endpoint)) { - if (OF_getencprop(endpoint, "remote-endpoint", &node, sizeof(node)) != -1) { - /* port node of remote endpoint */ - node = OF_node_from_xref(node); - /* port/ node */ + if (OF_getencprop(endpoint, "remote-endpoint", &xref, sizeof(xref)) != -1) { + /* port/port@0/endpoint@0 */ + node = OF_node_from_xref(xref); + /* port/port@0 */ node = OF_parent(node); - /* actual owner of port/endpoint, in our case HDMI framer */ - sc->sc_hdmi_framer = OF_parent(node); + /* port */ + node = OF_parent(node); + /* actual owner of port, in our case HDMI framer */ + sc->sc_hdmi_framer = OF_xref_from_node(OF_parent(node)); if (sc->sc_hdmi_framer != 0) return; } From owner-svn-src-all@freebsd.org Thu Mar 30 22:00:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B910AD256D7; Thu, 30 Mar 2017 22:00:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B65FD6; Thu, 30 Mar 2017 22:00:59 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UM0wpT091818; Thu, 30 Mar 2017 22:00:58 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UM0wLr091817; Thu, 30 Mar 2017 22:00:58 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703302200.v2UM0wLr091817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Thu, 30 Mar 2017 22:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316307 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 22:00:59 -0000 Author: rwatson Date: Thu Mar 30 22:00:58 2017 New Revision: 316307 URL: https://svnweb.freebsd.org/changeset/base/316307 Log: Add system-call argument auditing for ACL-related system calls. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_acl.c Modified: head/sys/kern/vfs_acl.c ============================================================================== --- head/sys/kern/vfs_acl.c Thu Mar 30 21:54:57 2017 (r316306) +++ head/sys/kern/vfs_acl.c Thu Mar 30 22:00:58 2017 (r316307) @@ -1,9 +1,14 @@ /*- - * Copyright (c) 1999-2006 Robert N. M. Watson + * Copyright (c) 1999-2006, 2016-2017 Robert N. M. Watson * All rights reserved. * * This software was developed by Robert Watson for the TrustedBSD Project. * + * Portions of this software were 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: @@ -53,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include CTASSERT(ACL_MAX_ENTRIES >= OLDACL_MAX_ENTRIES); @@ -216,6 +222,7 @@ vacl_set_acl(struct thread *td, struct v struct mount *mp; int error; + AUDIT_ARG_VALUE(type); inkernelacl = acl_alloc(M_WAITOK); error = acl_copyin(aclp, inkernelacl, type); if (error != 0) @@ -224,6 +231,7 @@ vacl_set_acl(struct thread *td, struct v if (error != 0) goto out; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + AUDIT_ARG_VNODE1(vp); #ifdef MAC error = mac_vnode_check_setacl(td->td_ucred, vp, type, inkernelacl); if (error != 0) @@ -251,8 +259,10 @@ vacl_get_acl(struct thread *td, struct v struct acl *inkernelacl; int error; + AUDIT_ARG_VALUE(type); inkernelacl = acl_alloc(M_WAITOK | M_ZERO); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + AUDIT_ARG_VNODE1(vp); #ifdef MAC error = mac_vnode_check_getacl(td->td_ucred, vp, type); if (error != 0) @@ -280,10 +290,12 @@ vacl_delete(struct thread *td, struct vn struct mount *mp; int error; + AUDIT_ARG_VALUE(type); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) return (error); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + AUDIT_ARG_VNODE1(vp); #ifdef MAC error = mac_vnode_check_deleteacl(td->td_ucred, vp, type); if (error != 0) @@ -300,6 +312,8 @@ out: /* * Given a vnode, check whether an ACL is appropriate for it + * + * XXXRW: No vnode lock held so can't audit vnode state...? */ static int vacl_aclcheck(struct thread *td, struct vnode *vp, acl_type_t type, @@ -333,7 +347,8 @@ sys___acl_get_file(struct thread *td, st struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); error = namei(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); @@ -351,7 +366,8 @@ sys___acl_get_link(struct thread *td, st struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); error = namei(&nd); if (error == 0) { error = vacl_get_acl(td, nd.ni_vp, uap->type, uap->aclp); @@ -369,7 +385,8 @@ sys___acl_set_file(struct thread *td, st struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); error = namei(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); @@ -387,7 +404,8 @@ sys___acl_set_link(struct thread *td, st struct nameidata nd; int error; - NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, + td); error = namei(&nd); if (error == 0) { error = vacl_set_acl(td, nd.ni_vp, uap->type, uap->aclp); @@ -406,6 +424,7 @@ sys___acl_get_fd(struct thread *td, stru cap_rights_t rights; int error; + AUDIT_ARG_FD(uap->filedes); error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_GET), &fp); if (error == 0) { @@ -425,6 +444,7 @@ sys___acl_set_fd(struct thread *td, stru cap_rights_t rights; int error; + AUDIT_ARG_FD(uap->filedes); error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_SET), &fp); if (error == 0) { @@ -480,6 +500,7 @@ sys___acl_delete_fd(struct thread *td, s cap_rights_t rights; int error; + AUDIT_ARG_FD(uap->filedes); error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_DELETE), &fp); if (error == 0) { @@ -535,6 +556,7 @@ sys___acl_aclcheck_fd(struct thread *td, cap_rights_t rights; int error; + AUDIT_ARG_FD(uap->filedes); error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_CHECK), &fp); if (error == 0) { From owner-svn-src-all@freebsd.org Thu Mar 30 22:27:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6821D2602F; Thu, 30 Mar 2017 22:27:32 +0000 (UTC) (envelope-from rwatson@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 689B0682; Thu, 30 Mar 2017 22:27:32 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UMQGL0003680; Thu, 30 Mar 2017 22:26:16 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UMQGSt003675; Thu, 30 Mar 2017 22:26:16 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703302226.v2UMQGSt003675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Thu, 30 Mar 2017 22:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316308 - in head/sys: kern security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 22:27:32 -0000 Author: rwatson Date: Thu Mar 30 22:26:15 2017 New Revision: 316308 URL: https://svnweb.freebsd.org/changeset/base/316308 Log: Audit arguments to System V IPC system calls implementing sempahores, message queues, and shared memory. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/security/audit/audit.h Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Thu Mar 30 22:00:58 2017 (r316307) +++ head/sys/kern/sysv_msg.c Thu Mar 30 22:26:15 2017 (r316308) @@ -18,6 +18,7 @@ */ /*- * Copyright (c) 2003-2005 McAfee, Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * * This software was developed for the FreeBSD Project in part by McAfee @@ -25,6 +26,11 @@ * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS research * program. * + * Portions of this software were 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: @@ -508,6 +514,8 @@ kern_msgctl(td, msqid, cmd, msqbuf) if (rpr == NULL) return (ENOSYS); + AUDIT_ARG_SVIPC_CMD(cmd); + AUDIT_ARG_SVIPC_ID(msqid); msqix = IPCID_TO_IX(msqid); if (msqix < 0 || msqix >= msginfo.msgmni) { @@ -579,6 +587,7 @@ kern_msgctl(td, msqid, cmd, msqbuf) break; case IPC_SET: + AUDIT_ARG_SVIPC_PERM(&msqbuf->msg_perm); if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_M))) goto done2; if (msqbuf->msg_qbytes > msqkptr->u.msg_qbytes) { @@ -667,6 +676,8 @@ sys_msgget(td, uap) error = EEXIST; goto done2; } + AUDIT_ARG_SVIPC_ID(IXSEQ_TO_IPCID(msqid, + msqkptr->u.msg_perm)); if ((error = ipcperm(td, &msqkptr->u.msg_perm, msgflg & 0700))) { DPRINTF(("requester doesn't have 0%o access\n", @@ -735,6 +746,7 @@ sys_msgget(td, uap) #ifdef MAC mac_sysvmsq_create(cred, msqkptr); #endif + AUDIT_ARG_SVIPC_PERM(&msqkptr->u.msg_perm); } else { DPRINTF(("didn't find it and wasn't asked to create it\n")); error = ENOENT; @@ -780,6 +792,7 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf return (ENOSYS); mtx_lock(&msq_mtx); + AUDIT_ARG_SVIPC_ID(msqid); msqix = IPCID_TO_IX(msqid); if (msqix < 0 || msqix >= msginfo.msgmni) { @@ -790,6 +803,7 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf } msqkptr = &msqids[msqix]; + AUDIT_ARG_SVIPC_PERM(&msqkptr->u.msg_perm); if (msqkptr->u.msg_qbytes == 0) { DPRINTF(("no such message queue id\n")); error = EINVAL; @@ -1152,6 +1166,7 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt if (rpr == NULL) return (ENOSYS); + AUDIT_ARG_SVIPC_ID(msqid); msqix = IPCID_TO_IX(msqid); if (msqix < 0 || msqix >= msginfo.msgmni) { @@ -1162,6 +1177,7 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt msqkptr = &msqids[msqix]; mtx_lock(&msq_mtx); + AUDIT_ARG_SVIPC_PERM(&msqkptr->u.msg_perm); if (msqkptr->u.msg_qbytes == 0) { DPRINTF(("no such message queue id\n")); error = EINVAL; Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Thu Mar 30 22:00:58 2017 (r316307) +++ head/sys/kern/sysv_sem.c Thu Mar 30 22:26:15 2017 (r316308) @@ -7,6 +7,7 @@ */ /*- * Copyright (c) 2003-2005 McAfee, Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * * This software was developed for the FreeBSD Project in part by McAfee @@ -14,6 +15,11 @@ * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS research * program. * + * Portions of this software were 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: @@ -691,6 +697,9 @@ kern_semctl(struct thread *td, int semid DPRINTF(("call to semctl(%d, %d, %d, 0x%p)\n", semid, semnum, cmd, arg)); + AUDIT_ARG_SVIPC_CMD(cmd); + AUDIT_ARG_SVIPC_ID(semid); + rpr = sem_find_prison(td->td_ucred); if (sem == NULL) return (ENOSYS); @@ -758,6 +767,7 @@ kern_semctl(struct thread *td, int semid break; case IPC_SET: + AUDIT_ARG_SVIPC_PERM(&arg->buf->sem_perm); if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_M))) @@ -948,6 +958,8 @@ sys_semget(struct thread *td, struct sem DPRINTF(("semget(0x%x, %d, 0%o)\n", key, nsems, semflg)); + AUDIT_ARG_VALUE(semflg); + if (sem_find_prison(cred) == NULL) return (ENOSYS); @@ -961,6 +973,7 @@ sys_semget(struct thread *td, struct sem break; } if (semid < seminfo.semmni) { + AUDIT_ARG_SVIPC_ID(semid); DPRINTF(("found public key\n")); if ((semflg & IPC_CREAT) && (semflg & IPC_EXCL)) { DPRINTF(("not exclusive\n")); @@ -1090,6 +1103,8 @@ sys_semop(struct thread *td, struct semo #endif DPRINTF(("call to semop(%d, %p, %u)\n", semid, sops, nsops)); + AUDIT_ARG_SVIPC_ID(semid); + rpr = sem_find_prison(td->td_ucred); if (sem == NULL) return (ENOSYS); Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Thu Mar 30 22:00:58 2017 (r316307) +++ head/sys/kern/sysv_shm.c Thu Mar 30 22:26:15 2017 (r316308) @@ -30,6 +30,7 @@ */ /*- * Copyright (c) 2003-2005 McAfee, Inc. + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * * This software was developed for the FreeBSD Project in part by McAfee @@ -37,6 +38,11 @@ * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS research * program. * + * Portions of this software were 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: @@ -324,8 +330,10 @@ kern_shmdt_locked(struct thread *td, con { struct proc *p = td->td_proc; struct shmmap_state *shmmap_s; -#ifdef MAC +#if defined(AUDIT) || defined(MAC) struct shmid_kernel *shmsegptr; +#endif +#ifdef MAC int error; #endif int i; @@ -336,6 +344,7 @@ kern_shmdt_locked(struct thread *td, con shmmap_s = p->p_vmspace->vm_shm; if (shmmap_s == NULL) return (EINVAL); + AUDIT_ARG_SVIPC_ID(shmmap_s->shmid); for (i = 0; i < shminfo.shmseg; i++, shmmap_s++) { if (shmmap_s->shmid != -1 && shmmap_s->va == (vm_offset_t)shmaddr) { @@ -344,8 +353,10 @@ kern_shmdt_locked(struct thread *td, con } if (i == shminfo.shmseg) return (EINVAL); -#ifdef MAC +#if (defined(AUDIT) && defined(KDTRACE_HOOKS)) || defined(MAC) shmsegptr = &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]; +#endif +#ifdef MAC error = mac_sysvshm_check_shmdt(td->td_ucred, shmsegptr); if (error != 0) return (error); @@ -382,6 +393,9 @@ kern_shmat_locked(struct thread *td, int vm_size_t size; int error, i, rv; + AUDIT_ARG_SVIPC_ID(shmid); + AUDIT_ARG_VALUE(shmflg); + SYSVSHM_ASSERT_LOCKED(); rpr = shm_find_prison(td->td_ucred); if (rpr == NULL) @@ -493,6 +507,9 @@ kern_shmctl_locked(struct thread *td, in if (rpr == NULL) return (ENOSYS); + AUDIT_ARG_SVIPC_ID(shmid); + AUDIT_ARG_SVIPC_CMD(cmd); + switch (cmd) { /* * It is possible that kern_shmctl is being called from the Linux ABI @@ -550,6 +567,7 @@ kern_shmctl_locked(struct thread *td, in break; case IPC_SET: shmidp = (struct shmid_ds *)buf; + AUDIT_ARG_SVIPC_PERM(&shmidp->shm_perm); error = ipcperm(td, &shmseg->u.shm_perm, IPC_M); if (error != 0) return (error); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Thu Mar 30 22:00:58 2017 (r316307) +++ head/sys/security/audit/audit.h Thu Mar 30 22:26:15 2017 (r316308) @@ -239,6 +239,11 @@ void audit_thread_free(struct thread *t audit_arg_pid((pid)); \ } while (0) +#define AUDIT_ARG_POSIX_IPC_PERM(uid, gid, mode) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_posix_ipc_perm((uid), (gid), (mod)); \ +} while (0) + #define AUDIT_ARG_PROCESS(p) do { \ if (AUDITING_TD(curthread)) \ audit_arg_process((p)); \ @@ -289,6 +294,26 @@ void audit_thread_free(struct thread *t audit_arg_suid((suid)); \ } while (0) +#define AUDIT_ARG_SVIPC_CMD(cmd) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_svipc_cmd((cmd)); \ +} while (0) + +#define AUDIT_ARG_SVIPC_PERM(perm) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_svipc_perm((perm)); \ +} while (0) + +#define AUDIT_ARG_SVIPC_ID(id) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_svipc_id((id)); \ +} while (0) + +#define AUDIT_ARG_SVIPC_ADDR(addr) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_svipc_addr((addr)); \ +} while (0) + #define AUDIT_ARG_SVIPC_WHICH(which) do { \ if (AUDITING_TD(curthread)) \ audit_arg_svipc_which((which)); \ @@ -375,6 +400,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_MODE(mode) #define AUDIT_ARG_OWNER(uid, gid) #define AUDIT_ARG_PID(pid) +#define AUDIT_ARG_POSIX_IPC_PERM(uid, gid, mode) #define AUDIT_ARG_PROCESS(p) #define AUDIT_ARG_RGID(rgid) #define AUDIT_ARG_RIGHTS(rights) @@ -385,6 +411,10 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_SOCKET(sodomain, sotype, soprotocol) #define AUDIT_ARG_SOCKADDR(td, dirfd, sa) #define AUDIT_ARG_SUID(suid) +#define AUDIT_ARG_SVIPC_CMD(cmd) +#define AUDIT_ARG_SVIPC_PERM(perm) +#define AUDIT_ARG_SVIPC_ID(id) +#define AUDIT_ARG_SVIPC_ADDR(addr) #define AUDIT_ARG_SVIPC_WHICH(which) #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) From owner-svn-src-all@freebsd.org Thu Mar 30 22:44:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2350D26454; Thu, 30 Mar 2017 22:44:49 +0000 (UTC) (envelope-from davidcs@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 802BC1A8; Thu, 30 Mar 2017 22:44:49 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UMhXPL011409; Thu, 30 Mar 2017 22:43:33 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UMhX2s011405; Thu, 30 Mar 2017 22:43:33 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201703302243.v2UMhX2s011405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 30 Mar 2017 22:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316309 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 22:44:49 -0000 Author: davidcs Date: Thu Mar 30 22:43:32 2017 New Revision: 316309 URL: https://svnweb.freebsd.org/changeset/base/316309 Log: Add support for optional Soft LRO MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Thu Mar 30 22:26:15 2017 (r316308) +++ head/sys/dev/qlxgbe/ql_hw.c Thu Mar 30 22:43:32 2017 (r316309) @@ -440,6 +440,17 @@ ql_hw_add_sysctls(qla_host_t *ha) OID_AUTO, "enable_9kb", CTLFLAG_RW, &ha->hw.enable_9kb, ha->hw.enable_9kb, "Enable 9Kbyte Buffers when MTU = 9000"); + ha->hw.enable_hw_lro = 1; + + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "enable_hw_lro", CTLFLAG_RW, &ha->hw.enable_hw_lro, + ha->hw.enable_hw_lro, "Enable Hardware LRO; Default is true \n" + "\t 1 : Hardware LRO if LRO is enabled\n" + "\t 0 : Software LRO if LRO is enabled\n" + "\t Any change requires ifconfig down/up to take effect\n" + "\t Note that LRO may be turned off/on via ifconfig\n"); + ha->hw.mdump_active = 0; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -2255,6 +2266,83 @@ qla_config_rss_ind_table(qla_host_t *ha) return (0); } +static int +qla_config_soft_lro(qla_host_t *ha) +{ + int i; + qla_hw_t *hw = &ha->hw; + struct lro_ctrl *lro; + + for (i = 0; i < hw->num_sds_rings; i++) { + lro = &hw->sds[i].lro; + + bzero(lro, sizeof(struct lro_ctrl)); + +#if (__FreeBSD_version >= 1100101) + if (tcp_lro_init_args(lro, ha->ifp, 0, NUM_RX_DESCRIPTORS)) { + device_printf(ha->pci_dev, + "%s: tcp_lro_init_args [%d] failed\n", + __func__, i); + return (-1); + } +#else + if (tcp_lro_init(lro)) { + device_printf(ha->pci_dev, + "%s: tcp_lro_init [%d] failed\n", + __func__, i); + return (-1); + } +#endif /* #if (__FreeBSD_version >= 1100101) */ + + lro->ifp = ha->ifp; + } + + QL_DPRINT2(ha, (ha->pci_dev, "%s: LRO initialized\n", __func__)); + return (0); +} + +static void +qla_drain_soft_lro(qla_host_t *ha) +{ + int i; + qla_hw_t *hw = &ha->hw; + struct lro_ctrl *lro; + + for (i = 0; i < hw->num_sds_rings; i++) { + lro = &hw->sds[i].lro; + +#if (__FreeBSD_version >= 1100101) + tcp_lro_flush_all(lro); +#else + struct lro_entry *queued; + + while ((!SLIST_EMPTY(&lro->lro_active))) { + queued = SLIST_FIRST(&lro->lro_active); + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } +#endif /* #if (__FreeBSD_version >= 1100101) */ + } + + return; +} + +static void +qla_free_soft_lro(qla_host_t *ha) +{ + int i; + qla_hw_t *hw = &ha->hw; + struct lro_ctrl *lro; + + for (i = 0; i < hw->num_sds_rings; i++) { + lro = &hw->sds[i].lro; + tcp_lro_free(lro); + } + + return; +} + + /* * Name: ql_del_hw_if * Function: Destroys the hardware specific entities corresponding to an @@ -2287,6 +2375,11 @@ ql_del_hw_if(qla_host_t *ha) ha->hw.flags.init_intr_cnxt = 0; } + if (ha->hw.enable_soft_lro) { + qla_drain_soft_lro(ha); + qla_free_soft_lro(ha); + } + return; } @@ -2309,7 +2402,6 @@ qla_confirm_9kb_enable(qla_host_t *ha) return; } - /* * Name: ql_init_hw_if * Function: Creates the hardware specific entities corresponding to an @@ -2416,8 +2508,19 @@ ql_init_hw_if(qla_host_t *ha) if (qla_link_event_req(ha, ha->hw.rcv_cntxt_id)) return (-1); - if (qla_config_fw_lro(ha, ha->hw.rcv_cntxt_id)) - return (-1); + if (ha->ifp->if_capenable & IFCAP_LRO) { + if (ha->hw.enable_hw_lro) { + ha->hw.enable_soft_lro = 0; + + if (qla_config_fw_lro(ha, ha->hw.rcv_cntxt_id)) + return (-1); + } else { + ha->hw.enable_soft_lro = 1; + + if (qla_config_soft_lro(ha)) + return (-1); + } + } if (qla_init_nic_func(ha)) return (-1); Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Thu Mar 30 22:26:15 2017 (r316308) +++ head/sys/dev/qlxgbe/ql_hw.h Thu Mar 30 22:43:32 2017 (r316309) @@ -1674,6 +1674,8 @@ typedef struct _qla_hw { uint32_t max_tx_segs; uint32_t min_lro_pkt_size; + uint32_t enable_hw_lro; + uint32_t enable_soft_lro; uint32_t enable_9kb; uint32_t user_pri_nic; Modified: head/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- head/sys/dev/qlxgbe/ql_isr.c Thu Mar 30 22:26:15 2017 (r316308) +++ head/sys/dev/qlxgbe/ql_isr.c Thu Mar 30 22:43:32 2017 (r316309) @@ -68,6 +68,9 @@ qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_ uint32_t i, rem_len = 0; uint32_t r_idx = 0; qla_rx_ring_t *rx_ring; + struct lro_ctrl *lro; + + lro = &ha->hw.sds[sds_idx].lro; if (ha->hw.num_rds_rings > 1) r_idx = sds_idx; @@ -166,7 +169,22 @@ qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_ M_HASHTYPE_SET(mpf, M_HASHTYPE_NONE); #endif /* #if __FreeBSD_version >= 1100000 */ - (*ifp->if_input)(ifp, mpf); + if (ha->hw.enable_soft_lro) { + +#if (__FreeBSD_version >= 1100101) + + tcp_lro_queue_mbuf(lro, mpf); + +#else + if (tcp_lro_rx(lro, mpf, 0)) + (*ifp->if_input)(ifp, mpf); + +#endif /* #if (__FreeBSD_version >= 1100101) */ + + + } else { + (*ifp->if_input)(ifp, mpf); + } if (sdsp->rx_free > ha->std_replenish) qla_replenish_normal_rx(ha, sdsp, r_idx); @@ -707,6 +725,28 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_ } } + if (ha->hw.enable_soft_lro) { + struct lro_ctrl *lro; + + lro = &ha->hw.sds[sds_idx].lro; + +#if (__FreeBSD_version >= 1100101) + + tcp_lro_flush_all(lro); + +#else + struct lro_entry *queued; + + while ((!SLIST_EMPTY(&lro->lro_active))) { + queued = SLIST_FIRST(&lro->lro_active); + SLIST_REMOVE_HEAD(&lro->lro_active, next); + tcp_lro_flush(lro, queued); + } + +#endif /* #if (__FreeBSD_version >= 1100101) */ + + } + if (ha->flags.stop_rcv) goto ql_rcv_isr_exit; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Thu Mar 30 22:26:15 2017 (r316308) +++ head/sys/dev/qlxgbe/ql_os.c Thu Mar 30 22:43:32 2017 (r316309) @@ -1072,6 +1072,8 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; if (mask & IFCAP_VLAN_HWTSO) ifp->if_capenable ^= IFCAP_VLAN_HWTSO; + if (mask & IFCAP_LRO) + ifp->if_capenable ^= IFCAP_LRO; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) qla_init(ha); @@ -1497,7 +1499,6 @@ qla_qflush(struct ifnet *ifp) return; } - static void qla_stop(qla_host_t *ha) { From owner-svn-src-all@freebsd.org Thu Mar 30 23:02:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6C82D26883; Thu, 30 Mar 2017 23:02:33 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id B8F3BDDC; Thu, 30 Mar 2017 23:02:33 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 095701767E; Thu, 30 Mar 2017 16:02:28 -0700 (PDT) Date: Thu, 30 Mar 2017 16:02:27 -0700 From: hiren panchasara To: David C Somayajulu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316309 - head/sys/dev/qlxgbe Message-ID: <20170330230227.GH1016@strugglingcoder.info> References: <201703302243.v2UMhX2s011405@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1QGDfz3Tkbtkncdd" Content-Disposition: inline In-Reply-To: <201703302243.v2UMhX2s011405@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 23:02:33 -0000 --1QGDfz3Tkbtkncdd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/30/17 at 10:43P, David C Somayajulu wrote: > Author: davidcs > Date: Thu Mar 30 22:43:32 2017 > New Revision: 316309 > URL: https://svnweb.freebsd.org/changeset/base/316309 >=20 > Log: > Add support for optional Soft LRO Hi David, I know this is not a new topic but a little more descriptive commit-log would have been nicer. Also, you should update the manpage reflecting this change. i.e. now it also supports software LRO when h/w LRO is disabled. Do you know of a case where one would want to disable h/w lro and enable s/w lro? I guess where you want to free up nic and make cpu do more work? Cheers, Hiren --1QGDfz3Tkbtkncdd Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJY3Y6BXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lFBsH+QEjnM1Jebfxpr/KDFfqbiO9 6+gZwShD2R/vCl74ZA99QQPxUUpQjsgKExRit2VpNkGyx1TftAd6nnvHXYHMTSTP KUox7TKhZew3WJW0wVs+A0alaR8m2J753gZXofZnPWYWKRtSw5FRTvz6E6sHcrp6 iumpM1vrYMAtt/G5LRnDTxsWB/Qvegt9bLHu+nw9D0hjS+u2wyJUYgSBqsCLUzzd Syn/t9+OBnO68Si4ONFbhLiphFE6BTqrDtoKEejj0npyRCAJTcN2S6/MVXnDHuC6 OQjuL0EnFndnLwpls/sd90FOTbvza7BZF/C/xfZazr6NC63C4RkNbbUHZaSpYdI= =RhTa -----END PGP SIGNATURE----- --1QGDfz3Tkbtkncdd-- From owner-svn-src-all@freebsd.org Thu Mar 30 23:07:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501CED26985; Thu, 30 Mar 2017 23:07:53 +0000 (UTC) (envelope-from David.Somayajulu@cavium.com) Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0070.outbound.protection.outlook.com [104.47.34.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1826CC5; Thu, 30 Mar 2017 23:07:51 +0000 (UTC) (envelope-from David.Somayajulu@cavium.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mYHR1Hl5VTlG7KTgdAUqTExngu5nv83l/zDi+EuCeN0=; b=evegxyL3hz8eTj3UzOzZ4BlOHxblCkycdb5Mgu6lSjYf7yyNyGwSCrCen3d+Cq7HXoxAiQB6gcbAPM1s7v7jMzaFuWk71Fyz7ZSmk60gdQAgJGBICC3g36+QKIc2/vMvIz78jtltp33k6MkNzJp9UUAJnRFaSB1qZdRk3UdMIa0= Received: from BY2PR07MB1474.namprd07.prod.outlook.com (10.162.76.152) by BY2PR07MB1473.namprd07.prod.outlook.com (10.162.76.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1005.10; Thu, 30 Mar 2017 23:07:50 +0000 Received: from BY2PR07MB1474.namprd07.prod.outlook.com ([10.162.76.152]) by BY2PR07MB1474.namprd07.prod.outlook.com ([10.162.76.152]) with mapi id 15.01.0977.021; Thu, 30 Mar 2017 23:07:50 +0000 From: "Somayajulu, David" To: hiren panchasara , David C Somayajulu CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r316309 - head/sys/dev/qlxgbe Thread-Topic: svn commit: r316309 - head/sys/dev/qlxgbe Thread-Index: AQHSqadk1yJwSnN9yEeerdOGAow+7qGuABeAgAAAWVA= Date: Thu, 30 Mar 2017 23:07:50 +0000 Message-ID: References: <201703302243.v2UMhX2s011405@repo.freebsd.org> <20170330230227.GH1016@strugglingcoder.info> In-Reply-To: <20170330230227.GH1016@strugglingcoder.info> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: strugglingcoder.info; dkim=none (message not signed) header.d=none;strugglingcoder.info; dmarc=none action=none header.from=cavium.com; x-originating-ip: [198.186.0.2] x-microsoft-exchange-diagnostics: 1; BY2PR07MB1473; 7:YS/ap+gQ2O9smiON4S6SPl+mLXT+m3YlLHnURxZVeBgxO/FPn/g6CH2cldqOZRBBfT/Oo4Zd1hyUr8Xgf6+7CroPvYFkrdXZmaFBApiFB2uL4Blo4Kw0u2vd2642aTnkBAmiQvcBilPKUCOVwvp5CPI9oKV3M0Y1xqpjpwePE7bJKZgCU7E3dBmRLvfqkKER33vOSJe2b0+Ne/oX9T7WZEzXj46wrOktm8qXP85QxrLRA+MyIHmf7DZRtBbdFxYIe4bINjq6aLvS5gUVYcHpVAHG+6HbjwH0XP+VN1ih86QtijuTalqBbezvNTbMWupEmIVS7kVLNPmNKKQJHH87Zg== x-ms-office365-filtering-correlation-id: 223a54fc-00be-4c80-6492-08d477c196b6 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:BY2PR07MB1473; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(10201501046)(93006077)(93001077)(3002001)(6041248)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(6072148); SRVR:BY2PR07MB1473; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB1473; x-forefront-prvs: 02622CEF0A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(39850400002)(13464003)(377454003)(24454002)(3660700001)(8936002)(3280700002)(74316002)(2906002)(6306002)(8676002)(122556002)(53936002)(2950100002)(55016002)(2900100001)(86362001)(77096006)(6506006)(54906002)(99286003)(6436002)(81166006)(9686003)(7696004)(5660300001)(4326008)(189998001)(6116002)(7736002)(33656002)(6246003)(76176999)(38730400002)(50986999)(54356999)(229853002)(66066001)(25786009)(53546009)(305945005)(3846002)(102836003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB1473; H:BY2PR07MB1474.namprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2017 23:07:50.4980 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB1473 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 23:07:53 -0000 Hi Hiren, > I know this is not a new topic but a little more descriptive commit-log w= ould have been nicer. Also, you should update the manpage reflecting this c= hange. i.e. now it also supports software LRO when h/w LRO is disabled. Will do. Sorry about that. > Do you know of a case where one would want to disable h/w lro and enable = s/w lro? I guess where you want to free up nic and make cpu do more work? I was under the impression as well, that s/w lro is moot, if h/w lro was av= ailable, till one costumer asked for it. Not sure what the use case is. Thanks David S. -----Original Message----- From: hiren panchasara [mailto:hiren@strugglingcoder.info]=20 Sent: Thursday, March 30, 2017 4:02 PM To: David C Somayajulu Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r316309 - head/sys/dev/qlxgbe On 03/30/17 at 10:43P, David C Somayajulu wrote: > Author: davidcs > Date: Thu Mar 30 22:43:32 2017 > New Revision: 316309 > URL: https://svnweb.freebsd.org/changeset/base/316309 >=20 > Log: > Add support for optional Soft LRO Hi David, I know this is not a new topic but a little more descriptive commit-log wou= ld have been nicer. Also, you should update the manpage reflecting this cha= nge. i.e. now it also supports software LRO when h/w LRO is disabled. Do you know of a case where one would want to disable h/w lro and enable s/= w lro? I guess where you want to free up nic and make cpu do more work? Cheers, Hiren From owner-svn-src-all@freebsd.org Thu Mar 30 23:11:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E710D26AE3; Thu, 30 Mar 2017 23:11:59 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 0DFC7772; Thu, 30 Mar 2017 23:11:58 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 1089117699; Thu, 30 Mar 2017 16:11:59 -0700 (PDT) Date: Thu, 30 Mar 2017 16:11:58 -0700 From: hiren panchasara To: "Somayajulu, David" Cc: David C Somayajulu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r316309 - head/sys/dev/qlxgbe Message-ID: <20170330231158.GI1016@strugglingcoder.info> References: <201703302243.v2UMhX2s011405@repo.freebsd.org> <20170330230227.GH1016@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ljn2+zwPkKedfiv/" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 23:11:59 -0000 --ljn2+zwPkKedfiv/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 03/30/17 at 11:07P, Somayajulu, David wrote: > Hi Hiren, > > I know this is not a new topic but a little more descriptive commit-log= would have been nicer. Also, you should update the manpage reflecting this= change. i.e. now it also supports software LRO when h/w LRO is disabled. > Will do. Sorry about that. Thanks! >=20 > > Do you know of a case where one would want to disable h/w lro and enabl= e s/w lro? I guess where you want to free up nic and make cpu do more work? > I was under the impression as well, that s/w lro is moot, if h/w lro was = available, till one costumer asked for it. Not sure what the use case is. I thought this idea (like gro in linux) was popular when lro in h/w was considered buggy and couldn't correctly do batching (i.e. hide useful flags). Not sure if that's still the case. cheers, Hiren --ljn2+zwPkKedfiv/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJY3ZC+XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lCgQH/jfRoG25lozt00G2gitCANGU BA99S8nGiUq2VvmPnTDgs5tagyCn4XU3vpj8kXklUFXEZIByE/+t1QcwTsmYktHe MJd/bRDMj4FaLi5G+4bI02T1GsbiyI+XzKDXYL5MvLD508LBcScMh9MBIjWyAV4i EF9YrXIQc7EvQu2s5UjJb2zEjz8J6NOrUOBIRkzB54Xfczgz+7I7BcjU+hcAIquM Bbj2b7Yf/njm50NgyB/VOXDYiJ7uagscohkbl2YkQ6mzqLrtFPm0VekFtWfUlOW2 PsTNMgiN5DzUrq8ZeqdgU4nJS3BZcwOu7a05ykqZyq3lCBneT93xiN2NbDDzmws= =bbC6 -----END PGP SIGNATURE----- --ljn2+zwPkKedfiv/-- From owner-svn-src-all@freebsd.org Thu Mar 30 23:39:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBB71D26631; Thu, 30 Mar 2017 23:39:20 +0000 (UTC) (envelope-from David.Somayajulu@cavium.com) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0077.outbound.protection.outlook.com [104.47.33.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 851EEF01; Thu, 30 Mar 2017 23:39:19 +0000 (UTC) (envelope-from David.Somayajulu@cavium.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=p2lQSkeie4tVILr+8alO+8bujutriC6OEWk+UZAVzic=; b=NpA5sVTrmjT+j/ZeQQtqAfP+wjkuNj8PfEMKJLdwHJ3Jpn0pmXtfwmOpKouqaSzAgDKlVICQ4Zo27QJzYiT8ZAX0CvAPRMlYXdtUoZ8hpnsiM2TUV3c6AUP6jTuPJDup547kh/m6kDiNIgjBZx9jG1dz9siCFgNENmsVRMoD+z0= Received: from BY2PR07MB1474.namprd07.prod.outlook.com (10.162.76.152) by BY2PR07MB1474.namprd07.prod.outlook.com (10.162.76.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Thu, 30 Mar 2017 23:39:16 +0000 Received: from BY2PR07MB1474.namprd07.prod.outlook.com ([10.162.76.152]) by BY2PR07MB1474.namprd07.prod.outlook.com ([10.162.76.152]) with mapi id 15.01.0977.021; Thu, 30 Mar 2017 23:39:16 +0000 From: "Somayajulu, David" To: hiren panchasara CC: David C Somayajulu , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r316309 - head/sys/dev/qlxgbe Thread-Topic: svn commit: r316309 - head/sys/dev/qlxgbe Thread-Index: AQHSqadk1yJwSnN9yEeerdOGAow+7qGuABeAgAAAWVCAAAJQAIAABJzA Date: Thu, 30 Mar 2017 23:39:16 +0000 Message-ID: References: <201703302243.v2UMhX2s011405@repo.freebsd.org> <20170330230227.GH1016@strugglingcoder.info> <20170330231158.GI1016@strugglingcoder.info> In-Reply-To: <20170330231158.GI1016@strugglingcoder.info> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: strugglingcoder.info; dkim=none (message not signed) header.d=none;strugglingcoder.info; dmarc=none action=none header.from=cavium.com; x-originating-ip: [198.186.0.2] x-microsoft-exchange-diagnostics: 1; BY2PR07MB1474; 7:6m75PpSEXKUiOdNi6C2bY2fd3LW4s6E0NoslPXYqfy9c44CeNso9tLjGtXc5fxqnu3fpwVrZAT7EEwkNAZX53GNAoNATwW12C+vL1XUjzrgAe1Vq0aW/O7H7Bi9uNq7fM5b5WswN8Vi67IXXZT2BGcbEefkVLm/rGnBCgjMpTgAk2zx1hxn1nu6Nt+07SgCzB101n2J2KNyuILclG8UtDYF+F5Elo+2thDrr3JNfynddbCXHnMamj/3iiZUGzyaqHfNeNLE2E0SkbUlyqyGbCa3iQTP/kETkNqX/MSU8XE4DrKF18mpfCEJFrW7ttDJzeMXEzFanx5X6SFkZ9pKW2g== x-ms-office365-filtering-correlation-id: a71e87c9-6d12-4123-3ae1-08d477c5fadf x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR07MB1474; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(20161123564025)(6072148); SRVR:BY2PR07MB1474; BCL:0; PCL:0; RULEID:; SRVR:BY2PR07MB1474; x-forefront-prvs: 02622CEF0A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39850400002)(39450400003)(39410400002)(39840400002)(39400400002)(24454002)(377454003)(13464003)(4326008)(86362001)(7696004)(76176999)(66066001)(54356999)(74316002)(2906002)(50986999)(6916009)(3280700002)(305945005)(93886004)(7736002)(3660700001)(2950100002)(33656002)(9686003)(55016002)(99286003)(54906002)(53936002)(189998001)(122556002)(229853002)(110136004)(38730400002)(77096006)(6246003)(6506006)(2900100001)(6436002)(81166006)(53546009)(8936002)(8676002)(102836003)(6116002)(5660300001)(3846002)(25786009); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR07MB1474; H:BY2PR07MB1474.namprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Mar 2017 23:39:16.5403 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR07MB1474 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 23:39:21 -0000 >> > I know this is not a new topic but a little more descriptive commit-lo= g would have been nicer. Also, you should update the manpage reflecting thi= s change. i.e. now it also supports software LRO when h/w LRO is disabled. >> Will do. Sorry about that. Minor correction. Please note that the driver provides the ability to choos= e between SoftwareLRO and HW LRO, when LRO is enabled - it is HW LRO by def= ault. If LRO is turned off via ifconfig, neither Software nor HW LRO is ena= bled. Cheers David S. -----Original Message----- From: hiren panchasara [mailto:hiren@strugglingcoder.info]=20 Sent: Thursday, March 30, 2017 4:12 PM To: Somayajulu, David Cc: David C Somayajulu ; src-committers@freebsd.org; s= vn-src-all@freebsd.org; svn-src-head@freebsd.org Subject: Re: svn commit: r316309 - head/sys/dev/qlxgbe On 03/30/17 at 11:07P, Somayajulu, David wrote: > Hi Hiren, > > I know this is not a new topic but a little more descriptive commit-log= would have been nicer. Also, you should update the manpage reflecting this= change. i.e. now it also supports software LRO when h/w LRO is disabled. > Will do. Sorry about that. Thanks! >=20 > > Do you know of a case where one would want to disable h/w lro and enabl= e s/w lro? I guess where you want to free up nic and make cpu do more work? > I was under the impression as well, that s/w lro is moot, if h/w lro was = available, till one costumer asked for it. Not sure what the use case is. I thought this idea (like gro in linux) was popular when lro in h/w was con= sidered buggy and couldn't correctly do batching (i.e. hide useful flags). = Not sure if that's still the case. cheers, Hiren From owner-svn-src-all@freebsd.org Thu Mar 30 23:49:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0980D26A7F; Thu, 30 Mar 2017 23:49:58 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B4A833; Thu, 30 Mar 2017 23:49:58 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2UNnv0O035464; Thu, 30 Mar 2017 23:49:57 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2UNnvOK035463; Thu, 30 Mar 2017 23:49:57 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201703302349.v2UNnvOK035463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 30 Mar 2017 23:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316310 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Mar 2017 23:49:59 -0000 Author: davidcs Date: Thu Mar 30 23:49:57 2017 New Revision: 316310 URL: https://svnweb.freebsd.org/changeset/base/316310 Log: Update man page for commit r316309 "Add support for optional Soft LRO". The driver provides the ability to select either HW or Software LRO, when LRO is enabled (default HW LRO). MFC after:5 days Modified: head/share/man/man4/qlxgbe.4 Modified: head/share/man/man4/qlxgbe.4 ============================================================================== --- head/share/man/man4/qlxgbe.4 Thu Mar 30 22:43:32 2017 (r316309) +++ head/share/man/man4/qlxgbe.4 Thu Mar 30 23:49:57 2017 (r316310) @@ -52,7 +52,8 @@ driver supports IPv4 checksum offload, TCP and UDP checksum offload for both IPv4 and IPv6, Large Segment Offload for both IPv4 and IPv6, Jumbo frames, VLAN Tag, and -Receive Side scaling. +Receive Side scaling, ability to select either HW or Software LRO, +when LRO is enabled (default HW LRO). For further hardware information, see .Pa http://www.qlogic.com/ . .Sh HARDWARE From owner-svn-src-all@freebsd.org Fri Mar 31 00:04:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3C95D222B3; Fri, 31 Mar 2017 00:04:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AF3D396; Fri, 31 Mar 2017 00:04:34 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V04XcV043459; Fri, 31 Mar 2017 00:04:33 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V04W3A043449; Fri, 31 Mar 2017 00:04:32 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201703310004.v2V04W3A043449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 31 Mar 2017 00:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 00:04:34 -0000 Author: allanjude Date: Fri Mar 31 00:04:32 2017 New Revision: 316311 URL: https://svnweb.freebsd.org/changeset/base/316311 Log: Add explicit_bzero() to libstand, and switch GELIBoot to using it Make sure sensitive memory is properly cleared when finished with it Reviewed by: Eric McCorkle Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D9798 Modified: head/lib/libstand/Makefile head/sys/boot/geli/Makefile head/sys/boot/geli/geliboot.c head/sys/boot/geli/geliboot.h head/sys/boot/geli/geliboot_crypto.c head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/loader/main.c head/sys/boot/i386/zfsboot/zfsboot.c Modified: head/lib/libstand/Makefile ============================================================================== --- head/lib/libstand/Makefile Thu Mar 30 23:49:57 2017 (r316310) +++ head/lib/libstand/Makefile Fri Mar 31 00:04:32 2017 (r316311) @@ -155,5 +155,9 @@ SRCS+= pkgfs.c SRCS+= nandfs.c .endif +# explicit_bzero +.PATH: ${SRCTOP}/sys/libkern +SRCS+= explicit_bzero.c + .include .include Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/geli/Makefile Fri Mar 31 00:04:32 2017 (r316311) @@ -24,10 +24,6 @@ WARNS?= 0 .PATH: ${.CURDIR}/../../../lib/libc/string SRCS+= bcmp.c bcopy.c bzero.c -# need explicit_bzero for crypto -.PATH: ${.CURDIR}/../../../sys/libkern -SRCS+= explicit_bzero.c - # Our password input method SRCS+= pwgets.c Modified: head/sys/boot/geli/geliboot.c ============================================================================== --- head/sys/boot/geli/geliboot.c Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/geli/geliboot.c Fri Mar 31 00:04:32 2017 (r316311) @@ -173,19 +173,19 @@ geli_attach(struct dsk *dskp, const char sizeof(geli_e->md.md_salt), passphrase, geli_e->md.md_iterations); g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); - bzero(&dkey, sizeof(dkey)); + explicit_bzero(dkey, sizeof(dkey)); } g_eli_crypto_hmac_final(&ctx, key, 0); error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); - bzero(&key, sizeof(key)); + explicit_bzero(key, sizeof(key)); if (error == -1) { - bzero(&mkey, sizeof(mkey)); + explicit_bzero(mkey, sizeof(mkey)); printf("Bad GELI key: %d\n", error); return (error); } else if (error != 0) { - bzero(&mkey, sizeof(mkey)); + explicit_bzero(mkey, sizeof(mkey)); printf("Failed to decrypt GELI master key: %d\n", error); return (error); } @@ -203,7 +203,7 @@ geli_attach(struct dsk *dskp, const char g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, "\x10", 1, geli_e->sc.sc_ekey, 0); } - bzero(&mkey, sizeof(mkey)); + explicit_bzero(mkey, sizeof(mkey)); /* Initialize the per-sector IV. */ switch (geli_e->sc.sc_ealgo) { @@ -279,13 +279,13 @@ geli_read(struct dsk *dskp, off_t offset geli_e->sc.sc_ekeylen, iv); if (error != 0) { - bzero(&gkey, sizeof(gkey)); + explicit_bzero(&gkey, sizeof(gkey)); printf("Failed to decrypt in geli_read()!"); return (error); } pbuf += secsize; } - bzero(&gkey, sizeof(gkey)); + explicit_bzero(&gkey, sizeof(gkey)); return (0); } Modified: head/sys/boot/geli/geliboot.h ============================================================================== --- head/sys/boot/geli/geliboot.h Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/geli/geliboot.h Fri Mar 31 00:04:32 2017 (r316311) @@ -36,6 +36,7 @@ #define _STRING_H_ #define _STRINGS_H_ #define _STDIO_H_ + #include #include Modified: head/sys/boot/geli/geliboot_crypto.c ============================================================================== --- head/sys/boot/geli/geliboot_crypto.c Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/geli/geliboot_crypto.c Fri Mar 31 00:04:32 2017 (r316311) @@ -110,7 +110,7 @@ g_eli_crypto_cipher(u_int algo, int enc, { u_char iv[keysize]; - bzero(iv, sizeof(iv)); + explicit_bzero(iv, sizeof(iv)); return (geliboot_crypt(algo, enc, data, datasize, key, keysize, iv)); } Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/i386/gptboot/gptboot.c Fri Mar 31 00:04:32 2017 (r316311) @@ -481,7 +481,7 @@ load(void) #ifdef LOADER_GELI_SUPPORT geliargs.size = sizeof(geliargs); bcopy(gelipw, geliargs.gelipw, sizeof(geliargs.gelipw)); - bzero(gelipw, sizeof(gelipw)); + explicit_bzero(gelipw, sizeof(gelipw)); #endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/i386/loader/main.c Fri Mar 31 00:04:32 2017 (r316311) @@ -175,7 +175,7 @@ main(void) if (zargs != NULL && zargs->size >= offsetof(struct zfs_boot_args, gelipw)) { if (zargs->gelipw[0] != '\0') { setenv("kern.geom.eli.passphrase", zargs->gelipw, 1); - bzero(zargs->gelipw, sizeof(zargs->gelipw)); + explicit_bzero(zargs->gelipw, sizeof(zargs->gelipw)); } } } @@ -187,7 +187,7 @@ main(void) if (gargs != NULL && gargs->size >= offsetof(struct geli_boot_args, gelipw)) { if (gargs->gelipw[0] != '\0') { setenv("kern.geom.eli.passphrase", gargs->gelipw, 1); - bzero(gargs->gelipw, sizeof(gargs->gelipw)); + explicit_bzero(gargs->gelipw, sizeof(gargs->gelipw)); } } } Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Thu Mar 30 23:49:57 2017 (r316310) +++ head/sys/boot/i386/zfsboot/zfsboot.c Fri Mar 31 00:04:32 2017 (r316311) @@ -926,7 +926,7 @@ load(void) zfsargs.primary_pool = primary_spa->spa_guid; #ifdef LOADER_GELI_SUPPORT bcopy(gelipw, zfsargs.gelipw, sizeof(zfsargs.gelipw)); - bzero(gelipw, sizeof(gelipw)); + explicit_bzero(gelipw, sizeof(gelipw)); #else zfsargs.gelipw[0] = '\0'; #endif From owner-svn-src-all@freebsd.org Fri Mar 31 00:08:20 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07739D223AC; Fri, 31 Mar 2017 00:08:20 +0000 (UTC) (envelope-from allanjude@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 BD262850; Fri, 31 Mar 2017 00:08:19 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V073IT043878; Fri, 31 Mar 2017 00:07:03 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V073nn043874; Fri, 31 Mar 2017 00:07:03 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201703310007.v2V073nn043874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 31 Mar 2017 00:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316312 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 00:08:20 -0000 Author: allanjude Date: Fri Mar 31 00:07:03 2017 New Revision: 316312 URL: https://svnweb.freebsd.org/changeset/base/316312 Log: sys/geom/eli: Switch bzero() to explicit_bzero() for sensitive data In GELI, anywhere we are zeroing out possibly sensitive data, like the metadata struct, the metadata sector (both contain the encrypted master key), the user key, or the master key, use explicit_bzero. Didn't touch the bzero() used to initialize structs. Reviewed by: delphij, oshogbo Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D9809 Modified: head/sys/geom/eli/g_eli_ctl.c head/sys/geom/eli/g_eli_key.c head/sys/geom/eli/g_eli_key_cache.c Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Fri Mar 31 00:04:32 2017 (r316311) +++ head/sys/geom/eli/g_eli_ctl.c Fri Mar 31 00:07:03 2017 (r316312) @@ -85,6 +85,11 @@ g_eli_ctl_attach(struct gctl_req *req, s return; } + if (*detach && *readonly) { + gctl_error(req, "Options -d and -r are mutually exclusive."); + return; + } + name = gctl_get_asciiparam(req, "arg0"); if (name == NULL) { gctl_error(req, "No 'arg%u' argument.", 0); @@ -104,44 +109,39 @@ g_eli_ctl_attach(struct gctl_req *req, s return; } if (md.md_keys == 0x00) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "No valid keys on %s.", pp->name); return; } key = gctl_get_param(req, "key", &keysize); if (key == NULL || keysize != G_ELI_USERKEYLEN) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "No '%s' argument.", "key"); return; } error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); - bzero(key, keysize); + explicit_bzero(key, keysize); if (error == -1) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Wrong key for %s.", pp->name); return; } else if (error > 0) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Cannot decrypt Master Key for %s (error=%d).", pp->name, error); return; } G_ELI_DEBUG(1, "Using Master Key %u for %s.", nkey, pp->name); - if (*detach && *readonly) { - bzero(&md, sizeof(md)); - gctl_error(req, "Options -d and -r are mutually exclusive."); - return; - } if (*detach) md.md_flags |= G_ELI_FLAG_WO_DETACH; if (*readonly) md.md_flags |= G_ELI_FLAG_RO; g_eli_create(req, mp, pp, &md, mkey, nkey); - bzero(mkey, sizeof(mkey)); - bzero(&md, sizeof(md)); + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(&md, sizeof(md)); } static struct g_eli_softc * @@ -362,8 +362,8 @@ g_eli_ctl_onetime(struct gctl_req *req, } g_eli_create(req, mp, pp, &md, mkey, -1); - bzero(mkey, sizeof(mkey)); - bzero(&md, sizeof(md)); + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(&md, sizeof(md)); } static void @@ -549,8 +549,8 @@ g_eli_ctl_configure(struct gctl_req *req "Cannot store metadata on %s (error=%d).", prov, error); } - bzero(&md, sizeof(md)); - bzero(sector, pp->sectorsize); + explicit_bzero(&md, sizeof(md)); + explicit_bzero(sector, pp->sectorsize); free(sector, M_ELI); } } @@ -574,6 +574,11 @@ g_eli_ctl_setkey(struct gctl_req *req, s gctl_error(req, "No 'arg%u' argument.", 0); return; } + key = gctl_get_param(req, "key", &keysize); + if (key == NULL || keysize != G_ELI_USERKEYLEN) { + gctl_error(req, "No '%s' argument.", "key"); + return; + } sc = g_eli_find_device(mp, name); if (sc == NULL) { gctl_error(req, "Provider %s is invalid.", name); @@ -627,13 +632,6 @@ g_eli_ctl_setkey(struct gctl_req *req, s md.md_iterations = *valp; } - key = gctl_get_param(req, "key", &keysize); - if (key == NULL || keysize != G_ELI_USERKEYLEN) { - bzero(&md, sizeof(md)); - gctl_error(req, "No '%s' argument.", "key"); - return; - } - mkeydst = md.md_mkeys + nkey * G_ELI_MKEYLEN; md.md_keys |= (1 << nkey); @@ -641,9 +639,9 @@ g_eli_ctl_setkey(struct gctl_req *req, s /* Encrypt Master Key with the new key. */ error = g_eli_mkey_encrypt(md.md_ealgo, key, md.md_keylen, mkeydst); - bzero(key, keysize); + explicit_bzero(key, keysize); if (error != 0) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Cannot encrypt Master Key (error=%d).", error); return; } @@ -651,10 +649,10 @@ g_eli_ctl_setkey(struct gctl_req *req, s sector = malloc(pp->sectorsize, M_ELI, M_WAITOK | M_ZERO); /* Store metadata with fresh key. */ eli_metadata_encode(&md, sector); - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); error = g_write_data(cp, pp->mediasize - pp->sectorsize, sector, pp->sectorsize); - bzero(sector, pp->sectorsize); + explicit_bzero(sector, pp->sectorsize); free(sector, M_ELI); if (error != 0) { gctl_error(req, "Cannot store metadata on %s (error=%d).", @@ -752,7 +750,7 @@ g_eli_ctl_delkey(struct gctl_req *req, s sector = malloc(pp->sectorsize, M_ELI, M_WAITOK | M_ZERO); for (i = 0; i <= g_eli_overwrites; i++) { if (i == g_eli_overwrites) - bzero(mkeydst, keysize); + explicit_bzero(mkeydst, keysize); else arc4rand(mkeydst, keysize, 0); /* Store metadata with destroyed key. */ @@ -769,8 +767,8 @@ g_eli_ctl_delkey(struct gctl_req *req, s */ (void)g_io_flush(cp); } - bzero(&md, sizeof(md)); - bzero(sector, pp->sectorsize); + explicit_bzero(&md, sizeof(md)); + explicit_bzero(sector, pp->sectorsize); free(sector, M_ELI); if (*all) G_ELI_DEBUG(1, "All keys removed from %s.", pp->name); @@ -817,12 +815,12 @@ g_eli_suspend_one(struct g_eli_softc *sc /* * Clear sensitive data on suspend, they will be recovered on resume. */ - bzero(sc->sc_mkey, sizeof(sc->sc_mkey)); + explicit_bzero(sc->sc_mkey, sizeof(sc->sc_mkey)); g_eli_key_destroy(sc); - bzero(sc->sc_akey, sizeof(sc->sc_akey)); - bzero(&sc->sc_akeyctx, sizeof(sc->sc_akeyctx)); - bzero(sc->sc_ivkey, sizeof(sc->sc_ivkey)); - bzero(&sc->sc_ivctx, sizeof(sc->sc_ivctx)); + explicit_bzero(sc->sc_akey, sizeof(sc->sc_akey)); + explicit_bzero(&sc->sc_akeyctx, sizeof(sc->sc_akeyctx)); + explicit_bzero(sc->sc_ivkey, sizeof(sc->sc_ivkey)); + explicit_bzero(&sc->sc_ivctx, sizeof(sc->sc_ivctx)); mtx_unlock(&sc->sc_queue_mtx); G_ELI_DEBUG(0, "Device %s has been suspended.", sc->sc_name); } @@ -915,6 +913,11 @@ g_eli_ctl_resume(struct gctl_req *req, s gctl_error(req, "No 'arg%u' argument.", 0); return; } + key = gctl_get_param(req, "key", &keysize); + if (key == NULL || keysize != G_ELI_USERKEYLEN) { + gctl_error(req, "No '%s' argument.", "key"); + return; + } sc = g_eli_find_device(mp, name); if (sc == NULL) { gctl_error(req, "Provider %s is invalid.", name); @@ -929,26 +932,19 @@ g_eli_ctl_resume(struct gctl_req *req, s return; } if (md.md_keys == 0x00) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "No valid keys on %s.", pp->name); return; } - key = gctl_get_param(req, "key", &keysize); - if (key == NULL || keysize != G_ELI_USERKEYLEN) { - bzero(&md, sizeof(md)); - gctl_error(req, "No '%s' argument.", "key"); - return; - } - error = g_eli_mkey_decrypt(&md, key, mkey, &nkey); - bzero(key, keysize); + explicit_bzero(key, keysize); if (error == -1) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Wrong key for %s.", pp->name); return; } else if (error > 0) { - bzero(&md, sizeof(md)); + explicit_bzero(&md, sizeof(md)); gctl_error(req, "Cannot decrypt Master Key for %s (error=%d).", pp->name, error); return; @@ -966,8 +962,8 @@ g_eli_ctl_resume(struct gctl_req *req, s wakeup(sc); } mtx_unlock(&sc->sc_queue_mtx); - bzero(mkey, sizeof(mkey)); - bzero(&md, sizeof(md)); + explicit_bzero(mkey, sizeof(mkey)); + explicit_bzero(&md, sizeof(md)); } static int Modified: head/sys/geom/eli/g_eli_key.c ============================================================================== --- head/sys/geom/eli/g_eli_key.c Fri Mar 31 00:04:32 2017 (r316311) +++ head/sys/geom/eli/g_eli_key.c Fri Mar 31 00:07:03 2017 (r316312) @@ -69,7 +69,7 @@ g_eli_mkey_verify(const unsigned char *m g_eli_crypto_hmac(hmkey, sizeof(hmkey), mkey, G_ELI_DATAIVKEYLEN, chmac, 0); - bzero(hmkey, sizeof(hmkey)); + explicit_bzero(hmkey, sizeof(hmkey)); /* * Compare calculated HMAC with HMAC from metadata. @@ -97,7 +97,7 @@ g_eli_mkey_hmac(unsigned char *mkey, con g_eli_crypto_hmac(hmkey, sizeof(hmkey), mkey, G_ELI_DATAIVKEYLEN, odhmac, 0); - bzero(hmkey, sizeof(hmkey)); + explicit_bzero(hmkey, sizeof(hmkey)); } /* @@ -131,21 +131,21 @@ g_eli_mkey_decrypt(const struct g_eli_me error = g_eli_crypto_decrypt(md->md_ealgo, tmpmkey, G_ELI_MKEYLEN, enckey, md->md_keylen); if (error != 0) { - bzero(tmpmkey, sizeof(tmpmkey)); - bzero(enckey, sizeof(enckey)); + explicit_bzero(tmpmkey, sizeof(tmpmkey)); + explicit_bzero(enckey, sizeof(enckey)); return (error); } if (g_eli_mkey_verify(tmpmkey, key)) { bcopy(tmpmkey, mkey, G_ELI_DATAIVKEYLEN); - bzero(tmpmkey, sizeof(tmpmkey)); - bzero(enckey, sizeof(enckey)); + explicit_bzero(tmpmkey, sizeof(tmpmkey)); + explicit_bzero(enckey, sizeof(enckey)); if (nkeyp != NULL) *nkeyp = nkey; return (0); } } - bzero(enckey, sizeof(enckey)); - bzero(tmpmkey, sizeof(tmpmkey)); + explicit_bzero(enckey, sizeof(enckey)); + explicit_bzero(tmpmkey, sizeof(tmpmkey)); return (-1); } @@ -175,7 +175,7 @@ g_eli_mkey_encrypt(unsigned algo, const */ error = g_eli_crypto_encrypt(algo, mkey, G_ELI_MKEYLEN, enckey, keylen); - bzero(enckey, sizeof(enckey)); + explicit_bzero(enckey, sizeof(enckey)); return (error); } Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Fri Mar 31 00:04:32 2017 (r316311) +++ head/sys/geom/eli/g_eli_key_cache.c Fri Mar 31 00:07:03 2017 (r316312) @@ -117,7 +117,7 @@ g_eli_key_allocate(struct g_eli_softc *s keysearch.gek_keyno = keyno; ekey = RB_FIND(g_eli_key_tree, &sc->sc_ekeys_tree, &keysearch); if (ekey != NULL) { - bzero(key, sizeof(*key)); + explicit_bzero(key, sizeof(*key)); free(key, M_ELI); key = ekey; TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next); @@ -174,7 +174,7 @@ g_eli_key_remove(struct g_eli_softc *sc, RB_REMOVE(g_eli_key_tree, &sc->sc_ekeys_tree, key); TAILQ_REMOVE(&sc->sc_ekeys_queue, key, gek_next); sc->sc_ekeys_allocated--; - bzero(key, sizeof(*key)); + explicit_bzero(key, sizeof(*key)); free(key, M_ELI); } @@ -239,7 +239,7 @@ g_eli_key_destroy(struct g_eli_softc *sc mtx_lock(&sc->sc_ekeys_lock); if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) != 0) { - bzero(sc->sc_ekey, sizeof(sc->sc_ekey)); + explicit_bzero(sc->sc_ekey, sizeof(sc->sc_ekey)); } else { struct g_eli_key *key; From owner-svn-src-all@freebsd.org Fri Mar 31 00:41:55 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBDC9D23036; Fri, 31 Mar 2017 00:41:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAC49E9B; Fri, 31 Mar 2017 00:41:55 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V0fs2s058904; Fri, 31 Mar 2017 00:41:54 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V0fsKc058902; Fri, 31 Mar 2017 00:41:54 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201703310041.v2V0fsKc058902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 31 Mar 2017 00:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316313 - in head: . sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 00:41:56 -0000 Author: smh Date: Fri Mar 31 00:41:54 2017 New Revision: 316313 URL: https://svnweb.freebsd.org/changeset/base/316313 Log: Allow explicitly assigned IPv4 loopback address to be used in jails If a jail has an explicitly assigned loopback address then allow it to be used instead of remapping requests for the loopback adddress to the first IPv4 address assigned to the jail. This fixes issues where applications attempt to detect their bound port where they requested a loopback address, which was available, but instead the kernel remapped it to the jails first address. A example of this is binding nginx to 127.0.0.1 and then running "service nginx upgrade" which before this change would cause nginx to fail. Also: * Correct the description of prison_check_ip4_locked to match the code. MFC after: 2 weeks Relnotes: Yes Sponsored by: Multiplay Modified: head/UPDATING head/sys/netinet/in_jail.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Mar 31 00:07:03 2017 (r316312) +++ head/UPDATING Fri Mar 31 00:41:54 2017 (r316313) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170331: + Binds and sends to the IPv4 loopback address (127.0.0.1) will now + use any explicitly assigned loopback address available in the jail + instead of using the first assigned IPv4 address of the jail. + 20170329: The ctl.ko module no longer implements the iSCSI target frontend: cfiscsi.ko does instead. Modified: head/sys/netinet/in_jail.c ============================================================================== --- head/sys/netinet/in_jail.c Fri Mar 31 00:07:03 2017 (r316312) +++ head/sys/netinet/in_jail.c Fri Mar 31 00:41:54 2017 (r316313) @@ -306,11 +306,6 @@ prison_local_ip4(struct ucred *cred, str } ia0.s_addr = ntohl(ia->s_addr); - if (ia0.s_addr == INADDR_LOOPBACK) { - ia->s_addr = pr->pr_ip4[0].s_addr; - mtx_unlock(&pr->pr_mtx); - return (0); - } if (ia0.s_addr == INADDR_ANY) { /* @@ -323,6 +318,11 @@ prison_local_ip4(struct ucred *cred, str } error = prison_check_ip4_locked(pr, ia); + if (error == EADDRNOTAVAIL && ia0.s_addr == INADDR_LOOPBACK) { + ia->s_addr = pr->pr_ip4[0].s_addr; + error = 0; + } + mtx_unlock(&pr->pr_mtx); return (error); } @@ -354,7 +354,8 @@ prison_remote_ip4(struct ucred *cred, st return (EAFNOSUPPORT); } - if (ntohl(ia->s_addr) == INADDR_LOOPBACK) { + if (ntohl(ia->s_addr) == INADDR_LOOPBACK && + prison_check_ip4_locked(pr, ia) == EADDRNOTAVAIL) { ia->s_addr = pr->pr_ip4[0].s_addr; mtx_unlock(&pr->pr_mtx); return (0); @@ -370,9 +371,8 @@ prison_remote_ip4(struct ucred *cred, st /* * Check if given address belongs to the jail referenced by cred/prison. * - * Returns 0 if jail doesn't restrict IPv4 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv4. Address passed in in NBO. + * Returns 0 if address belongs to jail, + * EADDRNOTAVAIL if the address doesn't belong to the jail. */ int prison_check_ip4_locked(const struct prison *pr, const struct in_addr *ia) From owner-svn-src-all@freebsd.org Fri Mar 31 03:08:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC951D239CB; Fri, 31 Mar 2017 03:08:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554C5CDF; Fri, 31 Mar 2017 03:08:08 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V387Hw016612; Fri, 31 Mar 2017 03:08:07 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V387RS016610; Fri, 31 Mar 2017 03:08:07 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201703310308.v2V387RS016610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 31 Mar 2017 03:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316314 - in head/usr.bin: bsdiff/bsdiff top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 03:08:08 -0000 Author: allanjude Date: Fri Mar 31 03:08:07 2017 New Revision: 316314 URL: https://svnweb.freebsd.org/changeset/base/316314 Log: fix top(1) ZFS compressed ARC support top(1) read the wrong amount of data from sysctl, uint64_t instead of boolean_t, resulting in the stats not showing in many cases. X-MFC-With: r315435 Sponsored by: ScaleEngine Inc. Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c head/usr.bin/top/machine.c Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- head/usr.bin/bsdiff/bsdiff/bsdiff.c Fri Mar 31 00:41:54 2017 (r316313) +++ head/usr.bin/bsdiff/bsdiff/bsdiff.c Fri Mar 31 03:08:07 2017 (r316314) @@ -54,8 +54,12 @@ static off_t matchlen(u_char *old,off_t { off_t i; - for(i=0;(i Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2EA8D23CA6; Fri, 31 Mar 2017 03:11:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3142FAC; Fri, 31 Mar 2017 03:11:26 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V3BPwK019771; Fri, 31 Mar 2017 03:11:25 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V3BPXJ019770; Fri, 31 Mar 2017 03:11:25 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201703310311.v2V3BPXJ019770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 31 Mar 2017 03:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316315 - head/usr.bin/bsdiff/bsdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 03:11:26 -0000 Author: allanjude Date: Fri Mar 31 03:11:25 2017 New Revision: 316315 URL: https://svnweb.freebsd.org/changeset/base/316315 Log: Revert debugging that was accidently committed in r316314 Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- head/usr.bin/bsdiff/bsdiff/bsdiff.c Fri Mar 31 03:08:07 2017 (r316314) +++ head/usr.bin/bsdiff/bsdiff/bsdiff.c Fri Mar 31 03:11:25 2017 (r316315) @@ -54,12 +54,8 @@ static off_t matchlen(u_char *old,off_t { off_t i; -printf("old=%p new=%p\n", old, new); -//printf("oldsize=%ld newsize=%ld\n", oldsize, newsize); - for(i=0;(i Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:42:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:43:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:43:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:44:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:44:39 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:51:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 04:51:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 06:20:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B955AD27CAC; Fri, 31 Mar 2017 08:21:00 +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 79373DF5; Fri, 31 Mar 2017 08:21:00 +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 v2V8KxR9040399; Fri, 31 Mar 2017 08:20:59 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V8Kxv5040396; Fri, 31 Mar 2017 08:20:59 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201703310820.v2V8Kxv5040396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 31 Mar 2017 08:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316326 - in head: share/man/man4 sys/dev/usb sys/dev/usb/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 08:21:00 -0000 Author: kevlo Date: Fri Mar 31 08:20:59 2017 New Revision: 316326 URL: https://svnweb.freebsd.org/changeset/base/316326 Log: Add support for ThingM blink(1) notification LED to uled(4). Modified: head/share/man/man4/uled.4 head/sys/dev/usb/misc/uled.c head/sys/dev/usb/usbdevs Modified: head/share/man/man4/uled.4 ============================================================================== --- head/share/man/man4/uled.4 Fri Mar 31 06:33:20 2017 (r316325) +++ head/share/man/man4/uled.4 Fri Mar 31 08:20:59 2017 (r316326) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 5, 2014 +.Dd March 31, 2017 .Dt ULED 4 .Os .Sh NAME @@ -48,7 +48,8 @@ uled_load="YES" .Sh DESCRIPTION The .Nm -driver provides support for the Dream Cheeky WebMail Notifier device. +driver provides support for Dream Cheeky WebMail Notifier and +ThingM blink(1) notification LED. .Pp Subsequently, the .Pa /dev/uled0 Modified: head/sys/dev/usb/misc/uled.c ============================================================================== --- head/sys/dev/usb/misc/uled.c Fri Mar 31 06:33:20 2017 (r316325) +++ head/sys/dev/usb/misc/uled.c Fri Mar 31 08:20:59 2017 (r316326) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Kevin Lo + * Copyright (c) 2014, 2017 Kevin Lo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -68,10 +68,16 @@ struct uled_softc { uint8_t sc_state; #define ULED_ENABLED 0x01 + + int sc_flags; +#define ULED_FLAG_BLINK1 0x0001 }; -/* prototypes */ +/* Initial commands. */ +static uint8_t blink1[] = { 0x1, 'v', 0, 0, 0, 0, 0, 0 }; +static uint8_t dl100b[] = { 0x1f, 0x2, 0, 0x5f, 0, 0, 0x1a, 0x3 }; +/* Prototypes. */ static device_probe_t uled_probe; static device_attach_t uled_attach; static device_detach_t uled_detach; @@ -88,7 +94,7 @@ static struct usb_fifo_methods uled_fifo }; static usb_error_t uled_ctrl_msg(struct uled_softc *, uint8_t, uint8_t, - uint16_t, uint16_t, void *buf, uint16_t); + uint16_t, uint16_t, void *, uint16_t); static int uled_enable(struct uled_softc *); static devclass_t uled_devclass; @@ -108,7 +114,10 @@ static driver_t uled_driver = { }; static const STRUCT_USB_HOST_ID uled_devs[] = { - {USB_VPI(USB_VENDOR_DREAMLINK, USB_PRODUCT_DREAMLINK_DL100B, 0)}, +#define ULED_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } + ULED_DEV(DREAMLINK, DL100B, 0), + ULED_DEV(THINGM, BLINK1, ULED_FLAG_BLINK1), +#undef ULED_DEV }; DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL); @@ -141,6 +150,7 @@ uled_attach(device_t dev) uaa = device_get_ivars(dev); sc = device_get_softc(dev); unit = device_get_unit(dev); + sc->sc_flags = USB_GET_DRIVER_INFO(uaa); device_set_usb_desc(dev); mtx_init(&sc->sc_mtx, "uled lock", NULL, MTX_DEF | MTX_RECURSE); @@ -194,10 +204,11 @@ uled_ctrl_msg(struct uled_softc *sc, uin static int uled_enable(struct uled_softc *sc) { - static uint8_t cmdbuf[] = { 0x1f, 0x02, 0x00, 0x5f, 0x00, 0x00, 0x1a, - 0x03 }; + uint8_t *cmdbuf; int error; + cmdbuf = (sc->sc_flags & ULED_FLAG_BLINK1) ? blink1 : dl100b; + sc->sc_state |= ULED_ENABLED; mtx_lock(&sc->sc_mtx); error = uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, UR_SET_REPORT, @@ -257,12 +268,21 @@ uled_ioctl(struct usb_fifo *fifo, u_long sc->sc_color.green = color.green; sc->sc_color.blue = color.blue; - buf[0] = color.red; - buf[1] = color.green; - buf[2] = color.blue; - buf[3] = buf[4] = buf[5] = 0; - buf[6] = 0x1a; - buf[7] = 0x05; + if (sc->sc_flags & ULED_FLAG_BLINK1) { + buf[0] = 0x1; + buf[1] = 'n'; + buf[2] = color.red; + buf[3] = color.green; + buf[4] = color.blue; + buf[5] = buf[6] = buf[7] = 0; + } else { + buf[0] = color.red; + buf[1] = color.green; + buf[2] = color.blue; + buf[3] = buf[4] = buf[5] = 0; + buf[6] = 0x1a; + buf[7] = 0x05; + } error = uled_ctrl_msg(sc, UT_WRITE_CLASS_INTERFACE, UR_SET_REPORT, 0x200, 0, buf, sizeof(buf)); break; Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Mar 31 06:33:20 2017 (r316325) +++ head/sys/dev/usb/usbdevs Fri Mar 31 08:20:59 2017 (r316326) @@ -747,6 +747,7 @@ vendor WESTMOUNTAIN 0x2405 West Mountain vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric vendor NHJ 0x2770 NHJ +vendor THINGM 0x27b8 ThingM vendor PLANEX 0x2c02 Planex Communications vendor VIDZMEDIA 0x3275 VidzMedia Pte Ltd vendor LINKINSTRUMENTS 0x3195 Link Instruments Inc. @@ -4493,6 +4494,9 @@ product TELIT UC864G 0x1004 UC864G 3G m /* Ten X Technology, Inc. */ product TENX UAUDIO0 0xf211 USB audio headset +/* ThingM products */ +product THINGM BLINK1 0x01ed USB notification light + /* Texas Intel products */ product TI UTUSB41 0x1446 UT-USB41 hub product TI TUSB2046 0x2046 TUSB2046 hub From owner-svn-src-all@freebsd.org Fri Mar 31 08:43:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 09:10:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A240FD25EF7; Fri, 31 Mar 2017 09:10:06 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F604FF1; Fri, 31 Mar 2017 09:10:06 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2V9A5HN061306; Fri, 31 Mar 2017 09:10:05 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V9A518061304; Fri, 31 Mar 2017 09:10:05 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201703310910.v2V9A518061304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 31 Mar 2017 09:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316328 - in head: . sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 09:10:06 -0000 Author: smh Date: Fri Mar 31 09:10:05 2017 New Revision: 316328 URL: https://svnweb.freebsd.org/changeset/base/316328 Log: Allow explicitly assigned IPv6 loopback address to be used in jails If a jail has an explicitly assigned IPv6 loopback address then allow it to be used instead of remapping requests for the loopback adddress to the first IPv6 address assigned to the jail. This fixes issues where applications attempt to detect their bound port where they requested a loopback address, which was available, but instead the kernel remapped it to the jails first address. This is the same fix applied to IPv4 fix by: r316313 Also: * Correct the description of prison_check_ip6_locked to match the code. MFC after: 2 weeks Relnotes: Yes Sponsored by: Multiplay Modified: head/UPDATING head/sys/netinet6/in6_jail.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Mar 31 08:43:07 2017 (r316327) +++ head/UPDATING Fri Mar 31 09:10:05 2017 (r316328) @@ -52,9 +52,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** 20170331: - Binds and sends to the IPv4 loopback address (127.0.0.1) will now + Binds and sends to the loopback addresses, IPv6 and IPv4, will now use any explicitly assigned loopback address available in the jail - instead of using the first assigned IPv4 address of the jail. + instead of using the first assigned address of the jail. 20170329: The ctl.ko module no longer implements the iSCSI target frontend: Modified: head/sys/netinet6/in6_jail.c ============================================================================== --- head/sys/netinet6/in6_jail.c Fri Mar 31 08:43:07 2017 (r316327) +++ head/sys/netinet6/in6_jail.c Fri Mar 31 09:10:05 2017 (r316328) @@ -293,12 +293,6 @@ prison_local_ip6(struct ucred *cred, str return (EAFNOSUPPORT); } - if (IN6_IS_ADDR_LOOPBACK(ia6)) { - bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); - mtx_unlock(&pr->pr_mtx); - return (0); - } - if (IN6_IS_ADDR_UNSPECIFIED(ia6)) { /* * In case there is only 1 IPv6 address, and v6only is true, @@ -311,6 +305,11 @@ prison_local_ip6(struct ucred *cred, str } error = prison_check_ip6_locked(pr, ia6); + if (error == EADDRNOTAVAIL && IN6_IS_ADDR_LOOPBACK(ia6)) { + bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); + error = 0; + } + mtx_unlock(&pr->pr_mtx); return (error); } @@ -341,7 +340,8 @@ prison_remote_ip6(struct ucred *cred, st return (EAFNOSUPPORT); } - if (IN6_IS_ADDR_LOOPBACK(ia6)) { + if (IN6_IS_ADDR_LOOPBACK(ia6) && + prison_check_ip6_locked(pr, ia6) == EADDRNOTAVAIL) { bcopy(&pr->pr_ip6[0], ia6, sizeof(struct in6_addr)); mtx_unlock(&pr->pr_mtx); return (0); @@ -357,9 +357,8 @@ prison_remote_ip6(struct ucred *cred, st /* * Check if given address belongs to the jail referenced by cred/prison. * - * Returns 0 if jail doesn't restrict IPv6 or if address belongs to jail, - * EADDRNOTAVAIL if the address doesn't belong, or EAFNOSUPPORT if the jail - * doesn't allow IPv6. + * Returns 0 if address belongs to jail, + * EADDRNOTAVAIL if the address doesn't belong to the jail. */ int prison_check_ip6_locked(const struct prison *pr, const struct in6_addr *ia6) From owner-svn-src-all@freebsd.org Fri Mar 31 09:26:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AFBED26453; Fri, 31 Mar 2017 09:26:10 +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 CE5E7EAD; Fri, 31 Mar 2017 09:26:09 +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 v2V9Q8vJ069577; Fri, 31 Mar 2017 09:26:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2V9Q8ip069576; Fri, 31 Mar 2017 09:26:08 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201703310926.v2V9Q8ip069576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 31 Mar 2017 09:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316329 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 09:26:10 -0000 Author: ae Date: Fri Mar 31 09:26:08 2017 New Revision: 316329 URL: https://svnweb.freebsd.org/changeset/base/316329 Log: Reset the cached state of last lookup in the dynamic states when an external action is completed, but the rule search is continued. External action handler can change the content of @args argument, that is used for dynamic state lookup. Enforce the new lookup to be able install new state, when the search is continued. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Mar 31 09:10:05 2017 (r316328) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Mar 31 09:26:08 2017 (r316329) @@ -2616,8 +2616,17 @@ do { \ * consider this as rule matching and * update counters. */ - if (retval == 0 && done == 0) + if (retval == 0 && done == 0) { IPFW_INC_RULE_COUNTER(f, pktlen); + /* + * Reset the result of the last + * dynamic state lookup. + * External action can change + * @args content, and it may be + * used for new state lookup later. + */ + dyn_dir = MATCH_UNKNOWN; + } break; default: From owner-svn-src-all@freebsd.org Fri Mar 31 10:26:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 13:43:02 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60D37D27DE6; Fri, 31 Mar 2017 13:43:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B49E635; Fri, 31 Mar 2017 13:43:02 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VDh1aW074443; Fri, 31 Mar 2017 13:43:01 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VDh0NJ074438; Fri, 31 Mar 2017 13:43:00 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703311343.v2VDh0NJ074438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 31 Mar 2017 13:43:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316332 - in head/sys: kern security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 13:43:02 -0000 Author: rwatson Date: Fri Mar 31 13:43:00 2017 New Revision: 316332 URL: https://svnweb.freebsd.org/changeset/base/316332 Log: Audit arguments to POSIX message queues, semaphores, and shared memory. This requires minor changes to the audit framework to allow capturing paths that are not filesystem paths (i.e., will not be canonicalised relative to the process current working directory and/or filesystem root). Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Fri Mar 31 11:40:59 2017 (r316331) +++ head/sys/kern/uipc_mqueue.c Fri Mar 31 13:43:00 2017 (r316332) @@ -1,7 +1,13 @@ /*- * Copyright (c) 2005 David Xu + * Copyright (c) 2016-2017 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -86,6 +92,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + FEATURE(p1003_1b_mqueue, "POSIX P1003.1B message queues support"); /* @@ -2012,6 +2020,9 @@ kern_kmq_open(struct thread *td, const c struct mqueue *mq; int fd, error, len, cmode; + AUDIT_ARG_FFLAGS(flags); + AUDIT_ARG_MODE(mode); + fdp = td->td_proc->p_fd; cmode = (((mode & ~fdp->fd_cmask) & ALLPERMS) & ~S_ISTXT); mq = NULL; @@ -2034,6 +2045,7 @@ kern_kmq_open(struct thread *td, const c len = strlen(path); if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) return (EINVAL); + AUDIT_ARG_UPATH1_CANON(path); error = falloc(td, &fp, &fd, O_CLOEXEC); if (error) @@ -2133,6 +2145,7 @@ sys_kmq_unlink(struct thread *td, struct len = strlen(path); if (len < 2 || path[0] != '/' || strchr(path + 1, '/') != NULL) return (EINVAL); + AUDIT_ARG_UPATH1_CANON(path); sx_xlock(&mqfs_data.mi_lock); pn = mqfs_search(mqfs_data.mi_root, path + 1, len - 1, td->td_ucred); @@ -2210,6 +2223,7 @@ kern_kmq_setattr(struct thread *td, int u_int oflag, flag; int error; + AUDIT_ARG_FD(mqd); if (attr != NULL && (attr->mq_flags & ~O_NONBLOCK) != 0) return (EINVAL); error = getmq(td, mqd, &fp, NULL, &mq); @@ -2260,6 +2274,7 @@ sys_kmq_timedreceive(struct thread *td, int error; int waitok; + AUDIT_ARG_FD(uap->mqd); error = getmq_read(td, uap->mqd, &fp, NULL, &mq); if (error) return (error); @@ -2285,6 +2300,7 @@ sys_kmq_timedsend(struct thread *td, str struct timespec *abs_timeout, ets; int error, waitok; + AUDIT_ARG_FD(uap->mqd); error = getmq_write(td, uap->mqd, &fp, NULL, &mq); if (error) return (error); @@ -2315,6 +2331,7 @@ kern_kmq_notify(struct thread *td, int m struct mqueue_notifier *nt, *newnt = NULL; int error; + AUDIT_ARG_FD(mqd); if (sigev != NULL) { if (sigev->sigev_notify != SIGEV_SIGNAL && sigev->sigev_notify != SIGEV_THREAD_ID && @@ -2780,6 +2797,7 @@ freebsd32_kmq_timedsend(struct thread *t int error; int waitok; + AUDIT_ARG_FD(uap->mqd); error = getmq_write(td, uap->mqd, &fp, NULL, &mq); if (error) return (error); @@ -2809,6 +2827,7 @@ freebsd32_kmq_timedreceive(struct thread struct timespec *abs_timeout, ets; int error, waitok; + AUDIT_ARG_FD(uap->mqd); error = getmq_read(td, uap->mqd, &fp, NULL, &mq); if (error) return (error); Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Fri Mar 31 11:40:59 2017 (r316331) +++ head/sys/kern/uipc_sem.c Fri Mar 31 13:43:00 2017 (r316332) @@ -1,7 +1,7 @@ /*- * Copyright (c) 2002 Alfred Perlstein * Copyright (c) 2003-2005 SPARTA, Inc. - * Copyright (c) 2005 Robert N. M. Watson + * Copyright (c) 2005, 2016-2017 Robert N. M. Watson * All rights reserved. * * This software was developed for the FreeBSD Project in part by Network @@ -9,6 +9,11 @@ * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), * as part of the DARPA CHATS research program. * + * Portions of this software were 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: @@ -66,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include FEATURE(p1003_1b_semaphores, "POSIX P1003.1B semaphores support"); @@ -467,6 +473,10 @@ ksem_create(struct thread *td, const cha Fnv32_t fnv; int error, fd; + AUDIT_ARG_FFLAGS(flags); + AUDIT_ARG_MODE(mode); + AUDIT_ARG_VALUE(value); + if (value > SEM_VALUE_MAX) return (EINVAL); @@ -518,6 +528,7 @@ ksem_create(struct thread *td, const cha return (error); } + AUDIT_ARG_UPATH1_CANON(path); fnv = fnv_32_str(path, FNV1_32_INIT); sx_xlock(&ksem_dict_lock); ks = ksem_lookup(path, fnv); @@ -661,6 +672,7 @@ sys_ksem_unlink(struct thread *td, struc return (error); } + AUDIT_ARG_UPATH1_CANON(path); fnv = fnv_32_str(path, FNV1_32_INIT); sx_xlock(&ksem_dict_lock); error = ksem_remove(path, fnv, td->td_ucred); @@ -684,6 +696,7 @@ sys_ksem_close(struct thread *td, struct int error; /* No capability rights required to close a semaphore. */ + AUDIT_ARG_FD(uap->id); error = ksem_get(td, uap->id, cap_rights_init(&rights), &fp); if (error) return (error); @@ -710,6 +723,7 @@ sys_ksem_post(struct thread *td, struct struct ksem *ks; int error; + AUDIT_ARG_FD(uap->id); error = ksem_get(td, uap->id, cap_rights_init(&rights, CAP_SEM_POST), &fp); if (error) @@ -802,6 +816,7 @@ kern_sem_wait(struct thread *td, semid_t int error; DP((">>> kern_sem_wait entered! pid=%d\n", (int)td->td_proc->p_pid)); + AUDIT_ARG_FD(id); error = ksem_get(td, id, cap_rights_init(&rights, CAP_SEM_WAIT), &fp); if (error) return (error); @@ -869,6 +884,7 @@ sys_ksem_getvalue(struct thread *td, str struct ksem *ks; int error, val; + AUDIT_ARG_FD(uap->id); error = ksem_get(td, uap->id, cap_rights_init(&rights, CAP_SEM_GETVALUE), &fp); if (error) @@ -906,6 +922,7 @@ sys_ksem_destroy(struct thread *td, stru int error; /* No capability rights required to close a semaphore. */ + AUDIT_ARG_FD(uap->id); error = ksem_get(td, uap->id, cap_rights_init(&rights), &fp); if (error) return (error); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Fri Mar 31 11:40:59 2017 (r316331) +++ head/sys/kern/uipc_shm.c Fri Mar 31 13:43:00 2017 (r316332) @@ -1,7 +1,12 @@ /*- - * Copyright (c) 2006, 2011 Robert N. M. Watson + * Copyright (c) 2006, 2011, 2016-2017 Robert N. M. Watson * All rights reserved. * + * Portions of this software were 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: @@ -79,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -709,6 +715,9 @@ kern_shm_open(struct thread *td, const c return (ECAPMODE); #endif + AUDIT_ARG_FFLAGS(flags); + AUDIT_ARG_MODE(mode); + if ((flags & O_ACCMODE) != O_RDONLY && (flags & O_ACCMODE) != O_RDWR) return (EINVAL); @@ -754,6 +763,7 @@ kern_shm_open(struct thread *td, const c return (error); } + AUDIT_ARG_UPATH1_CANON(path); fnv = fnv_32_str(path, FNV1_32_INIT); sx_xlock(&shm_dict_lock); shmfd = shm_lookup(path, fnv); @@ -858,6 +868,7 @@ sys_shm_unlink(struct thread *td, struct if (KTRPOINT(curthread, KTR_NAMEI)) ktrnamei(path); #endif + AUDIT_ARG_UPATH1_CANON(path); fnv = fnv_32_str(path, FNV1_32_INIT); sx_xlock(&shm_dict_lock); error = shm_remove(path, fnv, td->td_ucred); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Fri Mar 31 11:40:59 2017 (r316331) +++ head/sys/security/audit/audit.h Fri Mar 31 13:43:00 2017 (r316332) @@ -106,7 +106,9 @@ void audit_arg_auid(uid_t auid); void audit_arg_auditinfo(struct auditinfo *au_info); void audit_arg_auditinfo_addr(struct auditinfo_addr *au_info); void audit_arg_upath1(struct thread *td, int dirfd, char *upath); +void audit_arg_upath1_canon(char *upath); void audit_arg_upath2(struct thread *td, int dirfd, char *upath); +void audit_arg_upath2_canon(char *upath); void audit_arg_vnode1(struct vnode *vp); void audit_arg_vnode2(struct vnode *vp); void audit_arg_text(char *text); @@ -334,11 +336,21 @@ void audit_thread_free(struct thread *t audit_arg_upath1((td), (dirfd), (upath)); \ } while (0) +#define AUDIT_ARG_UPATH1_CANON(upath) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_upath1_canon((upath)); \ +} while (0) + #define AUDIT_ARG_UPATH2(td, dirfd, upath) do { \ if (AUDITING_TD(curthread)) \ audit_arg_upath2((td), (dirfd), (upath)); \ } while (0) +#define AUDIT_ARG_UPATH2_CANON(upath) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_upath2_canon((upath)); \ +} while (0) + #define AUDIT_ARG_VALUE(value) do { \ if (AUDITING_TD(curthread)) \ audit_arg_value((value)); \ @@ -419,7 +431,9 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) #define AUDIT_ARG_UPATH1(td, dirfd, upath) +#define AUDIT_ARG_UPATH1_NONCANON(td, upath) #define AUDIT_ARG_UPATH2(td, dirfd, upath) +#define AUDIT_ARG_UPATH2_NONCANON(td, upath) #define AUDIT_ARG_VALUE(value) #define AUDIT_ARG_VNODE1(vp) #define AUDIT_ARG_VNODE2(vp) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Fri Mar 31 11:40:59 2017 (r316331) +++ head/sys/security/audit/audit_arg.c Fri Mar 31 13:43:00 2017 (r316332) @@ -766,6 +766,48 @@ audit_arg_upath2(struct thread *td, int } /* + * Variants on path auditing that do not canonicalise the path passed in; + * these are for use with filesystem-like subsystems that employ string names, + * but do not support a hierarchical namespace -- for example, POSIX IPC + * objects. The subsystem should have performed any necessary + * canonicalisation required to make the paths useful to audit analysis. + */ +static void +audit_arg_upath_canon(char *upath, char **pathp) +{ + + if (*pathp == NULL) + *pathp = malloc(MAXPATHLEN, M_AUDITPATH, M_WAITOK); + (void)snprintf(*pathp, MAXPATHLEN, "%s", upath); +} + +void +audit_arg_upath1_canon(char *upath) +{ + struct kaudit_record *ar; + + ar = currecord(); + if (ar == NULL) + return; + + audit_arg_upath_canon(upath, &ar->k_ar.ar_arg_upath1); + ARG_SET_VALID(ar, ARG_UPATH1); +} + +void +audit_arg_upath2_canon(char *upath) +{ + struct kaudit_record *ar; + + ar = currecord(); + if (ar == NULL) + return; + + audit_arg_upath_canon(upath, &ar->k_ar.ar_arg_upath2); + ARG_SET_VALID(ar, ARG_UPATH2); +} + +/* * Function to save the path and vnode attr information into the audit * record. * From owner-svn-src-all@freebsd.org Fri Mar 31 14:13:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ED9DD27641; Fri, 31 Mar 2017 14:13:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0E0E66; Fri, 31 Mar 2017 14:13:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VEDDvk086573; Fri, 31 Mar 2017 14:13:13 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VEDD1I086572; Fri, 31 Mar 2017 14:13:13 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703311413.v2VEDD1I086572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 31 Mar 2017 14:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316333 - head/sys/security/audit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 14:13:14 -0000 Author: rwatson Date: Fri Mar 31 14:13:13 2017 New Revision: 316333 URL: https://svnweb.freebsd.org/changeset/base/316333 Log: Correct macro names and signatures for !AUDIT versions of canonical path auditing. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/security/audit/audit.h Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Fri Mar 31 13:43:00 2017 (r316332) +++ head/sys/security/audit/audit.h Fri Mar 31 14:13:13 2017 (r316333) @@ -431,9 +431,9 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_TEXT(text) #define AUDIT_ARG_UID(uid) #define AUDIT_ARG_UPATH1(td, dirfd, upath) -#define AUDIT_ARG_UPATH1_NONCANON(td, upath) +#define AUDIT_ARG_UPATH1_CANON(upath) #define AUDIT_ARG_UPATH2(td, dirfd, upath) -#define AUDIT_ARG_UPATH2_NONCANON(td, upath) +#define AUDIT_ARG_UPATH2_CANON(upath) #define AUDIT_ARG_VALUE(value) #define AUDIT_ARG_VNODE1(vp) #define AUDIT_ARG_VNODE2(vp) From owner-svn-src-all@freebsd.org Fri Mar 31 14:17:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27E52D276F8; Fri, 31 Mar 2017 14:17:16 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1B90F3; Fri, 31 Mar 2017 14:17:15 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VEHEpI086737; Fri, 31 Mar 2017 14:17:14 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VEHE5o086736; Fri, 31 Mar 2017 14:17:14 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703311417.v2VEHE5o086736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 31 Mar 2017 14:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316334 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 14:17:16 -0000 Author: rwatson Date: Fri Mar 31 14:17:14 2017 New Revision: 316334 URL: https://svnweb.freebsd.org/changeset/base/316334 Log: Audit arguments to posix_fallocate(2) and posix_fadvise(2) system calls. As posix_fadvise() does not lock the vnode argument, don't capture detailed vnode information for the time being. Obtained from: TrustedBSD Project MFC after: 3 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_syscalls.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Fri Mar 31 14:13:13 2017 (r316333) +++ head/sys/kern/vfs_syscalls.c Fri Mar 31 14:17:14 2017 (r316334) @@ -4452,15 +4452,21 @@ kern_posix_fallocate(struct thread *td, cap_rights_t rights; off_t olen, ooffset; int error; +#ifdef AUDIT + int audited_vnode1 = 0; +#endif + AUDIT_ARG_FD(fd); if (offset < 0 || len <= 0) return (EINVAL); /* Check for wrap. */ if (offset > OFF_MAX - len) return (EFBIG); + AUDIT_ARG_FD(fd); error = fget(td, fd, cap_rights_init(&rights, CAP_WRITE), &fp); if (error != 0) return (error); + AUDIT_ARG_FILE(td->td_proc, fp); if ((fp->f_ops->fo_flags & DFLAG_SEEKABLE) == 0) { error = ESPIPE; goto out; @@ -4494,6 +4500,12 @@ kern_posix_fallocate(struct thread *td, vn_finished_write(mp); break; } +#ifdef AUDIT + if (!audited_vnode1) { + AUDIT_ARG_VNODE1(vp); + audited_vnode1 = 1; + } +#endif #ifdef MAC error = mac_vnode_check_write(td->td_ucred, fp->f_cred, vp); if (error == 0) @@ -4544,6 +4556,7 @@ kern_posix_fadvise(struct thread *td, in if (offset < 0 || len < 0 || offset > OFF_MAX - len) return (EINVAL); + AUDIT_ARG_VALUE(advice); switch (advice) { case POSIX_FADV_SEQUENTIAL: case POSIX_FADV_RANDOM: @@ -4559,9 +4572,11 @@ kern_posix_fadvise(struct thread *td, in return (EINVAL); } /* XXX: CAP_POSIX_FADVISE? */ + AUDIT_ARG_FD(fd); error = fget(td, fd, cap_rights_init(&rights), &fp); if (error != 0) goto out; + AUDIT_ARG_FILE(td->td_proc, fp); if ((fp->f_ops->fo_flags & DFLAG_SEEKABLE) == 0) { error = ESPIPE; goto out; From owner-svn-src-all@freebsd.org Fri Mar 31 15:17:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 907D0D27727 for ; Fri, 31 Mar 2017 15:17:05 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31EA8F66 for ; Fri, 31 Mar 2017 15:17:04 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 120c821d-1625-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 120c821d-1625-11e7-b96e-2378c10e3beb; Fri, 31 Mar 2017 15:16:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v2VFGpPK001423; Fri, 31 Mar 2017 09:16:51 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1490973411.64669.121.camel@freebsd.org> Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot From: Ian Lepore To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 31 Mar 2017 09:16:51 -0600 In-Reply-To: <201703310004.v2V04W3A043449@repo.freebsd.org> References: <201703310004.v2V04W3A043449@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 15:17:05 -0000 On Fri, 2017-03-31 at 00:04 +0000, Allan Jude wrote: > >   Add explicit_bzero() to libstand, and switch GELIBoot to using it revolution > man explicit_bzero No manual entry for explicit_bzero revolution > svn log -v explicit_bzero.c ... r272673 | delphij | 2014-10-06 22:54:11 -0600 (Mon, 06 Oct 2014) | 5 lines Add explicit_bzero(3) and its kernel counterpart. Obtained from:  OpenBSD So... can anyone provide a clue what's "explicit" (or different in any way) between explicit_bzero() and normal bzero()? -- Ian From owner-svn-src-all@freebsd.org Fri Mar 31 15:27:16 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B71DD27948 for ; Fri, 31 Mar 2017 15:27:16 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::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 E1B888C5 for ; Fri, 31 Mar 2017 15:27:15 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22e.google.com with SMTP id x124so1681093wmf.0 for ; Fri, 31 Mar 2017 08:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=9d8mb0nxiAmgfnQtvhMNCyV+2XKm9x3m8AXyaJ8eZGQ=; b=ppuBjDshj2xUeu0Yzw9Y1XmCQ59MkymS61rYrjNpgRSv+/BOtEM75hwAaA9ua8bUm8 0vI6NVnVoObsrmfw4kTT422lP6PZ4Otx3inH+LuIviitpocpWwVboq3H1KtU1fSI2miQ fMATRqtWGzkOipVBZvetUO5sbsfWAKuSmJ+ZYys9yvuXnfGknd0GKS7leQu0F5WHIuyj Dp8Rb9WcxT75fW5ikU173uPwzdRk4sEgXZreyDMhv5oT7hrlfh68ZIc2ZCF7JdJJ+ejt zdupOjMqPACym35l80nMQfnINRhf5D1S84z7ShdwcDw9l/OXejh51UvttYo9Z9PzD/R0 QpHg== 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; bh=9d8mb0nxiAmgfnQtvhMNCyV+2XKm9x3m8AXyaJ8eZGQ=; b=JEj1rzYI5As62dErL0g/i/BNIv4Z+yLVghnHyAqSt3lpxaRiY+pMPIrAXpfDiWMBAb yRZAsmJZgpfAPIxbxtIEIJ5q930MbQ4VLzofZ5LNGL7SJ4FFN7mrVmqR2VPHal/FUgrV Mg1+z25kfViJz64GJA5rBo9ECxD1nxRpHGJszVDFy74SAZC78J3l0mDmERN/De+1TWe7 zExaqpZ8Uvc4clOi5Qh2Cf4X+e808X2t1kcxmqoUdQNAp0+a3IAsxTOEU/u9iRZazi7V C+S46+wTUzvW3lXyXomegQH7nV5wxIzP+7c2JfxeJbq0pW+51eZA9Gv/wDF88wUxILKg 1nag== X-Gm-Message-State: AFeK/H1edRr4IAvPMVGlUEkkBn0BiS0tbdjwqT5Tgdv7uh1FRc2lY3Xgi8bO5kYQR0aFIzwO X-Received: by 10.28.69.147 with SMTP id l19mr3966081wmi.55.1490974033867; Fri, 31 Mar 2017 08:27:13 -0700 (PDT) Received: from [10.10.1.58] ([185.97.61.26]) by smtp.gmail.com with ESMTPSA id m83sm3304459wmc.7.2017.03.31.08.27.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 08:27:12 -0700 (PDT) Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot To: Ian Lepore , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> From: Steven Hartland Message-ID: Date: Fri, 31 Mar 2017 16:27:12 +0100 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: <1490973411.64669.121.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 15:27:16 -0000 On 31/03/2017 16:16, Ian Lepore wrote: > On Fri, 2017-03-31 at 00:04 +0000, Allan Jude wrote: >> Add explicit_bzero() to libstand, and switch GELIBoot to using it > revolution > man explicit_bzero > No manual entry for explicit_bzero > > revolution > svn log -v explicit_bzero.c > ... > r272673 | delphij | 2014-10-06 22:54:11 -0600 (Mon, 06 Oct 2014) | 5 lines > > Add explicit_bzero(3) and its kernel counterpart. > > Obtained from: OpenBSD > > So... can anyone provide a clue what's "explicit" (or different in any > way) between explicit_bzero() and normal bzero()? > Not sure why your system doesn't find the main page, as it works on my 11 box, however does this help: https://www.freebsd.org/cgi/man.cgi?query=explicit_bzero&apropos=0&sektion=3&manpath=FreeBSD+11-current&format=html Regards Steve From owner-svn-src-all@freebsd.org Fri Mar 31 15:33:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FB7AD27BE9 for ; Fri, 31 Mar 2017 15:33:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 426ECD4F for ; Fri, 31 Mar 2017 15:33:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 463fe5fe-1627-11e7-8c45-c35e37f62db1 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 463fe5fe-1627-11e7-8c45-c35e37f62db1; Fri, 31 Mar 2017 15:32:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v2VFWrNU001464; Fri, 31 Mar 2017 09:32:53 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1490974373.64669.122.camel@freebsd.org> Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot From: Ian Lepore To: Steven Hartland , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 31 Mar 2017 09:32:53 -0600 In-Reply-To: References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 15:33:03 -0000  On Fri, 2017-03-31 at 16:27 +0100, Steven Hartland wrote: > On 31/03/2017 16:16, Ian Lepore wrote: > > > > On Fri, 2017-03-31 at 00:04 +0000, Allan Jude wrote: > > > > > >    Add explicit_bzero() to libstand, and switch GELIBoot to using > > > it > >      revolution > man explicit_bzero > >      No manual entry for explicit_bzero > > > >      revolution > svn log -v explicit_bzero.c > >      ... > >      r272673 | delphij | 2014-10-06 22:54:11 -0600 (Mon, 06 Oct > > 2014) | 5 lines > > > >      Add explicit_bzero(3) and its kernel counterpart. > > > >      Obtained from:  OpenBSD > > > > So... can anyone provide a clue what's "explicit" (or different in > > any > > way) between explicit_bzero() and normal bzero()? > > > Not sure why your system doesn't find the main page, as it works on > my  > 11 box, however does this help: > https://www.freebsd.org/cgi/man.cgi?query=explicit_bzero&apropos=0&se > ktion=3&manpath=FreeBSD+11-current&format=html > >      Regards >      Steve Oh, my bad, I forgot to check for a manpage on a newer system (I'm running 10.3-stable on my desktop but working with 11-stable all day, so I tend to forget that). Thanks. -- Ian From owner-svn-src-all@freebsd.org Fri Mar 31 15:46:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 16:04:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FE9D2754C for ; Fri, 31 Mar 2017 16:04:59 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto.OntheNet.com.au [203.13.68.12]) by mx1.freebsd.org (Postfix) with ESMTP id 2163387B for ; Fri, 31 Mar 2017 16:04:58 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTPS id C9D7D20AE991 for ; Sat, 1 Apr 2017 02:04:29 +1000 (AEST) Received: from localhost (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id B63D0280A35 for ; Sat, 1 Apr 2017 02:04:29 +1000 (AEST) X-Amavis-Modified: Mail body modified (using disclaimer) - iredmail.onthenet.com.au Received: from iredmail.onthenet.com.au ([127.0.0.1]) by localhost (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XcJjzKUh8f9J for ; Sat, 1 Apr 2017 02:04:29 +1000 (AEST) Received: from Peters-MacBook-Pro-2.local (96-82-80-65-static.hfc.comcastbusiness.net [96.82.80.65]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id DFF04280948; Sat, 1 Apr 2017 02:04:26 +1000 (AEST) Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot To: Ian Lepore , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> From: Peter Grehan Message-ID: Date: Fri, 31 Mar 2017 09:04:51 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <1490973411.64669.121.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Score: 0 X-CMAE-Analysis: v=2.2 cv=XKlAcUpE c=1 sm=1 tr=0 a=A6CF0fG5TOl4vs6YHvqXgw==:117 a=mwgbnDbW7alINpy3vhoKyg==:17 a=N659UExz7-8A:10 a=AzvcPWV-tVgA:10 a=6I5d2MoRAAAA:8 a=OL9DOvR4QgUlLbdjZqkA:9 a=pILNOxqGKmIA:10 a=wx1F2QrtflMA:10 a=82-kyh_VXv8A:10 a=IjZwj45LgO3ly-622nXo:22 wl=host:3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 16:04:59 -0000 > So... can anyone provide a clue what's "explicit" (or different in any > way) between explicit_bzero() and normal bzero()? https://www.freebsd.org/cgi/man.cgi?query=explicit_bzero&sektion=3&manpath=FreeBSD+12-current later, Peter. From owner-svn-src-all@freebsd.org Fri Mar 31 18:04:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44977D22578; Fri, 31 Mar 2017 18:04:36 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0956328A; Fri, 31 Mar 2017 18:04:35 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VI4ZNs078938; Fri, 31 Mar 2017 18:04:35 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VI4ZTF078937; Fri, 31 Mar 2017 18:04:35 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201703311804.v2VI4ZTF078937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Fri, 31 Mar 2017 18:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316336 - head/sys/dev/vnic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 18:04:36 -0000 Author: zbb Date: Fri Mar 31 18:04:34 2017 New Revision: 316336 URL: https://svnweb.freebsd.org/changeset/base/316336 Log: Rework BGX detection to support both new and old firmware Improve existing BGX detection and adjust it to support both new and older ThunderX firmwares. Match BGX FDT nodes by name and reg. Match PHY instances by qlm-mode and name. Tested on Firmware Version: 2016-09-30 09:12:11 Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D9863 Modified: head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/dev/vnic/thunder_bgx_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_bgx_fdt.c Fri Mar 31 15:46:47 2017 (r316335) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Fri Mar 31 18:04:34 2017 (r316336) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #define BGX_NODE_NAME "bgx" #define BGX_MAXID 9 +/* BGX func. 0, i.e.: reg = <0x8000 0 0 0 0>; DEVFN = 0x80 */ +#define BGX_DEVFN_0 0x80 #define FDT_NAME_MAXLEN 31 @@ -82,57 +84,136 @@ bgx_fdt_get_macaddr(phandle_t phy, uint8 } static boolean_t -bgx_fdt_phy_mode_match(struct bgx *bgx, char *qlm_mode, size_t size) +bgx_fdt_phy_mode_match(struct bgx *bgx, char *qlm_mode, ssize_t size) { - - size -= CONN_TYPE_OFFSET; + const char *type; + ssize_t sz; + ssize_t offset; switch (bgx->qlm_mode) { case QLM_MODE_SGMII: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "sgmii", size) == 0) - return (TRUE); + type = "sgmii"; + sz = sizeof("sgmii") - 1; + offset = size - sz; break; case QLM_MODE_XAUI_1X4: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "xaui", size) == 0) - return (TRUE); - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "dxaui", size) == 0) + type = "xaui"; + sz = sizeof("xaui") - 1; + offset = size - sz; + if (offset < 0) + return (FALSE); + if (strncmp(&qlm_mode[offset], type, sz) == 0) return (TRUE); + type = "dxaui"; + sz = sizeof("dxaui") - 1; + offset = size - sz; break; case QLM_MODE_RXAUI_2X2: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "raui", size) == 0) - return (TRUE); + type = "raui"; + sz = sizeof("raui") - 1; + offset = size - sz; break; case QLM_MODE_XFI_4X1: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "xfi", size) == 0) - return (TRUE); + type = "xfi"; + sz = sizeof("xfi") - 1; + offset = size - sz; break; case QLM_MODE_XLAUI_1X4: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "xlaui", size) == 0) - return (TRUE); + type = "xlaui"; + sz = sizeof("xlaui") - 1; + offset = size - sz; break; case QLM_MODE_10G_KR_4X1: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "xfi-10g-kr", size) == 0) - return (TRUE); + type = "xfi-10g-kr"; + sz = sizeof("xfi-10g-kr") - 1; + offset = size - sz; break; case QLM_MODE_40G_KR4_1X4: - if (strncmp(&qlm_mode[CONN_TYPE_OFFSET], "xlaui-40g-kr", size) == 0) + type = "xlaui-40g-kr"; + sz = sizeof("xlaui-40g-kr") - 1; + offset = size - sz; + break; + default: + return (FALSE); + } + + if (offset < 0) + return (FALSE); + + if (strncmp(&qlm_mode[offset], type, sz) == 0) + return (TRUE); + + return (FALSE); +} + +static boolean_t +bgx_fdt_phy_name_match(struct bgx *bgx, char *phy_name, ssize_t size) +{ + const char *type; + ssize_t sz; + + switch (bgx->qlm_mode) { + case QLM_MODE_SGMII: + type = "sgmii"; + sz = sizeof("sgmii") - 1; + break; + case QLM_MODE_XAUI_1X4: + type = "xaui"; + sz = sizeof("xaui") - 1; + if (sz < size) + return (FALSE); + if (strncmp(phy_name, type, sz) == 0) return (TRUE); + type = "dxaui"; + sz = sizeof("dxaui") - 1; + break; + case QLM_MODE_RXAUI_2X2: + type = "raui"; + sz = sizeof("raui") - 1; + break; + case QLM_MODE_XFI_4X1: + type = "xfi"; + sz = sizeof("xfi") - 1; + break; + case QLM_MODE_XLAUI_1X4: + type = "xlaui"; + sz = sizeof("xlaui") - 1; + break; + case QLM_MODE_10G_KR_4X1: + type = "xfi-10g-kr"; + sz = sizeof("xfi-10g-kr") - 1; + break; + case QLM_MODE_40G_KR4_1X4: + type = "xlaui-40g-kr"; + sz = sizeof("xlaui-40g-kr") - 1; break; default: return (FALSE); } + if (sz > size) + return (FALSE); + if (strncmp(phy_name, type, sz) == 0) + return (TRUE); + return (FALSE); } static phandle_t -bgx_fdt_traverse_nodes(phandle_t start, char *name, size_t len) +bgx_fdt_traverse_nodes(uint8_t unit, phandle_t start, char *name, + size_t len) { phandle_t node, ret; + uint32_t *reg; size_t buf_size; + ssize_t proplen; char *node_name; int err; + /* + * Traverse all subordinate nodes of 'start' to find BGX instance. + * This supports both old (by name) and new (by reg) methods. + */ buf_size = sizeof(*node_name) * FDT_NAME_MAXLEN; if (len > buf_size) { /* @@ -148,17 +229,49 @@ bgx_fdt_traverse_nodes(phandle_t start, memset(node_name, 0, buf_size); /* Recurse to children */ if (OF_child(node) != 0) { - ret = bgx_fdt_traverse_nodes(node, name, len); + ret = bgx_fdt_traverse_nodes(unit, node, name, len); if (ret != 0) { free(node_name, M_BGX); return (ret); } } - err = OF_getprop(node, "name", node_name, FDT_NAME_MAXLEN); - if ((err > 0) && (strncmp(node_name, name, len) == 0)) { + /* + * Old way - by name + */ + proplen = OF_getproplen(node, "name"); + if ((proplen <= 0) || (proplen < len)) + continue; + + err = OF_getprop(node, "name", node_name, proplen); + if (err <= 0) + continue; + + if (strncmp(node_name, name, len) == 0) { free(node_name, M_BGX); return (node); } + /* + * New way - by reg + */ + /* Check if even BGX */ + if (strncmp(node_name, + BGX_NODE_NAME, sizeof(BGX_NODE_NAME) - 1) != 0) + continue; + /* Get reg */ + err = OF_getencprop_alloc(node, "reg", sizeof(*reg), + (void **)®); + if (err == -1) { + free(reg, M_OFWPROP); + continue; + } + + /* Match BGX device function */ + if ((BGX_DEVFN_0 + unit) == (reg[0] >> 8)) { + free(reg, M_OFWPROP); + free(node_name, M_BGX); + return (node); + } + free(reg, M_OFWPROP); } free(node_name, M_BGX); @@ -249,7 +362,7 @@ bgx_fdt_find_node(struct bgx *bgx) goto out; } - node = bgx_fdt_traverse_nodes(node, bgx_sel, len); + node = bgx_fdt_traverse_nodes(bgx->bgx_id, node, bgx_sel, len); out: free(bgx_sel, M_BGX); return (node); @@ -258,8 +371,10 @@ out: int bgx_fdt_init_phy(struct bgx *bgx) { + char *node_name; phandle_t node, child; phandle_t phy, mdio; + ssize_t len; uint8_t lmac; char qlm_mode[CONN_TYPE_MAXLEN]; @@ -272,20 +387,28 @@ bgx_fdt_init_phy(struct bgx *bgx) lmac = 0; for (child = OF_child(node); child > 0; child = OF_peer(child)) { - if (OF_getprop(child, "qlm-mode", qlm_mode, - sizeof(qlm_mode)) <= 0) { - /* Missing qlm-mode, skipping */ - continue; - } + len = OF_getprop(child, "qlm-mode", qlm_mode, sizeof(qlm_mode)); + if (len > 0) { + if (!bgx_fdt_phy_mode_match(bgx, qlm_mode, len)) { + /* + * Connection type not match with BGX mode. + */ + continue; + } + } else { + len = OF_getprop_alloc(child, "name", 1, + (void **)&node_name); + if (len <= 0) { + continue; + } - if (!bgx_fdt_phy_mode_match(bgx, qlm_mode, sizeof(qlm_mode))) { - /* - * Connection type not match with BGX mode. - */ - continue; + if (!bgx_fdt_phy_name_match(bgx, node_name, len)) { + free(node_name, M_OFWPROP); + continue; + } + free(node_name, M_OFWPROP); } - /* Acquire PHY address */ if (OF_getencprop(child, "reg", &bgx->lmac[lmac].phyaddr, sizeof(bgx->lmac[lmac].phyaddr)) <= 0) { From owner-svn-src-all@freebsd.org Fri Mar 31 18:45:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86231D26571; Fri, 31 Mar 2017 18:45:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61C3523C; Fri, 31 Mar 2017 18:45:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 17FAB10A82E; Fri, 31 Mar 2017 14:45:44 -0400 (EDT) From: John Baldwin To: Peter Grehan Cc: Ian Lepore , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot Date: Fri, 31 Mar 2017 11:29:20 -0700 Message-ID: <11865010.raXmoPpVZB@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 31 Mar 2017 14:45:44 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 18:45:52 -0000 On Friday, March 31, 2017 09:04:51 AM Peter Grehan wrote: > > So... can anyone provide a clue what's "explicit" (or different in any > > way) between explicit_bzero() and normal bzero()? > > > https://www.freebsd.org/cgi/man.cgi?query=explicit_bzero&sektion=3&manpath=FreeBSD+12-current It should be called 'bzero_now_I_mean_it()' (but then we would need some other function called anybody_want_a_peanut()) -- John Baldwin From owner-svn-src-all@freebsd.org Fri Mar 31 19:12:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EC05D26C40; Fri, 31 Mar 2017 19:12:06 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E88DB685; Fri, 31 Mar 2017 19:12:05 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6BC4C5A9F14; Fri, 31 Mar 2017 19:11:58 +0000 (UTC) Date: Fri, 31 Mar 2017 19:11:58 +0000 From: Brooks Davis To: John Baldwin Cc: Peter Grehan , Ian Lepore , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot Message-ID: <20170331191158.GA76402@spindle.one-eyed-alien.net> References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> <11865010.raXmoPpVZB@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L" Content-Disposition: inline In-Reply-To: <11865010.raXmoPpVZB@ralph.baldwin.cx> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 19:12:06 -0000 --FCuugMFkClbJLl1L Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 31, 2017 at 11:29:20AM -0700, John Baldwin wrote: > On Friday, March 31, 2017 09:04:51 AM Peter Grehan wrote: > > > So... can anyone provide a clue what's "explicit" (or different in any > > > way) between explicit_bzero() and normal bzero()? > >=20 > > =20 > > https://www.freebsd.org/cgi/man.cgi?query=3Dexplicit_bzero&sektion=3D3&= manpath=3DFreeBSD+12-current >=20 > It should be called 'bzero_now_I_mean_it()' >=20 > (but then we would need some other function called anybody_want_a_peanut(= )) It's sole purpose is to prevent the compiler from observing a pattern like: char a_secret_key[len]; ... bzero(a_secret_key, len); return; or char *a_secret_key =3D malloc(len); ... bzero(a_secret_key, len); free(a_secret_key); And optimizing away bzero() because it knows what bzero() does and that nothing will ever access it as far as the C language is concerned.. The moment you enable LTO all bets are off because it can pattern match the code for explicit_bzero(), realize that it is that same as bzero() and combine them. Declaring a_secret_key volatile likely makes things work, but the C language is deficient in not providing a way to express something like explicit_bzero() sanely and reliable. -- Brooks --FCuugMFkClbJLl1L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJY3qn9AAoJEKzQXbSebgfAyGgH/ikmplOVu4qvBRFWua0KdtWp ksMZZAASA3Yo3DK/rNmkU3jwGqHpthX9TmRfMmN4TgvNlUskgCZ4Co1oaMgMIZET hVVYbLEapiLjAOAwqGyWwsQ789Zy3R48BvmF+7NLoGGcoU6XqJ8qwQ24yNxSH4fh JpmNPqd0+Kr4FKSKmLDdJXY836vF2RuTgb/rLV8xDdOn7qpP40kuoIjCv5GnsJpI YtF3COIkWO5KyoiDxD6724MzlyQ5fG8IfftNgjBClcq+v4xKu6j84FvcYjU0tmNW 5eVOeARRwYd6LaZ5DPdBwpM6dcleW3MQs4psC3HNjieGrVJjEbiRZUGJVNCvnfA= =D/9W -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L-- From owner-svn-src-all@freebsd.org Fri Mar 31 20:16:26 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 20:17:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Fri Mar 31 21:29:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2D37D278C0; Fri, 31 Mar 2017 21:29:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C34EFA8; Fri, 31 Mar 2017 21:29:44 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VLTh4M062042; Fri, 31 Mar 2017 21:29:43 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VLThlt062036; Fri, 31 Mar 2017 21:29:43 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201703312129.v2VLThlt062036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Fri, 31 Mar 2017 21:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316339 - head/contrib/less X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 21:29:44 -0000 Author: rwatson Date: Fri Mar 31 21:29:43 2017 New Revision: 316339 URL: https://svnweb.freebsd.org/changeset/base/316339 Log: Currently, less(1) uses K&R prototypes, which both fails to provide useful compiler-time type checking, and also causes problems for targets where multiple incompatible calling conventions may be selected based on argument types. This change switches less(1) to ANSI prototypes. While there, we also remove use of "register", and attempt to use "const" a bit better now that the compiler can check argument types. Reviewed by: cem, emaste MFC after: 3 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10152 Modified: head/contrib/less/brac.c head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/lessecho.c head/contrib/less/lesskey.c head/contrib/less/line.c head/contrib/less/linenum.c head/contrib/less/lsystem.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkhelp.c head/contrib/less/optfunc.c head/contrib/less/option.c head/contrib/less/opttbl.c head/contrib/less/os.c head/contrib/less/output.c head/contrib/less/pattern.c head/contrib/less/position.c head/contrib/less/prompt.c head/contrib/less/regexp.c head/contrib/less/screen.c head/contrib/less/scrsize.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ttyin.c Modified: head/contrib/less/brac.c ============================================================================== --- head/contrib/less/brac.c Fri Mar 31 20:17:30 2017 (r316338) +++ head/contrib/less/brac.c Fri Mar 31 21:29:43 2017 (r316339) @@ -24,18 +24,14 @@ * "close bracket" are given. */ public void -match_brac(obrac, cbrac, forwdir, n) - register int obrac; - register int cbrac; - int forwdir; - int n; +match_brac(int obrac, int cbrac, int forwdir, int n) { - register int c; - register int nest; + int c; + int nest; POSITION pos; - int (*chget)(); + int (*chget)(void); - extern int ch_forw_get(), ch_back_get(); + extern int ch_forw_get(void), ch_back_get(void); /* * Seek to the line containing the open bracket. Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Fri Mar 31 20:17:30 2017 (r316338) +++ head/contrib/less/ch.c Fri Mar 31 21:29:43 2017 (r316339) @@ -144,13 +144,13 @@ static int ch_addbuf(); * Get the character pointed to by the read pointer. */ int -ch_get() +ch_get(void) { - register struct buf *bp; - register struct bufnode *bn; - register int n; - register int slept; - register int h; + struct buf *bp; + struct bufnode *bn; + int n; + int slept; + int h; POSITION pos; POSITION len; @@ -378,8 +378,7 @@ ch_get() * a single char onto an input file descriptor. */ public void -ch_ungetchar(c) - int c; +ch_ungetchar(int c) { if (c != -1 && ch_ungotchar != -1) error("ch_ungetchar overrun", NULL_PARG); @@ -392,7 +391,7 @@ ch_ungetchar(c) * If we haven't read all of standard input into it, do that now. */ public void -end_logfile() +end_logfile(void) { static int tried = FALSE; @@ -417,10 +416,10 @@ end_logfile() * Write all the existing buffered data to the log file. */ public void -sync_logfile() +sync_logfile(void) { - register struct buf *bp; - register struct bufnode *bn; + struct buf *bp; + struct bufnode *bn; int warned = FALSE; BLOCKNUM block; BLOCKNUM nblocks; @@ -454,12 +453,11 @@ sync_logfile() * Determine if a specific block is currently in one of the buffers. */ static int -buffered(block) - BLOCKNUM block; +buffered(BLOCKNUM block) { - register struct buf *bp; - register struct bufnode *bn; - register int h; + struct buf *bp; + struct bufnode *bn; + int h; h = BUFHASH(block); FOR_BUFS_IN_CHAIN(h, bn) @@ -476,8 +474,7 @@ buffered(block) * Return 0 if successful, non-zero if can't seek there. */ public int -ch_seek(pos) - register POSITION pos; +ch_seek(POSITION pos) { BLOCKNUM new_block; POSITION len; @@ -515,7 +512,7 @@ ch_seek(pos) * Seek to the end of the file. */ public int -ch_end_seek() +ch_end_seek(void) { POSITION len; @@ -542,10 +539,10 @@ ch_end_seek() * Seek to the last position in the file that is currently buffered. */ public int -ch_end_buffer_seek() +ch_end_buffer_seek(void) { - register struct buf *bp; - register struct bufnode *bn; + struct buf *bp; + struct bufnode *bn; POSITION buf_pos; POSITION end_pos; @@ -570,10 +567,10 @@ ch_end_buffer_seek() * beginning of the pipe is no longer buffered. */ public int -ch_beg_seek() +ch_beg_seek(void) { - register struct bufnode *bn; - register struct bufnode *firstbn; + struct bufnode *bn; + struct bufnode *firstbn; /* * Try a plain ch_seek first. @@ -602,7 +599,7 @@ ch_beg_seek() * Return the length of the file, if known. */ public POSITION -ch_length() +ch_length(void) { if (thisfile == NULL) return (NULL_POSITION); @@ -619,7 +616,7 @@ ch_length() * Return the current position in the file. */ public POSITION -ch_tell() +ch_tell(void) { if (thisfile == NULL) return (NULL_POSITION); @@ -630,9 +627,9 @@ ch_tell() * Get the current char and post-increment the read pointer. */ public int -ch_forw_get() +ch_forw_get(void) { - register int c; + int c; if (thisfile == NULL) return (EOI); @@ -653,7 +650,7 @@ ch_forw_get() * Pre-decrement the read pointer and get the new current char. */ public int -ch_back_get() +ch_back_get(void) { if (thisfile == NULL) return (EOI); @@ -676,8 +673,7 @@ ch_back_get() * bufspace is in units of 1024 bytes. -1 mean no limit. */ public void -ch_setbufspace(bufspace) - int bufspace; +ch_setbufspace(int bufspace) { if (bufspace < 0) maxbufs = -1; @@ -693,9 +689,9 @@ ch_setbufspace(bufspace) * Flush (discard) any saved file state, including buffer contents. */ public void -ch_flush() +ch_flush(void) { - register struct bufnode *bn; + struct bufnode *bn; if (thisfile == NULL) return; @@ -760,10 +756,10 @@ ch_flush() * The buffer is added to the tail of the buffer chain. */ static int -ch_addbuf() +ch_addbuf(void) { - register struct buf *bp; - register struct bufnode *bn; + struct buf *bp; + struct bufnode *bn; /* * Allocate and initialize a new buffer and link it @@ -785,9 +781,9 @@ ch_addbuf() * */ static void -init_hashtbl() +init_hashtbl(void) { - register int h; + int h; for (h = 0; h < BUFHASH_SIZE; h++) { @@ -800,9 +796,9 @@ init_hashtbl() * Delete all buffers for this file. */ static void -ch_delbufs() +ch_delbufs(void) { - register struct bufnode *bn; + struct bufnode *bn; while (ch_bufhead != END_OF_CHAIN) { @@ -818,8 +814,7 @@ ch_delbufs() * Is it possible to seek on a file descriptor? */ public int -seekable(f) - int f; +seekable(int f) { #if MSDOS_COMPILER extern int fd0; @@ -840,7 +835,7 @@ seekable(f) * This is used after an ignore_eof read, during which the EOF may change. */ public void -ch_set_eof() +ch_set_eof(void) { ch_fsize = ch_fpos; } @@ -850,9 +845,7 @@ ch_set_eof() * Initialize file state for a new file. */ public void -ch_init(f, flags) - int f; - int flags; +ch_init(int f, int flags) { /* * See if we already have a filestate for this file. @@ -891,7 +884,7 @@ ch_init(f, flags) * Close a filestate. */ public void -ch_close() +ch_close(void) { int keepstate = FALSE; @@ -934,7 +927,7 @@ ch_close() * Return ch_flags for the current file. */ public int -ch_getflags() +ch_getflags(void) { if (thisfile == NULL) return (0); Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Fri Mar 31 20:17:30 2017 (r316338) +++ head/contrib/less/charset.c Fri Mar 31 21:29:43 2017 (r316339) @@ -130,12 +130,11 @@ public int binattr = AT_STANDOUT; * c control character */ static void -ichardef(s) - char *s; +ichardef(char *s) { - register char *cp; - register int n; - register char v; + char *cp; + int n; + char v; n = 0; v = 0; @@ -187,12 +186,10 @@ ichardef(s) * The valid charset names are listed in the "charsets" array. */ static int -icharset(name, no_error) - register char *name; - int no_error; +icharset(char *name, int no_error) { - register struct charset *p; - register struct cs_alias *a; + struct charset *p; + struct cs_alias *a; if (name == NULL || *name == '\0') return (0); @@ -230,9 +227,9 @@ icharset(name, no_error) * Define a charset, given a locale name. */ static void -ilocale() +ilocale(void) { - register int c; + int c; for (c = 0; c < (int) sizeof(chardef); c++) { @@ -250,10 +247,7 @@ ilocale() * Define the printing format for control (or binary utf) chars. */ static void -setbinfmt(s, fmtvarptr, default_fmt) - char *s; - char **fmtvarptr; - char *default_fmt; +setbinfmt(char *s, char **fmtvarptr, char *default_fmt) { if (s && utf_mode) { @@ -299,7 +293,7 @@ setbinfmt(s, fmtvarptr, default_fmt) * */ static void -set_charset() +set_charset(void) { char *s; @@ -370,7 +364,7 @@ set_charset() * Initialize charset data structures. */ public void -init_charset() +init_charset(void) { char *s; @@ -391,8 +385,7 @@ init_charset() * Is a given character a "binary" character? */ public int -binary_char(c) - LWCHAR c; +binary_char(LWCHAR c) { if (utf_mode) return (is_ubin_char(c)); @@ -404,8 +397,7 @@ binary_char(c) * Is a given character a "control" character? */ public int -control_char(c) - LWCHAR c; +control_char(LWCHAR c) { c &= 0377; return (chardef[c] & IS_CONTROL_CHAR); @@ -416,8 +408,7 @@ control_char(c) * For example, in the "ascii" charset '\3' is printed as "^C". */ public char * -prchar(c) - LWCHAR c; +prchar(LWCHAR c) { /* {{ This buffer can be overrun if LESSBINFMT is a long string. }} */ static char buf[32]; @@ -452,8 +443,7 @@ prchar(c) * Return the printable form of a UTF-8 character. */ public char * -prutfchar(ch) - LWCHAR ch; +prutfchar(LWCHAR ch) { static char buf[32]; @@ -483,8 +473,7 @@ prutfchar(ch) * Get the length of a UTF-8 character in bytes. */ public int -utf_len(ch) - char ch; +utf_len(char ch) { if ((ch & 0x80) == 0) return 1; @@ -506,9 +495,7 @@ utf_len(ch) * Does the parameter point to the lead byte of a well-formed UTF-8 character? */ public int -is_utf8_well_formed(s, slen) - unsigned char *s; - int slen; +is_utf8_well_formed(unsigned char *s, int slen) { int i; int len; @@ -543,9 +530,7 @@ is_utf8_well_formed(s, slen) * Return number of invalid UTF-8 sequences found in a buffer. */ public int -utf_bin_count(data, len) - unsigned char *data; - int len; +utf_bin_count(unsigned char *data, int len) { int bin_count = 0; while (len > 0) @@ -572,8 +557,7 @@ utf_bin_count(data, len) * Get the value of a UTF-8 character. */ public LWCHAR -get_wchar(p) - char *p; +get_wchar(constant char *p) { switch (utf_len(p[0])) { @@ -624,9 +608,7 @@ get_wchar(p) * Store a character into a UTF-8 string. */ public void -put_wchar(pp, ch) - char **pp; - LWCHAR ch; +put_wchar(char **pp, LWCHAR ch) { if (!utf_mode || ch < 0x80) { @@ -674,14 +656,11 @@ put_wchar(pp, ch) * Step forward or backward one character in a string. */ public LWCHAR -step_char(pp, dir, limit) - char **pp; - signed int dir; - char *limit; +step_char(constant char **pp, signed int dir, constant char *limit) { LWCHAR ch; int len; - char *p = *pp; + constant char *p = *pp; if (!utf_mode) { @@ -744,9 +723,7 @@ static struct wchar_range comb_table[] = static int -is_in_table(ch, table) - LWCHAR ch; - struct wchar_range_table *table; +is_in_table(LWCHAR ch, struct wchar_range_table *table) { int hi; int lo; @@ -774,8 +751,7 @@ is_in_table(ch, table) * If a composing character follows any char, the two combine into one glyph. */ public int -is_composing_char(ch) - LWCHAR ch; +is_composing_char(LWCHAR ch) { return is_in_table(ch, &compose_table); } @@ -784,8 +760,7 @@ is_composing_char(ch) * Should this UTF-8 character be treated as binary? */ public int -is_ubin_char(ch) - LWCHAR ch; +is_ubin_char(LWCHAR ch) { return is_in_table(ch, &ubin_table); } @@ -794,8 +769,7 @@ is_ubin_char(ch) * Is this a double width UTF-8 character? */ public int -is_wide_char(ch) - LWCHAR ch; +is_wide_char(LWCHAR ch) { return is_in_table(ch, &wide_table); } @@ -806,9 +780,7 @@ is_wide_char(ch) * a specific char (not any char), the two combine into one glyph. */ public int -is_combining_char(ch1, ch2) - LWCHAR ch1; - LWCHAR ch2; +is_combining_char(LWCHAR ch1, LWCHAR ch2) { /* The table is small; use linear search. */ int i; Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Fri Mar 31 20:17:30 2017 (r316338) +++ head/contrib/less/cmdbuf.c Fri Mar 31 21:29:43 2017 (r316339) @@ -32,7 +32,7 @@ static int literal; /* Next input char static int updown_match = -1; /* Prefix length in up/down movement */ #if TAB_COMPLETE_FILENAME -static int cmd_complete(); +static int cmd_complete(int action); /* * These variables are statics used by cmd_complete. */ @@ -114,7 +114,7 @@ static int cmd_mbc_buf_index; * Reset command buffer (to empty). */ public void -cmd_reset() +cmd_reset(void) { cp = cmdbuf; *cp = '\0'; @@ -129,7 +129,7 @@ cmd_reset() * Clear command line. */ public void -clear_cmd() +clear_cmd(void) { cmd_col = prompt_col = 0; cmd_mbc_buf_len = 0; @@ -140,15 +140,14 @@ clear_cmd() * Display a string, usually as a prompt for input into the command buffer. */ public void -cmd_putstr(s) - char *s; +cmd_putstr(constant char *s) { LWCHAR prev_ch = 0; LWCHAR ch; - char *endline = s + strlen(s); + constant char *endline = s + strlen(s); while (*s != '\0') { - char *ns = s; + constant char *ns = s; ch = step_char(&ns, +1, endline); while (s < ns) putchr(*s++); @@ -171,10 +170,10 @@ cmd_putstr(s) * How many characters are in the command buffer? */ public int -len_cmdbuf() +len_cmdbuf(void) { - char *s = cmdbuf; - char *endline = s + strlen(s); + constant char *s = cmdbuf; + constant char *endline = s + strlen(s); int len = 0; while (*s != '\0') @@ -189,12 +188,7 @@ len_cmdbuf() * Common part of cmd_step_right() and cmd_step_left(). */ static char * -cmd_step_common(p, ch, len, pwidth, bswidth) - char *p; - LWCHAR ch; - int len; - int *pwidth; - int *bswidth; +cmd_step_common(constant char *p, LWCHAR ch, int len, int *pwidth, int *bswidth) { char *pr; @@ -256,13 +250,10 @@ cmd_step_common(p, ch, len, pwidth, bswi * Step a pointer one character right in the command buffer. */ static char * -cmd_step_right(pp, pwidth, bswidth) - char **pp; - int *pwidth; - int *bswidth; +cmd_step_right(char **pp, int *pwidth, int *bswidth) { char *p = *pp; - LWCHAR ch = step_char(pp, +1, p + strlen(p)); + LWCHAR ch = step_char((constant char **)pp, +1, p + strlen(p)); return cmd_step_common(p, ch, *pp - p, pwidth, bswidth); } @@ -271,13 +262,10 @@ cmd_step_right(pp, pwidth, bswidth) * Step a pointer one character left in the command buffer. */ static char * -cmd_step_left(pp, pwidth, bswidth) - char **pp; - int *pwidth; - int *bswidth; +cmd_step_left(char **pp, int *pwidth, int *bswidth) { char *p = *pp; - LWCHAR ch = step_char(pp, -1, cmdbuf); + LWCHAR ch = step_char((constant char **)pp, -1, cmdbuf); return cmd_step_common(*pp, ch, p - *pp, pwidth, bswidth); } @@ -287,8 +275,7 @@ cmd_step_left(pp, pwidth, bswidth) * Then position the cursor just after the char old_cp (a pointer into cmdbuf). */ static void -cmd_repaint(old_cp) - char *old_cp; +cmd_repaint(char *old_cp) { /* * Repaint the line from the current position. @@ -298,7 +285,7 @@ cmd_repaint(old_cp) { char *np = cp; int width; - char *pr = cmd_step_right(&np, &width, NULL); + constant char *pr = cmd_step_right(&np, &width, NULL); if (cmd_col + width >= sc_width) break; cp = np; @@ -328,7 +315,7 @@ cmd_repaint(old_cp) * and set cp to the corresponding char in cmdbuf. */ static void -cmd_home() +cmd_home(void) { while (cmd_col > prompt_col) { @@ -347,7 +334,7 @@ cmd_home() * Shift the cmdbuf display left a half-screen. */ static void -cmd_lshift() +cmd_lshift(void) { char *s; char *save_cp; @@ -385,7 +372,7 @@ cmd_lshift() * Shift the cmdbuf display right a half-screen. */ static void -cmd_rshift() +cmd_rshift(void) { char *s; char *save_cp; @@ -415,7 +402,7 @@ cmd_rshift() * Move cursor right one character. */ static int -cmd_right() +cmd_right(void) { char *pr; char *ncp; @@ -450,7 +437,7 @@ cmd_right() * Move cursor left one character. */ static int -cmd_left() +cmd_left(void) { char *ncp; int width, bswidth; @@ -480,9 +467,7 @@ cmd_left() * Insert a char into the command buffer, at the current position. */ static int -cmd_ichar(cs, clen) - char *cs; - int clen; +cmd_ichar(char *cs, int clen) { char *s; @@ -517,9 +502,9 @@ cmd_ichar(cs, clen) * Delete the char to the left of the cursor. */ static int -cmd_erase() +cmd_erase(void) { - register char *s; + char *s; int clen; if (cp == cmdbuf) @@ -566,7 +551,7 @@ cmd_erase() * Delete the char under the cursor. */ static int -cmd_delete() +cmd_delete(void) { if (*cp == '\0') { @@ -585,7 +570,7 @@ cmd_delete() * Delete the "word" to the left of the cursor. */ static int -cmd_werase() +cmd_werase(void) { if (cp > cmdbuf && cp[-1] == ' ') { @@ -611,7 +596,7 @@ cmd_werase() * Delete the "word" under the cursor. */ static int -cmd_wdelete() +cmd_wdelete(void) { if (*cp == ' ') { @@ -637,7 +622,7 @@ cmd_wdelete() * Delete all chars in the command buffer. */ static int -cmd_kill() +cmd_kill(void) { if (cmdbuf[0] == '\0') { @@ -663,9 +648,7 @@ cmd_kill() * Select an mlist structure to be the current command history. */ public void -set_mlist(mlist, cmdflags) - void *mlist; - int cmdflags; +set_mlist(constant void *mlist, int cmdflags) { #if CMD_HISTORY curr_mlist = (struct mlist *) mlist; @@ -684,8 +667,7 @@ set_mlist(mlist, cmdflags) * cmdbuf's corresponding chars. */ static int -cmd_updown(action) - int action; +cmd_updown(int action) { char *s; struct mlist *ml; @@ -747,10 +729,7 @@ cmd_updown(action) * Add a string to an mlist. */ public void -cmd_addhist(mlist, cmd, modified) - struct mlist *mlist; - char *cmd; - int modified; +cmd_addhist(struct mlist *constant mlist, char *cmd, int modified) { #if CMD_HISTORY struct mlist *ml; @@ -793,7 +772,7 @@ cmd_addhist(mlist, cmd, modified) * Add it to the currently selected history list. */ public void -cmd_accept() +cmd_accept(void) { #if CMD_HISTORY /* @@ -815,8 +794,7 @@ cmd_accept() * CC_QUIT The char requests the current command to be aborted. */ static int -cmd_edit(c) - int c; +cmd_edit(int c) { int action; int flags; @@ -931,8 +909,7 @@ cmd_edit(c) * Insert a string into the command buffer, at the current position. */ static int -cmd_istr(str) - char *str; +cmd_istr(char *str) { char *s; int action; @@ -941,7 +918,7 @@ cmd_istr(str) for (s = str; *s != '\0'; ) { char *os = s; - step_char(&s, +1, endline); + step_char((constant char **)&s, +1, endline); action = cmd_ichar(os, s - os); if (action != CC_OK) { @@ -959,7 +936,7 @@ cmd_istr(str) * cursor at the end of the word. */ static char * -delimit_word() +delimit_word(void) { char *word; #if SPACES_IN_FILENAMES @@ -1046,7 +1023,7 @@ delimit_word() * which start with that word, and set tk_text to that list. */ static void -init_compl() +init_compl(void) { char *word; char c; @@ -1109,9 +1086,7 @@ init_compl() * Return the next word in the current completion list. */ static char * -next_compl(action, prev) - int action; - char *prev; +next_compl(int action, char *prev) { switch (action) { @@ -1131,8 +1106,7 @@ next_compl(action, prev) * or a subsequent time (step thru the list). */ static int -cmd_complete(action) - int action; +cmd_complete(int action) { char *s; @@ -1229,8 +1203,7 @@ fail: * CC_ERROR The char could not be accepted due to an error. */ public int -cmd_char(c) - int c; +cmd_char(int c) { int action; int len; @@ -1319,8 +1292,7 @@ cmd_char(c) * Return the number currently in the command buffer. */ public LINENUM -cmd_int(frac) - long *frac; +cmd_int(long *frac) { char *p; LINENUM n = 0; @@ -1341,7 +1313,7 @@ cmd_int(frac) * Return a pointer to the command buffer. */ public char * -get_cmdbuf() +get_cmdbuf(void) { return (cmdbuf); } @@ -1351,7 +1323,7 @@ get_cmdbuf() * Return the last (most recent) string in the current command history. */ public char * -cmd_lastpattern() +cmd_lastpattern(void) { if (curr_mlist == NULL) return (NULL); @@ -1363,8 +1335,7 @@ cmd_lastpattern() /* */ static int -mlist_size(ml) - struct mlist *ml; +mlist_size(struct mlist *ml) { int size = 0; for (ml = ml->next; ml->string != NULL; ml = ml->next) @@ -1376,7 +1347,7 @@ mlist_size(ml) * Get the name of the history file. */ static char * -histfile_name() +histfile_name(void) { char *home; char *name; @@ -1416,11 +1387,8 @@ histfile_name() * Read a .lesshst file and call a callback for each line in the file. */ static void -read_cmdhist2(action, uparam, skip_search, skip_shell) - void (*action)(void*,struct mlist*,char*); - void *uparam; - int skip_search; - int skip_shell; +read_cmdhist2(void (*action)(void*,struct mlist*,char*), void *uparam, + int skip_search, int skip_shell) { struct mlist *ml = NULL; char line[CMDBUF_SIZE]; @@ -1480,11 +1448,8 @@ read_cmdhist2(action, uparam, skip_searc } static void -read_cmdhist(action, uparam, skip_search, skip_shell) - void (*action)(void*,struct mlist*,char*); - void *uparam; - int skip_search; - int skip_shell; +read_cmdhist(void (*action)(void*,struct mlist*,char*), void *uparam, + int skip_search, int skip_shell) { read_cmdhist2(action, uparam, skip_search, skip_shell); (*action)(uparam, NULL, NULL); /* signal end of file */ @@ -1503,7 +1468,7 @@ addhist_init(void *uparam, struct mlist * Initialize history from a .lesshist file. */ public void -init_cmdhist() +init_cmdhist(void) { #if CMD_HISTORY read_cmdhist(&addhist_init, NULL, 0, 0); @@ -1515,9 +1480,7 @@ init_cmdhist() */ #if CMD_HISTORY static void -write_mlist_header(ml, f) - struct mlist *ml; - FILE *f; +write_mlist_header(struct mlist *ml, FILE *f) { if (ml == &mlist_search) fprintf(f, "%s\n", HISTFILE_SEARCH_SECTION); @@ -1531,9 +1494,7 @@ write_mlist_header(ml, f) * Write all modified entries in an mlist to the history file. */ static void -write_mlist(ml, f) - struct mlist *ml; - FILE *f; +write_mlist(struct mlist *ml, FILE *f) { for (ml = ml->next; ml->string != NULL; ml = ml->next) { @@ -1549,8 +1510,7 @@ write_mlist(ml, f) * Make a temp name in the same directory as filename. */ static char * -make_tempname(filename) - char *filename; +make_tempname(char *filename) { char lastch; char *tempname = ecalloc(1, strlen(filename)+1); @@ -1613,8 +1573,7 @@ copy_hist(void *uparam, struct mlist *ml * Make a file readable only by its owner. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Mar 31 22:05:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93AADD27713; Fri, 31 Mar 2017 22:05:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ADECD88; Fri, 31 Mar 2017 22:05:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2VM5A3A078704; Fri, 31 Mar 2017 22:05:10 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2VM5AOP078703; Fri, 31 Mar 2017 22:05:10 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201703312205.v2VM5AOP078703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 31 Mar 2017 22:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316340 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Mar 2017 22:05:11 -0000 Author: adrian Date: Fri Mar 31 22:05:10 2017 New Revision: 316340 URL: https://svnweb.freebsd.org/changeset/base/316340 Log: [ifconfig] add some comments around missing net80211 VHT configuration. VHT STBC, A-MPDU density and A-MPDU size configuration parameters are different when doing VHT. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Mar 31 21:29:43 2017 (r316339) +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 31 22:05:10 2017 (r316340) @@ -1758,6 +1758,7 @@ set80211shortgi(const char *val, int d, 0, NULL); } +/* XXX 11ac density/size is different */ static void set80211ampdu(const char *val, int d, int s, const struct afswtch *rafp) { @@ -1831,6 +1832,7 @@ DECL_CMD_FUNC(set80211ampdulimit, val, d set80211(s, IEEE80211_IOC_AMPDU_LIMIT, v, 0, NULL); } +/* XXX 11ac density/size is different */ static DECL_CMD_FUNC(set80211ampdudensity, val, d) { @@ -4957,6 +4959,7 @@ end: break; } } + /* XXX 11ac density/size is different */ if (get80211val(s, IEEE80211_IOC_AMPDU_LIMIT, &val) != -1) { switch (val) { case IEEE80211_HTCAP_MAXRXAMPDU_8K: @@ -4973,6 +4976,7 @@ end: break; } } + /* XXX 11ac density/size is different */ if (get80211val(s, IEEE80211_IOC_AMPDU_DENSITY, &val) != -1) { switch (val) { case IEEE80211_HTCAP_MPDUDENSITY_NA: @@ -5054,6 +5058,8 @@ end: else if (verbose) LINE_CHECK("-rifs"); } + + /* XXX VHT STBC? */ if (get80211val(s, IEEE80211_IOC_STBC, &val) != -1) { switch (val) { case 0: From owner-svn-src-all@freebsd.org Sat Apr 1 01:00:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC3F5D255A1; Sat, 1 Apr 2017 01:00:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADB50A3A; Sat, 1 Apr 2017 01:00:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3110aq0049194; Sat, 1 Apr 2017 01:00:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3110atg049186; Sat, 1 Apr 2017 01:00:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704010100.v3110atg049186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 1 Apr 2017 01:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316341 - in head/sys: conf fs/ext2fs modules/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 01:00:38 -0000 Author: pfg Date: Sat Apr 1 01:00:36 2017 New Revision: 316341 URL: https://svnweb.freebsd.org/changeset/base/316341 Log: ext2fs: Initial support for Extended Attributes. Currently read-only. Submitted by: Fedor Uporov MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D10151 Added: head/sys/fs/ext2fs/ext2_extattr.c (contents, props changed) head/sys/fs/ext2fs/ext2_extattr.h (contents, props changed) Modified: head/sys/conf/files head/sys/fs/ext2fs/ext2_inode_cnv.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/inode.h head/sys/modules/ext2fs/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Mar 31 22:05:10 2017 (r316340) +++ head/sys/conf/files Sat Apr 1 01:00:36 2017 (r316341) @@ -3533,6 +3533,7 @@ geom/zero/g_zero.c optional geom_zero fs/ext2fs/ext2_alloc.c optional ext2fs fs/ext2fs/ext2_balloc.c optional ext2fs fs/ext2fs/ext2_bmap.c optional ext2fs +fs/ext2fs/ext2_extattr.c optional ext2fs fs/ext2fs/ext2_extents.c optional ext2fs fs/ext2fs/ext2_inode.c optional ext2fs fs/ext2fs/ext2_inode_cnv.c optional ext2fs Added: head/sys/fs/ext2fs/ext2_extattr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/ext2fs/ext2_extattr.c Sat Apr 1 01:00:36 2017 (r316341) @@ -0,0 +1,330 @@ +/*- + * Copyright (c) 2017, Fedor Uporov + * 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 REGENTS 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 REGENTS 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$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +static int +ext2_extattr_index_to_bsd(int index) +{ + switch (index) { + case EXT4_XATTR_INDEX_USER: + return EXTATTR_NAMESPACE_USER; + + case EXT4_XATTR_INDEX_SYSTEM: + return EXTATTR_NAMESPACE_SYSTEM; + + default: + return EXTATTR_NAMESPACE_EMPTY; + } +} + +int +ext2_extattr_inode_list(struct inode *ip, int attrnamespace, + struct uio *uio, size_t *size) +{ + struct m_ext2fs *fs; + struct buf *bp; + struct ext2fs_extattr_dinode_header *header; + struct ext2fs_extattr_entry *entry; + struct ext2fs_extattr_entry *next; + char *end; + int error; + + fs = ip->i_e2fs; + + if ((error = bread(ip->i_devvp, + fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { + brelse(bp); + return (error); + } + + struct ext2fs_dinode *dinode = (struct ext2fs_dinode *) + ((char *)bp->b_data + + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)); + + /* Check attributes magic value */ + header = (struct ext2fs_extattr_dinode_header *)((char *)dinode + + E2FS_REV0_INODE_SIZE + dinode->e2di_extra_isize); + + if (header->h_magic != EXTATTR_MAGIC) { + brelse(bp); + return (0); + } + + /* Check attributes integrity */ + entry = EXT2_IFIRST(header); + end = (char *)dinode + EXT2_INODE_SIZE(fs); + while (!EXT2_IS_LAST_ENTRY(entry)) { + next = EXT2_EXTATTR_NEXT(entry); + if ((char *)next >= end) { + brelse(bp); + return (EIO); + } + + entry = next; + } + + for (entry = EXT2_IFIRST(header); !EXT2_IS_LAST_ENTRY(entry); + entry = EXT2_EXTATTR_NEXT(entry)) { + if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + continue; + + if (uio == NULL) + *size += entry->e_name_len + 1; + else { + char *attr_name = malloc(entry->e_name_len + 1, M_TEMP, M_WAITOK); + attr_name[0] = entry->e_name_len; + memcpy(&attr_name[1], entry->e_name, entry->e_name_len); + error = uiomove(attr_name, entry->e_name_len + 1, uio); + free(attr_name, M_TEMP); + } + } + + brelse(bp); + + return (0); +} + +int +ext2_extattr_block_list(struct inode *ip, int attrnamespace, + struct uio *uio, size_t *size) +{ + struct m_ext2fs *fs; + struct buf *bp; + struct ext2fs_extattr_header *header; + struct ext2fs_extattr_entry *entry; + struct ext2fs_extattr_entry *next; + char *end; + int error; + + fs = ip->i_e2fs; + + error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), + fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } + + /* Check attributes magic value */ + header = EXT2_HDR(bp); + if (header->h_magic != EXTATTR_MAGIC || header->h_blocks != 1) { + brelse(bp); + return (EINVAL); + } + + /* Check attributes integrity */ + end = bp->b_data + bp->b_bufsize; + entry = EXT2_FIRST_ENTRY(bp); + while (!EXT2_IS_LAST_ENTRY(entry)) { + next = EXT2_EXTATTR_NEXT(entry); + if ((char *)next >= end) { + brelse(bp); + return (EIO); + } + + entry = next; + } + + for (entry = EXT2_FIRST_ENTRY(bp); !EXT2_IS_LAST_ENTRY(entry); + entry = EXT2_EXTATTR_NEXT(entry)) { + if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + continue; + + if (uio == NULL) + *size += entry->e_name_len + 1; + else { + char *attr_name = malloc(entry->e_name_len + 1, M_TEMP, M_WAITOK); + attr_name[0] = entry->e_name_len; + memcpy(&attr_name[1], entry->e_name, entry->e_name_len); + error = uiomove(attr_name, entry->e_name_len + 1, uio); + free(attr_name, M_TEMP); + } + } + + brelse(bp); + + return (0); +} + +int +ext2_extattr_inode_get(struct inode *ip, int attrnamespace, + const char *name, struct uio *uio, size_t *size) +{ + struct m_ext2fs *fs; + struct buf *bp; + struct ext2fs_extattr_dinode_header *header; + struct ext2fs_extattr_entry *entry; + struct ext2fs_extattr_entry *next; + char *end; + int error; + + fs = ip->i_e2fs; + + if ((error = bread(ip->i_devvp, + fsbtodb(fs, ino_to_fsba(fs, ip->i_number)), + (int)fs->e2fs_bsize, NOCRED, &bp)) != 0) { + brelse(bp); + return (error); + } + + struct ext2fs_dinode *dinode = (struct ext2fs_dinode *) + ((char *)bp->b_data + + EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)); + + /* Check attributes magic value */ + header = (struct ext2fs_extattr_dinode_header *)((char *)dinode + + E2FS_REV0_INODE_SIZE + dinode->e2di_extra_isize); + + if (header->h_magic != EXTATTR_MAGIC) { + brelse(bp); + return (0); + } + + /* Check attributes integrity */ + entry = EXT2_IFIRST(header); + end = (char *)dinode + EXT2_INODE_SIZE(fs); + while (!EXT2_IS_LAST_ENTRY(entry)) { + next = EXT2_EXTATTR_NEXT(entry); + if ((char *)next >= end) { + brelse(bp); + return (EIO); + } + + entry = next; + } + + for (entry = EXT2_IFIRST(header); !EXT2_IS_LAST_ENTRY(entry); + entry = EXT2_EXTATTR_NEXT(entry)) { + if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + continue; + + if (strlen(name) == entry->e_name_len && + 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + if (uio == NULL) + *size += entry->e_value_size; + else { + error = uiomove(((char *)EXT2_IFIRST(header)) + entry->e_value_offs, + entry->e_value_size, uio); + if (error) { + brelse(bp); + return (error); + } + } + } + } + + brelse(bp); + + return (0); +} + +int +ext2_extattr_block_get(struct inode *ip, int attrnamespace, + const char *name, struct uio *uio, size_t *size) +{ + struct m_ext2fs *fs; + struct buf *bp; + struct ext2fs_extattr_header *header; + struct ext2fs_extattr_entry *entry; + struct ext2fs_extattr_entry *next; + char *end; + int error; + + fs = ip->i_e2fs; + + error = bread(ip->i_devvp, fsbtodb(fs, ip->i_facl), + fs->e2fs_bsize, NOCRED, &bp); + if (error) { + brelse(bp); + return (error); + } + + /* Check attributes magic value */ + header = EXT2_HDR(bp); + if (header->h_magic != EXTATTR_MAGIC || header->h_blocks != 1) { + brelse(bp); + return (EINVAL); + } + + /* Check attributes integrity */ + end = bp->b_data + bp->b_bufsize; + entry = EXT2_FIRST_ENTRY(bp); + while (!EXT2_IS_LAST_ENTRY(entry)) { + next = EXT2_EXTATTR_NEXT(entry); + if ((char *)next >= end) { + brelse(bp); + return (EIO); + } + + entry = next; + } + + for (entry = EXT2_FIRST_ENTRY(bp); !EXT2_IS_LAST_ENTRY(entry); + entry = EXT2_EXTATTR_NEXT(entry)) { + if (ext2_extattr_index_to_bsd(entry->e_name_index) != attrnamespace) + continue; + + if (strlen(name) == entry->e_name_len && + 0 == strncmp(entry->e_name, name, entry->e_name_len)) { + if (uio == NULL) + *size += entry->e_value_size; + else { + error = uiomove(bp->b_data + entry->e_value_offs, + entry->e_value_size, uio); + if (error) { + brelse(bp); + return (error); + } + } + } + } + + brelse(bp); + + return (0); +} Added: head/sys/fs/ext2fs/ext2_extattr.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/fs/ext2fs/ext2_extattr.h Sat Apr 1 01:00:36 2017 (r316341) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2017, Fedor Uporov + * 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 REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _FS_EXT2FS_EXT2_EXTARTTR_H_ +#define _FS_EXT2FS_EXT2_EXTARTTR_H_ + +/* Linux xattr name indexes */ +#define EXT4_XATTR_INDEX_USER 1 +#define EXT4_XATTR_INDEX_POSIX_ACL_ACCESS 2 +#define EXT4_XATTR_INDEX_POSIX_ACL_DEFAULT 3 +#define EXT4_XATTR_INDEX_TRUSTED 4 +#define EXT4_XATTR_INDEX_LUSTRE 5 +#define EXT4_XATTR_INDEX_SECURITY 6 +#define EXT4_XATTR_INDEX_SYSTEM 7 +#define EXT4_XATTR_INDEX_RICHACL 8 +#define EXT4_XATTR_INDEX_ENCRYPTION 9 + +/* Magic value in attribute blocks */ +#define EXTATTR_MAGIC 0xEA020000 + +struct ext2fs_extattr_header { + int32_t h_magic; /* magic number for identification */ + int32_t h_refcount; /* reference count */ + int32_t h_blocks; /* number of disk blocks used */ + int32_t h_hash; /* hash value of all attributes */ + uint32_t h_reserved[4]; /* zero right now */ +}; + +struct ext2fs_extattr_dinode_header { + int32_t h_magic; /* magic number for identification */ +}; + +struct ext2fs_extattr_entry { + uint8_t e_name_len; /* length of name */ + uint8_t e_name_index; /* attribute name index */ + uint16_t e_value_offs; /* offset in disk block of value */ + uint32_t e_value_block; /* disk block attribute is stored on (n/i) */ + uint32_t e_value_size; /* size of attribute value */ + uint32_t e_hash; /* hash value of name and value */ + char e_name[0]; /* attribute name */ +}; + +#define EXT2_IHDR(inode, raw_inode) \ + ((struct ext4_xattr_ibody_header *) \ + ((void *)raw_inode + \ + EXT4_GOOD_OLD_INODE_SIZE + \ + EXT4_I(inode)->i_extra_isize)) + +#define EXT2_IFIRST(hdr) ((struct ext2fs_extattr_entry *)((hdr)+1)) + +#define EXT2_HDR(bh) ((struct ext2fs_extattr_header *)((bh)->b_data)) +#define EXT2_ENTRY(ptr) ((struct ext2fs_extattr_entry *)(ptr)) +#define EXT2_FIRST_ENTRY(bh) EXT2_ENTRY(EXT2_HDR(bh)+1) +#define EXT2_IS_LAST_ENTRY(entry) (*(uint32_t *)(entry) == 0) + +#define EXT2_EXTATTR_PAD_BITS 2 +#define EXT2_EXTATTR_PAD (1<e_name_len)) ) + +int ext2_extattr_inode_list(struct inode *ip, int attrnamespace, + struct uio *uio, size_t *size); + +int ext2_extattr_block_list(struct inode *ip, int attrnamespace, + struct uio *uio, size_t *size); + +int ext2_extattr_inode_get(struct inode *ip, int attrnamespace, + const char *name, struct uio *uio, size_t *size); + +int ext2_extattr_block_get(struct inode *ip, int attrnamespace, + const char *name, struct uio *uio, size_t *size); + +#endif /* !_FS_EXT2FS_EXT2_EXTARTTR_H_ */ Modified: head/sys/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode_cnv.c Fri Mar 31 22:05:10 2017 (r316340) +++ head/sys/fs/ext2fs/ext2_inode_cnv.c Sat Apr 1 01:00:36 2017 (r316341) @@ -114,8 +114,10 @@ ext2_ei2i(struct ext2fs_dinode *ei, stru ip->i_flag |= (ei->e2di_flags & EXT3_INDEX) ? IN_E3INDEX : 0; ip->i_flag |= (ei->e2di_flags & EXT4_EXTENTS) ? IN_E4EXTENTS : 0; ip->i_blocks = ei->e2di_nblock; + ip->i_facl = ei->e2di_facl; if (E2DI_HAS_HUGE_FILE(ip)) { ip->i_blocks |= (uint64_t)ei->e2di_nblock_high << 32; + ip->i_facl |= (uint64_t)ei->e2di_facl_high << 32; if (ei->e2di_flags & EXT4_HUGE_FILE) ip->i_blocks = fsbtodb(ip->i_e2fs, ip->i_blocks); } Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Mar 31 22:05:10 2017 (r316340) +++ head/sys/fs/ext2fs/ext2_vnops.c Sat Apr 1 01:00:36 2017 (r316341) @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -84,6 +85,7 @@ #include #include #include +#include static int ext2_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *); static void ext2_itimes_locked(struct vnode *); @@ -114,6 +116,8 @@ static vop_setattr_t ext2_setattr; static vop_strategy_t ext2_strategy; static vop_symlink_t ext2_symlink; static vop_write_t ext2_write; +static vop_getextattr_t ext2_getextattr; +static vop_listextattr_t ext2_listextattr; static vop_vptofh_t ext2_vptofh; static vop_close_t ext2fifo_close; static vop_kqfilter_t ext2fifo_kqfilter; @@ -152,6 +156,8 @@ struct vop_vector ext2_vnodeops = { .vop_strategy = ext2_strategy, .vop_symlink = ext2_symlink, .vop_write = ext2_write, + .vop_getextattr = ext2_getextattr, + .vop_listextattr = ext2_listextattr, .vop_vptofh = ext2_vptofh, }; @@ -1479,6 +1485,88 @@ ext2_pathconf(struct vop_pathconf_args * } /* + * Vnode operation to retrieve a named extended attribute. + */ +static int +ext2_getextattr(struct vop_getextattr_args *ap) +{ + struct inode *ip; + struct m_ext2fs *fs; + int error; + + ip = VTOI(ap->a_vp); + fs = ip->i_e2fs; + + if (!EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_EXT_ATTR)) + return (EOPNOTSUPP); + + if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + return (EOPNOTSUPP); + + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VREAD); + if (error) + return (error); + + if (ap->a_size != NULL) + *ap->a_size = 0; + + if (EXT2_INODE_SIZE(fs) != E2FS_REV0_INODE_SIZE) { + error = ext2_extattr_inode_get(ip, ap->a_attrnamespace, + ap->a_name, ap->a_uio, ap->a_size); + if (error) + return (error); + } + + if (ip->i_facl) + error = ext2_extattr_block_get(ip, ap->a_attrnamespace, + ap->a_name, ap->a_uio, ap->a_size); + + return (error); +} + +/* + * Vnode operation to retrieve extended attributes on a vnode. + */ +static int +ext2_listextattr(struct vop_listextattr_args *ap) +{ + struct inode *ip; + struct m_ext2fs *fs; + int error; + + ip = VTOI(ap->a_vp); + fs = ip->i_e2fs; + + if (!EXT2_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_EXT_ATTR)) + return (EOPNOTSUPP); + + if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + return (EOPNOTSUPP); + + error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + ap->a_cred, ap->a_td, VREAD); + if (error) + return (error); + + if (ap->a_size != NULL) + *ap->a_size = 0; + + if (EXT2_INODE_SIZE(fs) != E2FS_REV0_INODE_SIZE) { + error = ext2_extattr_inode_list(ip, ap->a_attrnamespace, + ap->a_uio, ap->a_size); + if(error) + return (error); + } + + if(ip->i_facl) + error = ext2_extattr_block_list(ip, ap->a_attrnamespace, + ap->a_uio, ap->a_size); + + return (error); +} + +/* * Vnode pointer to File handle */ /* ARGSUSED */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Fri Mar 31 22:05:10 2017 (r316340) +++ head/sys/fs/ext2fs/ext2fs.h Sat Apr 1 01:00:36 2017 (r316341) @@ -204,6 +204,7 @@ struct csum { */ #define EXT2F_COMPAT_PREALLOC 0x0001 #define EXT2F_COMPAT_HASJOURNAL 0x0004 +#define EXT2F_COMPAT_EXT_ATTR 0x0008 #define EXT2F_COMPAT_RESIZE 0x0010 #define EXT2F_COMPAT_DIRHASHINDEX 0x0020 #define EXT2F_COMPAT_SPARSESUPER2 0x0200 Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Fri Mar 31 22:05:10 2017 (r316340) +++ head/sys/fs/ext2fs/inode.h Sat Apr 1 01:00:36 2017 (r316341) @@ -105,6 +105,7 @@ struct inode { int32_t i_ctimensec; /* Last inode change time. */ int32_t i_birthnsec; /* Inode creation time. */ uint32_t i_gen; /* Generation number. */ + uint64_t i_facl; /* EA block number. */ uint32_t i_flags; /* Status flags (chflags). */ uint32_t i_db[EXT2_NDADDR]; /* Direct disk blocks. */ uint32_t i_ib[EXT2_NIADDR]; /* Indirect disk blocks. */ Modified: head/sys/modules/ext2fs/Makefile ============================================================================== --- head/sys/modules/ext2fs/Makefile Fri Mar 31 22:05:10 2017 (r316340) +++ head/sys/modules/ext2fs/Makefile Sat Apr 1 01:00:36 2017 (r316341) @@ -3,8 +3,8 @@ .PATH: ${SRCTOP}/sys/fs/ext2fs KMOD= ext2fs SRCS= opt_ddb.h opt_directio.h opt_quota.h opt_suiddir.h vnode_if.h \ - ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_extents.c ext2_hash.c \ - ext2_htree.c ext2_inode.c ext2_inode_cnv.c ext2_lookup.c ext2_subr.c \ - ext2_vfsops.c ext2_vnops.c + ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_extattr.c ext2_extents.c \ + ext2_hash.c ext2_htree.c ext2_inode.c ext2_inode_cnv.c ext2_lookup.c \ + ext2_subr.c ext2_vfsops.c ext2_vnops.c .include From owner-svn-src-all@freebsd.org Sat Apr 1 04:42:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED86D288CF; Sat, 1 Apr 2017 04:42:36 +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 702E1A11; Sat, 1 Apr 2017 04:42:36 +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 v314gZ47045003; Sat, 1 Apr 2017 04:42:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v314gZB5044999; Sat, 1 Apr 2017 04:42:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704010442.v314gZB5044999@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 04:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316342 - in head: etc/defaults etc/periodic/daily share/man/man5 usr.sbin/periodic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 04:42:36 -0000 Author: asomers Date: Sat Apr 1 04:42:35 2017 New Revision: 316342 URL: https://svnweb.freebsd.org/changeset/base/316342 Log: Consolidate random sleeps in periodic scripts Multiple periodic scripts sleep for a random amount of time in order to mitigate the thundering herd problem. This is bad, because the sum of multiple uniformly distributed random variables approaches a normal distribution, so the problem isn't mitigated as effectively as it would be with a single sleep. This change creates a single configurable anticongestion sleep. periodic will only sleep if at least one script requires it, and it will never sleep more than once per invocation. It also won't sleep if periodic was run interactively, fixing an unrelated longstanding bug. PR: 217055 PR: 210188 Reviewed by: cy MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D10211 Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/480.leapfile-ntpd head/share/man/man5/periodic.conf.5 head/usr.sbin/periodic/periodic.sh Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Sat Apr 1 01:00:36 2017 (r316341) +++ head/etc/defaults/periodic.conf Sat Apr 1 04:42:35 2017 (r316342) @@ -22,6 +22,8 @@ periodic_conf_files="/etc/periodic.conf # periodic script dirs local_periodic="/usr/local/etc/periodic" +# Max time to sleep to avoid causing congestion on download servers +anticongestion_sleeptime=3600 # Daily options @@ -136,8 +138,6 @@ daily_status_mail_rejects_shorten="NO" # 480.leapfile-ntpd daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile -daily_ntpd_avoid_congestion="YES" # Avoid congesting - # leapfile sources # 480.status-ntpd daily_status_ntpd_enable="NO" # Check NTP status @@ -307,6 +307,18 @@ security_status_tcpwrap_period="daily" if [ -z "${source_periodic_confs_defined}" ]; then source_periodic_confs_defined=yes + # Sleep for a random amount of time in order to mitigate the thundering + # herd problem of multiple hosts running periodic simultaneously. + # Will not sleep when used interactively. + # Will sleep at most once per invocation of periodic + anticongestion() { + [ -n "$PERIODIC_IS_INTERACTIVE" ] && return + if [ -f "$PERIODIC_ANTICONGESTION_FILE" ]; then + rm -f $PERIODIC_ANTICONGESTION_FILE + sleep `jot -r 1 0 ${anticongestion_sleeptime}` + fi + } + # Compatibility with old daily variable names. # They can be removed in stable/11. security_daily_compat_var() { Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Sat Apr 1 01:00:36 2017 (r316341) +++ head/etc/periodic/daily/480.leapfile-ntpd Sat Apr 1 04:42:35 2017 (r316342) @@ -13,16 +13,9 @@ fi case "$daily_ntpd_leapfile_enable" in [Yy][Ee][Ss]) - case "$daily_ntpd_avoid_congestion" in - [Yy][Ee][Ss]) - # Avoid dogpiling - (sleep $(jot -r 1 0 3600); service ntpd onefetch) & - ;; - *) - service ntpd onefetch - ;; - esac - ;; + anticongestion + service ntpd onefetch + ;; esac exit $rc Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Sat Apr 1 01:00:36 2017 (r316341) +++ head/share/man/man5/periodic.conf.5 Sat Apr 1 04:42:35 2017 (r316342) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 26, 2015 +.Dd March 31, 2015 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -133,6 +133,10 @@ respectively. Refer to the .Xr periodic 8 manual page for how script return codes are interpreted. +.It Va anticongestion_sleeptime +.Pq Vt int +The maximum number of seconds to randomly sleep in order to smooth bursty loads +on a shared resource, such as a download mirror. .El .Pp The following variables are used by the standard scripts that reside in Modified: head/usr.sbin/periodic/periodic.sh ============================================================================== --- head/usr.sbin/periodic/periodic.sh Sat Apr 1 01:00:36 2017 (r316341) +++ head/usr.sbin/periodic/periodic.sh Sat Apr 1 04:42:35 2017 (r316342) @@ -76,6 +76,12 @@ fi shift arg=$1 +if [ -z "$PERIODIC_ANTICONGESTION_FILE" ] ; then + export PERIODIC_ANTICONGESTION_FILE=`mktemp ${TMPDIR:-/tmp}/periodic.anticongestion.XXXXXXXXXX` +fi +if tty > /dev/null 2>&1; then + export PERIODIC_IS_INTERACTIVE=1 +fi tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX` context="$PERIODIC" export PERIODIC="$arg${PERIODIC:+ }${PERIODIC}" @@ -141,3 +147,4 @@ esac } | output_pipe $arg "$context" rm -f $tmp_output +rm -f $PERIODIC_ANTICONGESTION_FILE From owner-svn-src-all@freebsd.org Sat Apr 1 05:05:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12DAFD28205; Sat, 1 Apr 2017 05:05:25 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF9C86A0; Sat, 1 Apr 2017 05:05:24 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3155Ouu053379; Sat, 1 Apr 2017 05:05:24 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3155MCZ053360; Sat, 1 Apr 2017 05:05:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201704010505.v3155MCZ053360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sat, 1 Apr 2017 05:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316343 - in head/sys: boot/geli boot/i386/common boot/i386/gptboot boot/i386/libi386 boot/i386/loader boot/i386/zfsboot boot/zfs crypto geom/eli opencrypto sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 05:05:25 -0000 Author: allanjude Date: Sat Apr 1 05:05:22 2017 New Revision: 316343 URL: https://svnweb.freebsd.org/changeset/base/316343 Log: Implement boot-time encryption key passing (keybuf) This patch adds a general mechanism for providing encryption keys to the kernel from the boot loader. This is intended to enable GELI support at boot time, providing a better mechanism for passing keys to the kernel than environment variables. It is designed to be extensible to other applications, and can easily handle multiple encrypted volumes with different keys. This mechanism is currently used by the pending GELI EFI work. Additionally, this mechanism can potentially be used to interface with GRUB, opening up options for coreboot+GRUB configurations with completely encrypted disks. Another benefit over the existing system is that it does not require re-deriving the user key from the password at each boot stage. Most of this patch was written by Eric McCorkle. It was extended by Allan Jude with a number of minor enhancements and extending the keybuf feature into boot2. GELI user keys are now derived once, in boot2, then passed to the loader, which reuses the key, then passes it to the kernel, where the GELI module destroys the keybuf after decrypting the volumes. Submitted by: Eric McCorkle (Original Version) Reviewed by: oshogbo (earlier version), cem (earlier version) MFC after: 3 weeks Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D9575 Added: head/sys/boot/geli/geliboot_internal.h (contents, props changed) head/sys/crypto/intake.h (contents, props changed) Modified: head/sys/boot/geli/Makefile head/sys/boot/geli/geliboot.c head/sys/boot/geli/geliboot.h head/sys/boot/geli/geliboot_crypto.c head/sys/boot/i386/common/bootargs.h head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/libi386/bootinfo32.c head/sys/boot/i386/libi386/bootinfo64.c head/sys/boot/i386/loader/Makefile head/sys/boot/i386/loader/main.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/zfs/libzfs.h head/sys/geom/eli/g_eli.c head/sys/geom/eli/g_eli.h head/sys/opencrypto/crypto.c head/sys/sys/linker.h Modified: head/sys/boot/geli/Makefile ============================================================================== --- head/sys/boot/geli/Makefile Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/geli/Makefile Sat Apr 1 05:05:22 2017 (r316343) @@ -39,6 +39,7 @@ SRCS+= md5c.c # AES implementation from sys/crypto .PATH: ${.CURDIR}/../../crypto/rijndael CFLAGS+= -I${.CURDIR}/../../ +CFLAGS+= -I${.CURDIR}/../common/ # Remove asserts CFLAGS+= -DNDEBUG SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c Modified: head/sys/boot/geli/geliboot.c ============================================================================== --- head/sys/boot/geli/geliboot.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/geli/geliboot.c Sat Apr 1 05:05:22 2017 (r316343) @@ -27,17 +27,75 @@ * $FreeBSD$ */ +#include "geliboot_internal.h" #include "geliboot.h" SLIST_HEAD(geli_list, geli_entry) geli_head = SLIST_HEAD_INITIALIZER(geli_head); struct geli_list *geli_headp; +typedef u_char geli_ukey[G_ELI_USERKEYLEN]; + +static geli_ukey saved_keys[GELI_MAX_KEYS]; +static unsigned int nsaved_keys = 0; + +/* + * Copy keys from local storage to the keybuf struct. + * Destroy the local storage when finished. + */ +void +geli_fill_keybuf(struct keybuf *fkeybuf) +{ + unsigned int i; + + for (i = 0; i < nsaved_keys; i++) { + fkeybuf->kb_ents[i].ke_type = KEYBUF_TYPE_GELI; + memcpy(fkeybuf->kb_ents[i].ke_data, saved_keys[i], + G_ELI_USERKEYLEN); + } + fkeybuf->kb_nents = nsaved_keys; + explicit_bzero(saved_keys, sizeof(saved_keys)); +} + +/* + * Copy keys from a keybuf struct into local storage. + * Zero out the keybuf. + */ +void +geli_save_keybuf(struct keybuf *skeybuf) +{ + unsigned int i; + + for (i = 0; i < skeybuf->kb_nents && i < GELI_MAX_KEYS; i++) { + memcpy(saved_keys[i], skeybuf->kb_ents[i].ke_data, + G_ELI_USERKEYLEN); + explicit_bzero(skeybuf->kb_ents[i].ke_data, + G_ELI_USERKEYLEN); + skeybuf->kb_ents[i].ke_type = KEYBUF_TYPE_NONE; + } + nsaved_keys = skeybuf->kb_nents; + skeybuf->kb_nents = 0; +} + +static void +save_key(geli_ukey key) +{ + + /* + * If we run out of key space, the worst that will happen is + * it will ask the user for the password again. + */ + if (nsaved_keys < GELI_MAX_KEYS) { + memcpy(saved_keys[nsaved_keys], key, G_ELI_USERKEYLEN); + nsaved_keys++; + } +} + static int geli_same_device(struct geli_entry *ge, struct dsk *dskp) { - if (geli_e->dsk->drive == dskp->drive && - dskp->part == 255 && geli_e->dsk->part == dskp->slice) { + if (ge->dsk->drive == dskp->drive && + dskp->part == 255 && ge->dsk->part == dskp->slice) { /* * Sometimes slice = slice, and sometimes part = slice * If the incoming struct dsk has part=255, it means look at @@ -47,15 +105,39 @@ geli_same_device(struct geli_entry *ge, } /* Is this the same device? */ - if (geli_e->dsk->drive != dskp->drive || - geli_e->dsk->slice != dskp->slice || - geli_e->dsk->part != dskp->part) { + if (ge->dsk->drive != dskp->drive || + ge->dsk->slice != dskp->slice || + ge->dsk->part != dskp->part) { return (1); } return (0); } +static int +geli_findkey(struct geli_entry *ge, struct dsk *dskp, u_char *mkey) +{ + u_int keynum; + int i; + + if (ge->keybuf_slot >= 0) { + if (g_eli_mkey_decrypt(&ge->md, saved_keys[ge->keybuf_slot], + mkey, &keynum) == 0) { + return (0); + } + } + + for (i = 0; i < nsaved_keys; i++) { + if (g_eli_mkey_decrypt(&ge->md, saved_keys[i], mkey, + &keynum) == 0) { + ge->keybuf_slot = i; + return (0); + } + } + + return (1); +} + void geli_init(void) { @@ -123,6 +205,7 @@ geli_taste(int read_func(void *vdev, voi if (dskp->part == 255) { geli_e->dsk->part = dskp->slice; } + geli_e->keybuf_slot = -1; geli_e->md = md; eli_metadata_softc(&geli_e->sc, &md, DEV_BSIZE, @@ -138,18 +221,27 @@ geli_taste(int read_func(void *vdev, voi * Attempt to decrypt the device */ int -geli_attach(struct dsk *dskp, const char *passphrase) +geli_attach(struct dsk *dskp, const char *passphrase, const u_char *mkeyp) { u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN], *mkp; u_int keynum; struct hmac_ctx ctx; int error; + if (mkeyp != NULL) { + memcpy(&mkey, mkeyp, G_ELI_DATAIVKEYLEN); + explicit_bzero(mkeyp, G_ELI_DATAIVKEYLEN); + } + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { if (geli_same_device(geli_e, dskp) != 0) { continue; } + if (mkeyp != NULL || geli_findkey(geli_e, dskp, mkey) == 0) { + goto found_key; + } + g_eli_crypto_hmac_init(&ctx, NULL, 0); /* * Prepare Derived-Key from the user passphrase. @@ -179,17 +271,23 @@ geli_attach(struct dsk *dskp, const char g_eli_crypto_hmac_final(&ctx, key, 0); error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); - explicit_bzero(key, sizeof(key)); if (error == -1) { explicit_bzero(mkey, sizeof(mkey)); - printf("Bad GELI key: %d\n", error); + explicit_bzero(key, sizeof(key)); + printf("Bad GELI key: bad password?\n"); return (error); } else if (error != 0) { explicit_bzero(mkey, sizeof(mkey)); - printf("Failed to decrypt GELI master key: %d\n", error); + explicit_bzero(key, sizeof(key)); + printf("Failed to decrypt GELI master key: %d\n", error); return (error); - } + } else { + /* Add key to keychain */ + save_key(key); + explicit_bzero(&key, sizeof(key)); + } +found_key: /* Store the keys */ bcopy(mkey, geli_e->sc.sc_mkey, sizeof(geli_e->sc.sc_mkey)); bcopy(mkey, geli_e->sc.sc_ivkey, sizeof(geli_e->sc.sc_ivkey)); @@ -231,7 +329,7 @@ is_geli(struct dsk *dskp) return (0); } } - + return (1); } @@ -294,6 +392,27 @@ geli_read(struct dsk *dskp, off_t offset } int +geli_havekey(struct dsk *dskp) +{ + u_char mkey[G_ELI_DATAIVKEYLEN]; + + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + if (geli_findkey(geli_e, dskp, mkey) == 0) { + if (geli_attach(dskp, NULL, mkey) == 0) { + return (0); + } + } + } + explicit_bzero(mkey, sizeof(mkey)); + + return (1); +} + +int geli_passphrase(char *pw, int disk, int parttype, int part, struct dsk *dskp) { int i; @@ -302,14 +421,14 @@ geli_passphrase(char *pw, int disk, int for (i = 0; i < 3; i++) { /* Try cached passphrase */ if (i == 0 && pw[0] != '\0') { - if (geli_attach(dskp, pw) == 0) { + if (geli_attach(dskp, pw, NULL) == 0) { return (0); } } printf("GELI Passphrase for disk%d%c%d: ", disk, parttype, part); pwgets(pw, GELI_PW_MAXLEN); printf("\n"); - if (geli_attach(dskp, pw) == 0) { + if (geli_attach(dskp, pw, NULL) == 0) { return (0); } } Modified: head/sys/boot/geli/geliboot.h ============================================================================== --- head/sys/boot/geli/geliboot.h Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/geli/geliboot.h Sat Apr 1 05:05:22 2017 (r316343) @@ -27,32 +27,11 @@ * $FreeBSD$ */ -#include -#include +#include #ifndef _GELIBOOT_H_ #define _GELIBOOT_H_ -#define _STRING_H_ -#define _STRINGS_H_ -#define _STDIO_H_ - -#include -#include - -/* Pull in the md5, sha256, and sha512 implementations */ -#include -#include -#include - -/* Pull in AES implementation */ -#include - -/* AES-XTS implementation */ -#define _STAND -#define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ -#include - #ifndef DEV_BSIZE #define DEV_BSIZE 512 #endif @@ -64,30 +43,26 @@ #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif +#define GELI_MAX_KEYS 64 #define GELI_PW_MAXLEN 256 -extern void pwgets(char *buf, int n); - -struct geli_entry { - struct dsk *dsk; - off_t part_end; - struct g_eli_softc sc; - struct g_eli_metadata md; - SLIST_ENTRY(geli_entry) entries; -} *geli_e, *geli_e_tmp; -int geli_count; +extern void pwgets(char *buf, int n); void geli_init(void); int geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, size_t bytes), struct dsk *dsk, daddr_t lastsector); -int geli_attach(struct dsk *dskp, const char *passphrase); +int geli_attach(struct dsk *dskp, const char *passphrase, const u_char *mkeyp); int is_geli(struct dsk *dsk); int geli_read(struct dsk *dsk, off_t offset, u_char *buf, size_t bytes); int geli_decrypt(u_int algo, u_char *data, size_t datasize, const u_char *key, size_t keysize, const uint8_t* iv); +int geli_havekey(struct dsk *dskp); int geli_passphrase(char *pw, int disk, int parttype, int part, struct dsk *dskp); int geliboot_crypt(u_int algo, int enc, u_char *data, size_t datasize, const u_char *key, size_t keysize, u_char *iv); +void geli_fill_keybuf(struct keybuf *keybuf); +void geli_save_keybuf(struct keybuf *keybuf); + #endif /* _GELIBOOT_H_ */ Modified: head/sys/boot/geli/geliboot_crypto.c ============================================================================== --- head/sys/boot/geli/geliboot_crypto.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/geli/geliboot_crypto.c Sat Apr 1 05:05:22 2017 (r316343) @@ -31,6 +31,7 @@ #include #include +#include "geliboot_internal.h" #include "geliboot.h" int Added: head/sys/boot/geli/geliboot_internal.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/geliboot_internal.h Sat Apr 1 05:05:22 2017 (r316343) @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2015 Allan Jude + * Copyright (c) 2005-2011 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _GELIBOOT_INTERNAL_H_ +#define _GELIBOOT_INTERNAL_H_ + +#define _STRING_H_ +#define _STRINGS_H_ +#define _STDIO_H_ + +#include +#include + +#include +#include + +#include + +/* Pull in the md5, sha256, and sha512 implementations */ +#include +#include +#include + +/* Pull in AES implementation */ +#include + +/* AES-XTS implementation */ +#define _STAND +#define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ +#include + +struct geli_entry { + struct dsk *dsk; + off_t part_end; + struct g_eli_softc sc; + struct g_eli_metadata md; + int keybuf_slot; + SLIST_ENTRY(geli_entry) entries; +} *geli_e, *geli_e_tmp; + +static int geli_count; + +#endif /* _GELIBOOT_INTERNAL_H_ */ Modified: head/sys/boot/i386/common/bootargs.h ============================================================================== --- head/sys/boot/i386/common/bootargs.h Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/common/bootargs.h Sat Apr 1 05:05:22 2017 (r316343) @@ -64,10 +64,28 @@ struct bootargs */ }; +#ifdef LOADER_GELI_SUPPORT +#include +#endif + struct geli_boot_args { uint32_t size; - char gelipw[256]; + union { + char gelipw[256]; + struct { + char notapw; /* + * single null byte to stop keybuf + * being interpreted as a password + */ + uint32_t keybuf_sentinel; +#ifdef LOADER_GELI_SUPPORT + struct keybuf *keybuf; +#else + void *keybuf; +#endif + }; + }; }; #endif /*__ASSEMBLER__*/ Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/gptboot/Makefile Sat Apr 1 05:05:22 2017 (r316343) @@ -42,6 +42,7 @@ CFLAGS.gcc+= --param max-inline-insns-si .if !defined(LOADER_NO_GELI_SUPPORT) CFLAGS+= -DLOADER_GELI_SUPPORT CFLAGS+= -I${.CURDIR}/../../geli +CFLAGS+= -I${.CURDIR}/../../.. LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a .PATH: ${.CURDIR}/../../../opencrypto OPENCRYPTO_XTS= xform_aes_xts.o Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/gptboot/gptboot.c Sat Apr 1 05:05:22 2017 (r316343) @@ -103,7 +103,7 @@ static char *heap_end; void exit(int); static void load(void); -static int parse(char *, int *); +static int parse_cmds(char *, int *); static int dskread(void *, daddr_t, unsigned); void *malloc(size_t n); void free(void *ptr); @@ -139,6 +139,7 @@ free(void *ptr) #ifdef LOADER_GELI_SUPPORT #include "geliboot.c" static char gelipw[GELI_PW_MAXLEN]; +static struct keybuf *gelibuf; #endif static inline int @@ -253,7 +254,8 @@ gptinit(void) #ifdef LOADER_GELI_SUPPORT if (geli_taste(vdev_read, &dsk, (gpttable[curent].ent_lba_end - gpttable[curent].ent_lba_start)) == 0) { - if (geli_passphrase(&gelipw, dsk.unit, 'p', curent + 1, &dsk) != 0) { + if (geli_havekey(&dsk) != 0 && geli_passphrase(&gelipw, + dsk.unit, 'p', curent + 1, &dsk) != 0) { printf("%s: unable to decrypt GELI key\n", BOOTPROG); return (-1); } @@ -318,7 +320,7 @@ main(void) } if (*cmd != '\0') { memcpy(cmdtmp, cmd, sizeof(cmdtmp)); - if (parse(cmdtmp, &dskupdated)) + if (parse_cmds(cmdtmp, &dskupdated)) break; if (dskupdated && gptinit() != 0) break; @@ -368,7 +370,7 @@ main(void) getstr(cmd, sizeof(cmd)); else if (!OPT_CHECK(RBX_QUIET)) putchar('\n'); - if (parse(cmd, &dskupdated)) { + if (parse_cmds(cmd, &dskupdated)) { putchar('\a'); continue; } @@ -480,8 +482,12 @@ load(void) bootinfo.bi_bios_dev = dsk.drive; #ifdef LOADER_GELI_SUPPORT geliargs.size = sizeof(geliargs); - bcopy(gelipw, geliargs.gelipw, sizeof(geliargs.gelipw)); explicit_bzero(gelipw, sizeof(gelipw)); + gelibuf = malloc(sizeof(struct keybuf) + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); + geli_fill_keybuf(gelibuf); + geliargs.notapw = '\0'; + geliargs.keybuf_sentinel = KEYBUF_SENTINEL; + geliargs.keybuf = gelibuf; #endif __exec((caddr_t)addr, RB_BOOTINFO | (opts & RBX_MASK), MAKEBOOTDEV(dev_maj[dsk.type], dsk.part + 1, dsk.unit, 0xff), @@ -493,7 +499,7 @@ load(void) } static int -parse(char *cmdstr, int *dskupdated) +parse_cmds(char *cmdstr, int *dskupdated) { char *arg = cmdstr; char *ep, *p, *q; Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/libi386/biosdisk.c Sat Apr 1 05:05:22 2017 (r316343) @@ -472,6 +472,11 @@ bd_open(struct open_file *f, ...) } if (geli_taste(bios_read, &dskp, entry->part.end - entry->part.start) == 0) { + if (geli_havekey(&dskp) == 0) { + geli_status[dev->d_unit][dskp.slice] = ISGELI_YES; + geli_part++; + continue; + } if ((passphrase = getenv("kern.geom.eli.passphrase")) != NULL) { /* Use the cached passphrase */ @@ -484,6 +489,7 @@ bd_open(struct open_file *f, ...) bzero(gelipw, sizeof(gelipw)); geli_status[dev->d_unit][dskp.slice] = ISGELI_YES; geli_part++; + continue; } } else geli_status[dev->d_unit][dskp.slice] = ISGELI_NO; Modified: head/sys/boot/i386/libi386/bootinfo32.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo32.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/libi386/bootinfo32.c Sat Apr 1 05:05:22 2017 (r316343) @@ -32,10 +32,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "libi386.h" #include "btxv86.h" +#ifdef LOADER_GELI_SUPPORT +#include "geliboot.h" + +static const size_t keybuf_size = sizeof(struct keybuf) + + (GELI_MAX_KEYS * sizeof(struct keybuf_ent)); +#endif + static struct bootinfo bi; /* @@ -146,11 +154,15 @@ bi_load32(char *args, int *howtop, int * int bootdevnr, i, howto; char *kernelname; const char *kernelpath; +#ifdef LOADER_GELI_SUPPORT + char buf[keybuf_size]; + struct keybuf *keybuf = (struct keybuf *)buf; +#endif howto = bi_getboothowto(args); - /* - * Allow the environment variable 'rootdev' to override the supplied device + /* + * Allow the environment variable 'rootdev' to override the supplied device * This should perhaps go to MI code and/or have $rootdev tested/set by * MI code before launching the kernel. */ @@ -185,7 +197,7 @@ bi_load32(char *args, int *howtop, int * case DEVT_NET: case DEVT_ZFS: break; - + default: printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_type); } @@ -221,6 +233,11 @@ bi_load32(char *args, int *howtop, int * file_addmetadata(kfp, MODINFOMD_ENVP, sizeof envp, &envp); file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof kernend, &kernend); bios_addsmapdata(kfp); +#ifdef LOADER_GELI_SUPPORT + geli_fill_keybuf(keybuf); + file_addmetadata(kfp, MODINFOMD_KEYBUF, keybuf_size, buf); + bzero(buf, sizeof(buf)); +#endif /* Figure out the size and location of the metadata */ *modulep = addr; Modified: head/sys/boot/i386/libi386/bootinfo64.c ============================================================================== --- head/sys/boot/i386/libi386/bootinfo64.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/libi386/bootinfo64.c Sat Apr 1 05:05:22 2017 (r316343) @@ -40,6 +40,13 @@ __FBSDID("$FreeBSD$"); #include "libi386.h" #include "btxv86.h" +#ifdef LOADER_GELI_SUPPORT +#include "geliboot.h" + +static const size_t keybuf_size = sizeof(struct keybuf) + + (GELI_MAX_KEYS * sizeof(struct keybuf_ent)); +#endif + /* * Copy module-related data into the load area, where it can be * used as a directory for loaded modules. @@ -189,6 +196,10 @@ bi_load64(char *args, vm_offset_t addr, vm_offset_t size; char *rootdevname; int howto; +#ifdef LOADER_GELI_SUPPORT + char buf[keybuf_size]; + struct keybuf *keybuf = (struct keybuf *)buf; +#endif if (!bi_checkcpu()) { printf("CPU doesn't support long mode\n"); @@ -197,8 +208,8 @@ bi_load64(char *args, vm_offset_t addr, howto = bi_getboothowto(args); - /* - * Allow the environment variable 'rootdev' to override the supplied device + /* + * Allow the environment variable 'rootdev' to override the supplied device * This should perhaps go to MI code and/or have $rootdev tested/set by * MI code before launching the kernel. */ @@ -238,6 +249,12 @@ bi_load64(char *args, vm_offset_t addr, if (add_smap != 0) bios_addsmapdata(kfp); +#ifdef LOADER_GELI_SUPPORT + geli_fill_keybuf(keybuf); + file_addmetadata(kfp, MODINFOMD_KEYBUF, keybuf_size, buf); + bzero(buf, sizeof(buf)); +#endif + size = bi_copymodules64(0); /* copy our environment */ Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/loader/Makefile Sat Apr 1 05:05:22 2017 (r316343) @@ -61,6 +61,7 @@ CFLAGS+= -DLOADER_NANDFS_SUPPORT .endif .if !defined(LOADER_NO_GELI_SUPPORT) CFLAGS+= -DLOADER_GELI_SUPPORT +CFLAGS+= -I${.CURDIR}/../../geli LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a .PATH: ${.CURDIR}/../../../opencrypto SRCS+= xform_aes_xts.c Modified: head/sys/boot/i386/loader/main.c ============================================================================== --- head/sys/boot/i386/loader/main.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/loader/main.c Sat Apr 1 05:05:22 2017 (r316343) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "bootstrap.h" #include "common/bootargs.h" @@ -69,6 +70,7 @@ static int isa_inb(int port); static void isa_outb(int port, int value); void exit(int code); #ifdef LOADER_GELI_SUPPORT +#include "geliboot.h" struct geli_boot_args *gargs; #endif #ifdef LOADER_ZFS_SUPPORT @@ -173,6 +175,10 @@ main(void) if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) { zargs = (struct zfs_boot_args *)(kargs + 1); if (zargs != NULL && zargs->size >= offsetof(struct zfs_boot_args, gelipw)) { + if (zargs->size >= offsetof(struct zfs_boot_args, keybuf_sentinel) && + zargs->keybuf_sentinel == KEYBUF_SENTINEL) { + geli_save_keybuf(zargs->keybuf); + } if (zargs->gelipw[0] != '\0') { setenv("kern.geom.eli.passphrase", zargs->gelipw, 1); explicit_bzero(zargs->gelipw, sizeof(zargs->gelipw)); @@ -185,6 +191,9 @@ main(void) if ((kargs->bootflags & KARGS_FLAGS_EXTARG) != 0) { gargs = (struct geli_boot_args *)(kargs + 1); if (gargs != NULL && gargs->size >= offsetof(struct geli_boot_args, gelipw)) { + if (gargs->keybuf_sentinel == KEYBUF_SENTINEL) { + geli_save_keybuf(gargs->keybuf); + } if (gargs->gelipw[0] != '\0') { setenv("kern.geom.eli.passphrase", gargs->gelipw, 1); explicit_bzero(gargs->gelipw, sizeof(gargs->gelipw)); Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/i386/zfsboot/zfsboot.c Sat Apr 1 05:05:22 2017 (r316343) @@ -121,7 +121,7 @@ static struct dmadat *dmadat; void exit(int); void reboot(void); static void load(void); -static int parse(void); +static int parse_cmd(void); static void bios_getmem(void); void *malloc(size_t n); void free(void *ptr); @@ -159,6 +159,7 @@ strdup(const char *s) #ifdef LOADER_GELI_SUPPORT #include "geliboot.c" static char gelipw[GELI_PW_MAXLEN]; +static struct keybuf *gelibuf; #endif #include "zfsimpl.c" @@ -502,7 +503,8 @@ probe_drive(struct dsk *dsk) elba--; } if (geli_taste(vdev_read, dsk, elba) == 0) { - if (geli_passphrase(&gelipw, dsk->unit, ':', 0, dsk) == 0) { + if (geli_havekey(dsk) == 0 || geli_passphrase(&gelipw, dsk->unit, + ':', 0, dsk) == 0) { if (vdev_probe(vdev_read, dsk, NULL) == 0) { return; } @@ -559,7 +561,8 @@ probe_drive(struct dsk *dsk) #ifdef LOADER_GELI_SUPPORT else if (geli_taste(vdev_read, dsk, ent->ent_lba_end - ent->ent_lba_start) == 0) { - if (geli_passphrase(&gelipw, dsk->unit, 'p', dsk->slice, dsk) == 0) { + if (geli_havekey(dsk) == 0 || geli_passphrase(&gelipw, + dsk->unit, 'p', dsk->slice, dsk) == 0) { /* * This slice has GELI, check it for ZFS. */ @@ -597,7 +600,8 @@ trymbr: #ifdef LOADER_GELI_SUPPORT else if (geli_taste(vdev_read, dsk, dp[i].dp_size - dp[i].dp_start) == 0) { - if (geli_passphrase(&gelipw, dsk->unit, 's', i, dsk) == 0) { + if (geli_havekey(dsk) == 0 || geli_passphrase(&gelipw, dsk->unit, + 's', i, dsk) == 0) { /* * This slice has GELI, check it for ZFS. */ @@ -729,7 +733,7 @@ main(void) */ nextboot = 1; memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) { + if (parse_cmd()) { printf("failed to parse pad2 area of primary vdev\n"); reboot(); } @@ -756,11 +760,11 @@ main(void) if (*cmd) { /* - * Note that parse() is destructive to cmd[] and we also want + * Note that parse_cmd() is destructive to cmd[] and we also want * to honor RBX_QUIET option that could be present in cmd[]. */ memcpy(cmddup, cmd, sizeof(cmd)); - if (parse()) + if (parse_cmd()) autoboot = 0; if (!OPT_CHECK(RBX_QUIET)) printf("%s: %s\n", PATH_CONFIG, cmddup); @@ -810,7 +814,7 @@ main(void) else if (!autoboot || !OPT_CHECK(RBX_QUIET)) putchar('\n'); autoboot = 0; - if (parse()) + if (parse_cmd()) putchar('\a'); else load(); @@ -925,8 +929,12 @@ load(void) zfsargs.root = zfsmount.rootobj; zfsargs.primary_pool = primary_spa->spa_guid; #ifdef LOADER_GELI_SUPPORT - bcopy(gelipw, zfsargs.gelipw, sizeof(zfsargs.gelipw)); explicit_bzero(gelipw, sizeof(gelipw)); + gelibuf = malloc(sizeof(struct keybuf) + (GELI_MAX_KEYS * sizeof(struct keybuf_ent))); + geli_fill_keybuf(gelibuf); + zfsargs.notapw = '\0'; + zfsargs.keybuf_sentinel = KEYBUF_SENTINEL; + zfsargs.keybuf = gelibuf; #else zfsargs.gelipw[0] = '\0'; #endif @@ -979,7 +987,7 @@ zfs_mount_ds(char *dsname) } static int -parse(void) +parse_cmd(void) { char *arg = cmd; char *ep, *p, *q; Modified: head/sys/boot/zfs/libzfs.h ============================================================================== --- head/sys/boot/zfs/libzfs.h Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/boot/zfs/libzfs.h Sat Apr 1 05:05:22 2017 (r316343) @@ -47,6 +47,10 @@ struct zfs_devdesc uint64_t root_guid; }; +#ifdef LOADER_GELI_SUPPORT +#include +#endif + struct zfs_boot_args { uint32_t size; @@ -55,7 +59,21 @@ struct zfs_boot_args uint64_t root; uint64_t primary_pool; uint64_t primary_vdev; - char gelipw[256]; + union { + char gelipw[256]; + struct { + char notapw; /* + * single null byte to stop keybuf + * being interpreted as a password + */ + uint32_t keybuf_sentinel; +#ifdef LOADER_GELI_SUPPORT + struct keybuf *keybuf; +#else + void *keybuf; +#endif + }; + }; }; int zfs_parsedev(struct zfs_devdesc *dev, const char *devspec, Added: head/sys/crypto/intake.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/intake.h Sat Apr 1 05:05:22 2017 (r316343) @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2016 Eric McCorkle + * 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _INTAKE_H_ +#define _INTAKE_H_ + +#include + +/* + * This file provides an interface for providing keys to the kernel + * during boot time. + */ + +#define MAX_KEY_BITS 4096 +#define MAX_KEY_BYTES (MAX_KEY_BITS / NBBY) + +#define KEYBUF_SENTINEL 0xcee54b5d /* KEYS4BSD */ + +enum { + KEYBUF_TYPE_NONE, + KEYBUF_TYPE_GELI +}; + +struct keybuf_ent { + unsigned int ke_type; + char ke_data[MAX_KEY_BYTES]; +}; + +struct keybuf { + unsigned int kb_nents; + struct keybuf_ent kb_ents[]; +}; + +#ifdef _KERNEL +/* Get the key intake buffer */ +extern struct keybuf* get_keybuf(void); +#endif + +#endif Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Sat Apr 1 04:42:35 2017 (r316342) +++ head/sys/geom/eli/g_eli.c Sat Apr 1 05:05:22 2017 (r316343) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + FEATURE(geom_eli, "GEOM crypto module"); MALLOC_DEFINE(M_ELI, "eli data", "GEOM_ELI Data"); @@ -111,13 +113,39 @@ fetch_loader_passphrase(void * dummy) } SYSINIT(geli_fetch_loader_passphrase, SI_SUB_KMEM + 1, SI_ORDER_ANY, fetch_loader_passphrase, NULL); + static void -zero_boot_passcache(void * dummy) +zero_boot_passcache(void) { - memset(cached_passphrase, 0, sizeof(cached_passphrase)); + explicit_bzero(cached_passphrase, sizeof(cached_passphrase)); +} + +static void +zero_geli_intake_keys(void) +{ + struct keybuf *keybuf; + int i; + + if ((keybuf = get_keybuf()) != NULL) { + /* Scan the key buffer, clear all GELI keys. */ + for (i = 0; i < keybuf->kb_nents; i++) { + if (keybuf->kb_ents[i].ke_type == KEYBUF_TYPE_GELI) { + explicit_bzero(keybuf->kb_ents[i].ke_data, + sizeof(keybuf->kb_ents[i].ke_data)); + keybuf->kb_ents[i].ke_type = KEYBUF_TYPE_NONE; + } + } + } +} + +static void +zero_intake_passcache(void *dummy) +{ + zero_boot_passcache(); + zero_geli_intake_keys(); } -EVENTHANDLER_DEFINE(mountroot, zero_boot_passcache, NULL, 0); +EVENTHANDLER_DEFINE(mountroot, zero_intake_passcache, NULL, 0); static eventhandler_tag g_eli_pre_sync = NULL; @@ -997,6 +1025,7 @@ g_eli_taste(struct g_class *mp, struct g u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN]; u_int i, nkey, nkeyfiles, tries; int error; + struct keybuf *keybuf; g_trace(G_T_TOPOLOGY, "%s(%s, %s)", __func__, mp->name, pp->name); g_topology_assert(); @@ -1035,97 +1064,114 @@ g_eli_taste(struct g_class *mp, struct g tries = g_eli_tries; } - for (i = 0; i <= tries; i++) { - g_eli_crypto_hmac_init(&ctx, NULL, 0); - - /* - * Load all key files. - */ - nkeyfiles = g_eli_keyfiles_load(&ctx, pp->name); - - if (nkeyfiles == 0 && md.md_iterations == -1) { - /* - * No key files and no passphrase, something is - * definitely wrong here. - * geli(8) doesn't allow for such situation, so assume - * that there was really no passphrase and in that case - * key files are no properly defined in loader.conf. - */ - G_ELI_DEBUG(0, - "Found no key files in loader.conf for %s.", - pp->name); - return (NULL); - } - - /* Ask for the passphrase if defined. */ - if (md.md_iterations >= 0) { - /* Try first with cached passphrase. */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 1 05:31:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31038D2BDB3; Sat, 1 Apr 2017 05:31:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17DB3BEF; Sat, 1 Apr 2017 05:31:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v315VtxE024841; Fri, 31 Mar 2017 22:31:55 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v315VspK024840; Fri, 31 Mar 2017 22:31:54 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704010531.v315VspK024840@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r316342 - in head: etc/defaults etc/periodic/daily share/man/man5 usr.sbin/periodic In-Reply-To: <201704010442.v314gZB5044999@repo.freebsd.org> To: Alan Somers Date: Fri, 31 Mar 2017 22:31:54 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 05:31:58 -0000 Small error in date below > Author: asomers > Date: Sat Apr 1 04:42:35 2017 > New Revision: 316342 > URL: https://svnweb.freebsd.org/changeset/base/316342 > > Log: > Consolidate random sleeps in periodic scripts > > Multiple periodic scripts sleep for a random amount of time in order to > mitigate the thundering herd problem. This is bad, because the sum of > multiple uniformly distributed random variables approaches a normal > distribution, so the problem isn't mitigated as effectively as it would be > with a single sleep. > > This change creates a single configurable anticongestion sleep. periodic > will only sleep if at least one script requires it, and it will never sleep > more than once per invocation. It also won't sleep if periodic was run > interactively, fixing an unrelated longstanding bug. > > PR: 217055 > PR: 210188 > Reviewed by: cy > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D10211 > > Modified: > head/etc/defaults/periodic.conf > head/etc/periodic/daily/480.leapfile-ntpd > head/share/man/man5/periodic.conf.5 > head/usr.sbin/periodic/periodic.sh > > Modified: head/etc/defaults/periodic.conf > ============================================================================== > --- head/etc/defaults/periodic.conf Sat Apr 1 01:00:36 2017 (r316341) > +++ head/etc/defaults/periodic.conf Sat Apr 1 04:42:35 2017 (r316342) > @@ -22,6 +22,8 @@ periodic_conf_files="/etc/periodic.conf > # periodic script dirs > local_periodic="/usr/local/etc/periodic" > > +# Max time to sleep to avoid causing congestion on download servers > +anticongestion_sleeptime=3600 > > # Daily options > > @@ -136,8 +138,6 @@ daily_status_mail_rejects_shorten="NO" > > # 480.leapfile-ntpd > daily_ntpd_leapfile_enable="YES" # Fetch NTP leapfile > -daily_ntpd_avoid_congestion="YES" # Avoid congesting > - # leapfile sources > > # 480.status-ntpd > daily_status_ntpd_enable="NO" # Check NTP status > @@ -307,6 +307,18 @@ security_status_tcpwrap_period="daily" > if [ -z "${source_periodic_confs_defined}" ]; then > source_periodic_confs_defined=yes > > + # Sleep for a random amount of time in order to mitigate the thundering > + # herd problem of multiple hosts running periodic simultaneously. > + # Will not sleep when used interactively. > + # Will sleep at most once per invocation of periodic > + anticongestion() { > + [ -n "$PERIODIC_IS_INTERACTIVE" ] && return > + if [ -f "$PERIODIC_ANTICONGESTION_FILE" ]; then > + rm -f $PERIODIC_ANTICONGESTION_FILE > + sleep `jot -r 1 0 ${anticongestion_sleeptime}` > + fi > + } > + > # Compatibility with old daily variable names. > # They can be removed in stable/11. > security_daily_compat_var() { > > Modified: head/etc/periodic/daily/480.leapfile-ntpd > ============================================================================== > --- head/etc/periodic/daily/480.leapfile-ntpd Sat Apr 1 01:00:36 2017 (r316341) > +++ head/etc/periodic/daily/480.leapfile-ntpd Sat Apr 1 04:42:35 2017 (r316342) > @@ -13,16 +13,9 @@ fi > > case "$daily_ntpd_leapfile_enable" in > [Yy][Ee][Ss]) > - case "$daily_ntpd_avoid_congestion" in > - [Yy][Ee][Ss]) > - # Avoid dogpiling > - (sleep $(jot -r 1 0 3600); service ntpd onefetch) & > - ;; > - *) > - service ntpd onefetch > - ;; > - esac > - ;; > + anticongestion > + service ntpd onefetch > + ;; > esac > > exit $rc > > Modified: head/share/man/man5/periodic.conf.5 > ============================================================================== > --- head/share/man/man5/periodic.conf.5 Sat Apr 1 01:00:36 2017 (r316341) > +++ head/share/man/man5/periodic.conf.5 Sat Apr 1 04:42:35 2017 (r316342) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 26, 2015 > +.Dd March 31, 2015 ^^^^ 2017? > .Dt PERIODIC.CONF 5 > .Os > .Sh NAME > @@ -133,6 +133,10 @@ respectively. > Refer to the > .Xr periodic 8 > manual page for how script return codes are interpreted. > +.It Va anticongestion_sleeptime > +.Pq Vt int > +The maximum number of seconds to randomly sleep in order to smooth bursty loads > +on a shared resource, such as a download mirror. > .El > .Pp > The following variables are used by the standard scripts that reside in > > Modified: head/usr.sbin/periodic/periodic.sh > ============================================================================== > --- head/usr.sbin/periodic/periodic.sh Sat Apr 1 01:00:36 2017 (r316341) > +++ head/usr.sbin/periodic/periodic.sh Sat Apr 1 04:42:35 2017 (r316342) > @@ -76,6 +76,12 @@ fi > shift > arg=$1 > > +if [ -z "$PERIODIC_ANTICONGESTION_FILE" ] ; then > + export PERIODIC_ANTICONGESTION_FILE=`mktemp ${TMPDIR:-/tmp}/periodic.anticongestion.XXXXXXXXXX` > +fi > +if tty > /dev/null 2>&1; then > + export PERIODIC_IS_INTERACTIVE=1 > +fi > tmp_output=`mktemp ${TMPDIR:-/tmp}/periodic.XXXXXXXXXX` > context="$PERIODIC" > export PERIODIC="$arg${PERIODIC:+ }${PERIODIC}" > @@ -141,3 +147,4 @@ esac > } | output_pipe $arg "$context" > > rm -f $tmp_output > +rm -f $PERIODIC_ANTICONGESTION_FILE > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sat Apr 1 05:49:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E982FD29520; Sat, 1 Apr 2017 05:49:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 97132B10; Sat, 1 Apr 2017 05:49:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 335B4426DEF; Sat, 1 Apr 2017 16:49:44 +1100 (AEDT) Date: Sat, 1 Apr 2017 16:49:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Brooks Davis cc: John Baldwin , Peter Grehan , Ian Lepore , Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316311 - in head: lib/libstand sys/boot/geli sys/boot/i386/gptboot sys/boot/i386/loader sys/boot/i386/zfsboot In-Reply-To: <20170331191158.GA76402@spindle.one-eyed-alien.net> Message-ID: <20170401153126.W873@besplex.bde.org> References: <201703310004.v2V04W3A043449@repo.freebsd.org> <1490973411.64669.121.camel@freebsd.org> <11865010.raXmoPpVZB@ralph.baldwin.cx> <20170331191158.GA76402@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8gEpdtttSh0Ijrxtdp8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 05:49:53 -0000 On Fri, 31 Mar 2017, Brooks Davis wrote: > On Fri, Mar 31, 2017 at 11:29:20AM -0700, John Baldwin wrote: >> On Friday, March 31, 2017 09:04:51 AM Peter Grehan wrote: >>>> So... can anyone provide a clue what's "explicit" (or different in any >>>> way) between explicit_bzero() and normal bzero()? >>> >>> >>> https://www.freebsd.org/cgi/man.cgi?query=explicit_bzero&sektion=3&manpath=FreeBSD+12-current >> >> It should be called 'bzero_now_I_mean_it()' >> >> (but then we would need some other function called anybody_want_a_peanut()) > > It's sole purpose is to prevent the compiler from observing a pattern > like: > > char a_secret_key[len]; > ... > bzero(a_secret_key, len); > return; > > or > > char *a_secret_key = malloc(len); > ... > bzero(a_secret_key, len); > free(a_secret_key); > > And optimizing away bzero() because it knows what bzero() does and that > nothing will ever access it as far as the C language is concerned.. Only broken compilers know what bzero() does. It is not a Standard C function, and libstand doesn't implement Standard C. Most boot code is compiled with -ffreestanding to prevent similar but valid optimizations of Standard C functions, but geli isn't. Some versions of POSIX have bzero() under certain feature test macros, and a compiler for such versions of POSIX could optimize bzero() if it also understands the feature test macros. I doubt that any compiler understands this. In FreeBSD, the feature test macro condition for bzero() in is __BSD_VISIBLE__ || POSIX_VISIBLE <= 200112. The compiler could reasonably optimize calls to bzero() if this condition is satisfied in the caller's compilation unit. bzero() (and most other functions) is not properly declared in . just includes and many other standard headers and gets massive namespace pollution for unimplemented things and bogus visibility ifdefs for things like bzero() that it does implement. bzero() is standard in libstand, but it is not obviously the standard one. handles some functions better. It declares getchar() and doesn't include . (All of its function declararions have style bugs. Functions are declared as extern, as was necessary to support versions of K&R older than the one that BSD pretended to support 25 years ago. Many of its declarations have bugs. Many have named parameters in the application namespace. Some have a style bug instead of this bug -- they don't name the parameters. None use the technically correct method of naming parameters with underscores.) It only has the malloc() family of functions as macros which expand to private functions like Malloc(). > The moment you enable LTO all bets are off because it can pattern match > the code for explicit_bzero(), realize that it is that same as bzero() > and combine them. Declaring a_secret_key volatile likely makes things > work, but the C language is deficient in not providing a way to express > something like explicit_bzero() sanely and reliable. That is an invalid optimization even for bzero(). I doubt that LTO is "smart" enough to even read the code of bzero() and reverse engineer this to get its implementation in C. bzero() is nonstandard so nothing can be inferred from its name. It might be a private version that takes pointers to volatiles. Then C semantics don't allow removing the memory accesses. LTO can determine if the pointers are volatiles given sufficient annotations. Debugging annotations would give some volatile types, but I think it is insuccient to attach the types to variables. But determining the absence of volatile types is not enough for the optimization. The compiler has merely reverse-engineered the current implmentation, and needs more annotations to determine that the absense of volatile types is not just an implementation detail. The compiler could read the documentation of libstand. Unfortately, if it does that it can know that its optimization of bzero() is valid subject to the complications with the feature tests. libstand(3) just says that "String functions are available as documented in string(3)". So the functions must be the standard ones for the applicable standard. The compiler next has to read and understand string(3) better than its authors. Of course, it doesn't document the feature test macros. bzero() is actually documented in bzero(3). Of course, the feature test macros aren't documented there either. It is documented that POSIX removed bzero() in 2008 and it is implicit that FreeBSD still has it. explicit_bzero() is much the same as bzero(), except if the compiler follows the chain of optimization down to bzero(3), and understand it, then it will see that explicit_bzero() is a little different. explicit_bzero()'s API is broken as designed, since it doesn't have volatiles in it. The memory accesses are magic, and volatile is the only way to express this. The difference between explicit_bzero() and bzero() comes down to the clause in bzero() that disallows compilers running their dead store optimization pass on it: The explicit_bzero() variant behaves the same, but will not be removed by a compiler's dead store optimization pass, making it useful for clearing sensitive memory such as a password. This says that compilers can and should treat explicit_bzero() the same as bzero(), except they are not allowed to remove it via their dead store optimization pass. They are still allowed to remove it via any other type of optimization pass, provided they read and understand the documentation up to this point and know that they can apply their optimizations to bzero() because it is standard in libstand and libstand defere to other standards (or just the bzero(3) man page) where it is the Standard one known to the compiler (or close enough according to its documentation). It is still a hack to use bzero() for its side effects. I just don't like explicit_bzero()'s API, starting with its name. "explicit" is verbose and gives little information about what it does. "byte" is already abbreviated to "b" to avoid a verbose name. I might use vbzero() (volatile vbzero()), taking a volatile arg. This prevents all compiler optimizations except invalid LTO, and has clearer semantics and other uses. Strict volatile semantics probably requires doing all the accesses 1 byte at a time and certainly in memory order, which is not always what is wanted, so a more general vbzero() would look like bus_space on memory-mapped devices. Bus space has bad verbose names too. Bruce From owner-svn-src-all@freebsd.org Sat Apr 1 07:44:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13570D273BE; Sat, 1 Apr 2017 07:44:30 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x22a.google.com (mail-ua0-x22a.google.com [IPv6:2607:f8b0:400c:c08::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C00BFBFC; Sat, 1 Apr 2017 07:44:29 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x22a.google.com with SMTP id 17so6218542uah.0; Sat, 01 Apr 2017 00:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=68yTWtElqybhMi6KzviM5+md+n0wzv3hn27A5uznvVs=; b=Uk4gMCfgZk2vd+lH04Z6cZk/ZN4AIf0wK+lF94KdRO/L3eVaD8CeNJna5Kfer+cKSU /oUnvyHkDU3JRg9EbwzWxRbdBLGHdVZBlCB+HTMRwu9pUPIh/kKP8b7JcYgejeJ1AnWi t50h0AeGrPDq9V5LUjYQIxulWl5PupEnqWlWnblnBJLySrUsZ+9KUjTHy/at1+GGQ4B+ V6NKz1gJwXs9XEO/+6OciUkO7EwdUe1N/QvHOJ01SgwkQsrya9b/ma00jsHlE5UEOW8M 1oUsf1oL9ZSo8nJHqvOAUEm4Crzi68bwq2U/FGfmivoToiqON+0gJV6NHhh1WwjeQrTd 9JaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=68yTWtElqybhMi6KzviM5+md+n0wzv3hn27A5uznvVs=; b=ka4mOIdsEeAixf60n05Uz4cWs8RFSlaHt4Pnj5iK08nl1siZ5domjfyLm/c5m7URZz qQANnshonlbD5piKju278whLAhq0B30jekNqPiLKUjYv7e/DTT4c4LAtjWP3PP6m9rAk x0tkWjKlGTtwHFognwuNCwxgl9LU1orbn6045vDGz55ZMlt7vkfjKjF1yoIOeENmJZ+L CUkSRCjpUiDn94uviWw0K105O65rkOB5op/75nv7gpVQ7b68ya3z2zkrqxYLMAOC0em2 +m/XDRFK31uVf0NzhomnACZREImdN3gIMy8VGG9gWIWLZ+GzGVyYfT3x5h/8+8Kf8xxQ dRyQ== X-Gm-Message-State: AFeK/H1x+WbUSfKfnU3rqAbYdAix5XXCeyt0oBL+SIiKWHC4AtF7Xw4fsfJlKNZLYrG8cZjlvG11Hs2a/sFnhw== X-Received: by 10.176.6.129 with SMTP id g1mr3678777uag.68.1491032668754; Sat, 01 Apr 2017 00:44:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.76.72 with HTTP; Sat, 1 Apr 2017 00:44:28 -0700 (PDT) In-Reply-To: References: <201703302243.v2UMhX2s011405@repo.freebsd.org> <20170330230227.GH1016@strugglingcoder.info> <20170330231158.GI1016@strugglingcoder.info> From: Sepherosa Ziehau Date: Sat, 1 Apr 2017 15:44:28 +0800 Message-ID: Subject: Re: svn commit: r316309 - head/sys/dev/qlxgbe To: "Somayajulu, David" Cc: hiren panchasara , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , David C Somayajulu Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 07:44:30 -0000 Maybe it's time to add an IFCAP for HWLRO. On Fri, Mar 31, 2017 at 7:39 AM, Somayajulu, David wrote: >>> > I know this is not a new topic but a little more descriptive commit-log would have been nicer. Also, you should update the manpage reflecting this change. i.e. now it also supports software LRO when h/w LRO is disabled. >>> Will do. Sorry about that. > Minor correction. Please note that the driver provides the ability to choose between SoftwareLRO and HW LRO, when LRO is enabled - it is HW LRO by default. If LRO is turned off via ifconfig, neither Software nor HW LRO is enabled. > > Cheers > David S. > > -----Original Message----- > From: hiren panchasara [mailto:hiren@strugglingcoder.info] > Sent: Thursday, March 30, 2017 4:12 PM > To: Somayajulu, David > Cc: David C Somayajulu ; src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org > Subject: Re: svn commit: r316309 - head/sys/dev/qlxgbe > > On 03/30/17 at 11:07P, Somayajulu, David wrote: >> Hi Hiren, >> > I know this is not a new topic but a little more descriptive commit-log would have been nicer. Also, you should update the manpage reflecting this change. i.e. now it also supports software LRO when h/w LRO is disabled. >> Will do. Sorry about that. > > Thanks! >> >> > Do you know of a case where one would want to disable h/w lro and enable s/w lro? I guess where you want to free up nic and make cpu do more work? >> I was under the impression as well, that s/w lro is moot, if h/w lro was available, till one costumer asked for it. Not sure what the use case is. > > I thought this idea (like gro in linux) was popular when lro in h/w was considered buggy and couldn't correctly do batching (i.e. hide useful flags). Not sure if that's still the case. > > cheers, > Hiren > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Sat Apr 1 08:37:21 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 08:47:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 08:34:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 08:40:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 09:27:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 09:29:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 09:31:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 09:32:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 09:33:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 09:37:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 10:02:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 11:24:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 11:24:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 12:22:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92851D27B7A; Sat, 1 Apr 2017 12:22:35 +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 6246F79D; Sat, 1 Apr 2017 12:22:35 +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 v31CMYkE035536; Sat, 1 Apr 2017 12:22:34 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31CMYhP035535; Sat, 1 Apr 2017 12:22:34 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201704011222.v31CMYhP035535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 1 Apr 2017 12:22:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316355 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 12:22:35 -0000 Author: kp Date: Sat Apr 1 12:22:34 2017 New Revision: 316355 URL: https://svnweb.freebsd.org/changeset/base/316355 Log: pf: Fix leak of pf_state_keys If we hit the state limit we returned from pf_create_state() without cleaning up. PR: 217997 Submitted by: Max MFC after: 1 week Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Apr 1 11:24:34 2017 (r316354) +++ head/sys/netpfil/pf/pf.c Sat Apr 1 12:22:34 2017 (r316355) @@ -3559,7 +3559,7 @@ pf_create_state(struct pf_rule *r, struc (counter_u64_fetch(r->states_cur) >= r->max_states)) { counter_u64_add(V_pf_status.lcounters[LCNT_STATES], 1); REASON_SET(&reason, PFRES_MAXSTATES); - return (PF_DROP); + goto csfailed; } /* src node for filter rule */ if ((r->rule_flag & PFRULE_SRCTRACK || From owner-svn-src-all@freebsd.org Sat Apr 1 12:27:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 15:01:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A65C4D28ECB; Sat, 1 Apr 2017 15:01:11 +0000 (UTC) (envelope-from novel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73362CBB; Sat, 1 Apr 2017 15:01:11 +0000 (UTC) (envelope-from novel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31F1AtV098004; Sat, 1 Apr 2017 15:01:10 GMT (envelope-from novel@FreeBSD.org) Received: (from novel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31F1AMn098003; Sat, 1 Apr 2017 15:01:10 GMT (envelope-from novel@FreeBSD.org) Message-Id: <201704011501.v31F1AMn098003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: novel set sender to novel@FreeBSD.org using -f From: Roman Bogorodskiy Date: Sat, 1 Apr 2017 15:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316357 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 15:01:11 -0000 Author: novel (ports committer) Date: Sat Apr 1 15:01:10 2017 New Revision: 316357 URL: https://svnweb.freebsd.org/changeset/base/316357 Log: Minor style improvements in bhyve.8 Replace "as of now" with "at present". As the change is a really minor one, don't bump .Dd. Suggested by: wblock Approved by: wblock (implicit) Modified: head/usr.sbin/bhyve/bhyve.8 Modified: head/usr.sbin/bhyve/bhyve.8 ============================================================================== --- head/usr.sbin/bhyve/bhyve.8 Sat Apr 1 12:27:02 2017 (r316356) +++ head/usr.sbin/bhyve/bhyve.8 Sat Apr 1 15:01:10 2017 (r316357) @@ -294,9 +294,9 @@ sockets on the filesystem must be cleane exits. .It There is no way to use the "console port" feature, nor the console port -resize as of now. +resize at present. .It -Emergency write is advertised, but no-op as of now. +Emergency write is advertised, but no-op at present. .El .El .El From owner-svn-src-all@freebsd.org Sat Apr 1 15:04:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7330CD2904E; Sat, 1 Apr 2017 15:04:38 +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 452F3211; Sat, 1 Apr 2017 15:04:38 +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 v31F4bBi000662; Sat, 1 Apr 2017 15:04:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31F4bfv000660; Sat, 1 Apr 2017 15:04:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201704011504.v31F4bfv000660@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 15:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316358 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 15:04:38 -0000 Author: asomers Date: Sat Apr 1 15:04:37 2017 New Revision: 316358 URL: https://svnweb.freebsd.org/changeset/base/316358 Log: Fix man page typo from r316342 Reported by: rgrimes MFC after: 20 days X-MFC-With: 316342 Modified: head/share/man/man5/periodic.conf.5 Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Sat Apr 1 15:01:10 2017 (r316357) +++ head/share/man/man5/periodic.conf.5 Sat Apr 1 15:04:37 2017 (r316358) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 31, 2015 +.Dd March 31, 2017 .Dt PERIODIC.CONF 5 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sat Apr 1 16:22:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 16:35:44 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 16:38:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 16:51:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 17:07:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 17:09:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 17:13:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 17:15:54 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 18:52:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 19:08:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76756D29C09; Sat, 1 Apr 2017 19:08:23 +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 4420FA61; Sat, 1 Apr 2017 19:08:23 +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 v31J8M1h024987; Sat, 1 Apr 2017 19:08:22 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31J8M9q024986; Sat, 1 Apr 2017 19:08:22 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704011908.v31J8M9q024986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 1 Apr 2017 19:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316368 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 19:08:23 -0000 Author: jkim Date: Sat Apr 1 19:08:22 2017 New Revision: 316368 URL: https://svnweb.freebsd.org/changeset/base/316368 Log: Fix typos to stop removing new files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Apr 1 18:52:48 2017 (r316367) +++ head/ObsoleteFiles.inc Sat Apr 1 19:08:22 2017 (r316368) @@ -45,16 +45,16 @@ 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 +OLD_FILES+=usr/tests/usr.sbin/pw/pw_config +OLD_FILES+=usr/tests/usr.sbin/pw/pw_etcdir +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupadd +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupdel +OLD_FILES+=usr/tests/usr.sbin/pw/pw_groupmod +OLD_FILES+=usr/tests/usr.sbin/pw/pw_lock +OLD_FILES+=usr/tests/usr.sbin/pw/pw_useradd +OLD_FILES+=usr/tests/usr.sbin/pw/pw_userdel +OLD_FILES+=usr/tests/usr.sbin/pw/pw_usermod +OLD_FILES+=usr/tests/usr.sbin/pw/pw_usernext # 20170322: garbage collect old references to igb(4) OLD_FILES+=usr/share/man/man4/if_igb.4.gz OLD_FILES+=usr/share/man/man4/igb.4.gz From owner-svn-src-all@freebsd.org Sat Apr 1 19:27:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 20:10:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9348BD29339; Sat, 1 Apr 2017 20:10:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 320DB791; Sat, 1 Apr 2017 20:10:10 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31KA97O050710; Sat, 1 Apr 2017 20:10:09 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31KA88E050702; Sat, 1 Apr 2017 20:10:08 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201704012010.v31KA88E050702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 1 Apr 2017 20:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316370 - in head/sys/arm: arm conf versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 20:10:10 -0000 Author: gonzo Date: Sat Apr 1 20:10:08 2017 New Revision: 316370 URL: https://svnweb.freebsd.org/changeset/base/316370 Log: [versatilepb] Convert VERSATILEPB kernel to INTRNG and switch to upstream DTB Scope of this change is somewhat larger than just converting to INTRNG. The reason for this is that INTRNG support required switching from custom to upstream DTS because custom DTS didn't have interrup routing information. This switch caused rewrite of PCI and CLCD drivers and adding SCM module. List of changes in this commit: - Enable INTRNG and switch to versatile-pb.dts - Add SCM driver that controls various peripheral devices like LCD or PCI controller. Previously registers required for power-up and configuring peripherals were part of their respective nodes. Upstream DTS has dedicated node for SCM - Convert PL190 driver to INTRNG - Convert Versatile SIC (secondary interrupt controller) to INTRNG - Refactor CLCD driver to use SCM API to power up and configuration - Refactor PCI driver to use SCM API to enable controller - Refactor PCI driver to use interrupt map provided in DTS for interrupt routing. As a result it fixes broken IRQ routing and it's no longer required to run QEMU with "-global versatile_pci.broken-irq-mapping=1" command-line arguments Added: head/sys/arm/versatile/versatile_scm.c (contents, props changed) head/sys/arm/versatile/versatile_scm.h (contents, props changed) Modified: head/sys/arm/arm/pl190.c head/sys/arm/conf/VERSATILEPB head/sys/arm/versatile/files.versatile head/sys/arm/versatile/versatile_clcd.c head/sys/arm/versatile/versatile_pci.c head/sys/arm/versatile/versatile_sic.c Modified: head/sys/arm/arm/pl190.c ============================================================================== --- head/sys/arm/arm/pl190.c Sat Apr 1 19:27:06 2017 (r316369) +++ head/sys/arm/arm/pl190.c Sat Apr 1 20:10:08 2017 (r316370) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2017 Oleksandr Tymoshenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -34,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" + #ifdef DEBUG #define dprintf(fmt, args...) printf(fmt, ##args) #else @@ -62,17 +64,139 @@ __FBSDID("$FreeBSD$"); #define VIC_NIRQS 32 +struct pl190_intc_irqsrc { + struct intr_irqsrc isrc; + u_int irq; +}; + struct pl190_intc_softc { - device_t sc_dev; + device_t dev; + struct mtx mtx; struct resource * intc_res; + struct pl190_intc_irqsrc isrcs[VIC_NIRQS]; }; -static struct pl190_intc_softc *pl190_intc_sc = NULL; +#define INTC_VIC_READ_4(sc, reg) \ + bus_read_4(sc->intc_res, (reg)) +#define INTC_VIC_WRITE_4(sc, reg, val) \ + bus_write_4(sc->intc_res, (reg), (val)) + +#define VIC_LOCK(_sc) mtx_lock_spin(&(_sc)->mtx) +#define VIC_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->mtx) + +static inline void +pl190_intc_irq_dispatch(struct pl190_intc_softc *sc, u_int irq, + struct trapframe *tf) +{ + struct pl190_intc_irqsrc *src; + + src = &sc->isrcs[irq]; + if (intr_isrc_dispatch(&src->isrc, tf) != 0) + device_printf(sc->dev, "Stray irq %u detected\n", irq); +} + +static int +pl190_intc_intr(void *arg) +{ + struct pl190_intc_softc *sc; + u_int cpu; + uint32_t num, pending; + struct trapframe *tf; + + sc = arg; + cpu = PCPU_GET(cpuid); + tf = curthread->td_intr_frame; + + VIC_LOCK(sc); + pending = INTC_VIC_READ_4(sc, VICIRQSTATUS); + VIC_UNLOCK(sc); + for (num = 0 ; num < VIC_NIRQS; num++) { + if (pending & (1 << num)) + pl190_intc_irq_dispatch(sc, num, tf); + } + + return (FILTER_HANDLED); +} + +static void +pl190_intc_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl190_intc_softc *sc; + struct pl190_intc_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct pl190_intc_irqsrc *)isrc; + + VIC_LOCK(sc); + INTC_VIC_WRITE_4(sc, VICINTENCLEAR, (1 << src->irq)); + VIC_UNLOCK(sc); +} + +static void +pl190_intc_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl190_intc_softc *sc; + struct pl190_intc_irqsrc *src; -#define intc_vic_read_4(reg) \ - bus_read_4(pl190_intc_sc->intc_res, (reg)) -#define intc_vic_write_4(reg, val) \ - bus_write_4(pl190_intc_sc->intc_res, (reg), (val)) + sc = device_get_softc(dev); + src = (struct pl190_intc_irqsrc *)isrc; + + VIC_LOCK(sc); + INTC_VIC_WRITE_4(sc, VICINTENABLE, (1 << src->irq)); + VIC_UNLOCK(sc); +} + +static int +pl190_intc_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct intr_map_data_fdt *daf; + struct pl190_intc_softc *sc; + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 1 || daf->cells[0] >= VIC_NIRQS) + return (EINVAL); + + sc = device_get_softc(dev); + *isrcp = &sc->isrcs[daf->cells[0]].isrc; + return (0); +} + +static void +pl190_intc_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + pl190_intc_disable_intr(dev, isrc); +} + +static void +pl190_intc_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl190_intc_irqsrc *src; + + src = (struct pl190_intc_irqsrc *)isrc; + pl190_intc_enable_intr(dev, isrc); + arm_irq_memory_barrier(src->irq); +} + +static void +pl190_intc_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl190_intc_irqsrc *src; + + src = (struct pl190_intc_irqsrc *)isrc; + arm_irq_memory_barrier(src->irq); +} + +static int +pl190_intc_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + + return (0); +} static int pl190_intc_probe(device_t dev) @@ -90,14 +214,20 @@ pl190_intc_probe(device_t dev) static int pl190_intc_attach(device_t dev) { - struct pl190_intc_softc *sc = device_get_softc(dev); + struct pl190_intc_softc *sc; uint32_t id; int i, rid; - - sc->sc_dev = dev; - - if (pl190_intc_sc) - return (ENXIO); + struct pl190_intc_irqsrc *isrcs; + struct intr_pic *pic; + int error; + uint32_t irq; + const char *name; + phandle_t xref; + + sc = device_get_softc(dev); + sc->dev = dev; + mtx_init(&sc->mtx, device_get_nameunit(dev), "pl190", + MTX_SPIN); /* Request memory resources */ rid = 0; @@ -108,20 +238,17 @@ pl190_intc_attach(device_t dev) return (ENXIO); } - pl190_intc_sc = sc; /* * All interrupts should use IRQ line */ - intc_vic_write_4(VICINTSELECT, 0x00000000); + INTC_VIC_WRITE_4(sc, VICINTSELECT, 0x00000000); /* Disable all interrupts */ - intc_vic_write_4(VICINTENCLEAR, 0xffffffff); - /* Enable INT31, SIC IRQ */ - intc_vic_write_4(VICINTENABLE, (1U << 31)); + INTC_VIC_WRITE_4(sc, VICINTENCLEAR, 0xffffffff); id = 0; for (i = 3; i >= 0; i--) { id = (id << 8) | - (intc_vic_read_4(VICPERIPHID + i*4) & 0xff); + (INTC_VIC_READ_4(sc, VICPERIPHID + i*4) & 0xff); } device_printf(dev, "Peripheral ID: %08x\n", id); @@ -129,18 +256,43 @@ pl190_intc_attach(device_t dev) id = 0; for (i = 3; i >= 0; i--) { id = (id << 8) | - (intc_vic_read_4(VICPRIMECELLID + i*4) & 0xff); + (INTC_VIC_READ_4(sc, VICPRIMECELLID + i*4) & 0xff); } device_printf(dev, "PrimeCell ID: %08x\n", id); - return (0); + /* PIC attachment */ + isrcs = sc->isrcs; + name = device_get_nameunit(sc->dev); + for (irq = 0; irq < VIC_NIRQS; irq++) { + isrcs[irq].irq = irq; + error = intr_isrc_register(&isrcs[irq].isrc, sc->dev, + 0, "%s,%u", name, irq); + if (error != 0) + return (error); + } + + xref = OF_xref_from_node(ofw_bus_get_node(sc->dev)); + pic = intr_pic_register(sc->dev, xref); + if (pic == NULL) + return (ENXIO); + + return (intr_pic_claim_root(sc->dev, xref, pl190_intc_intr, sc, 0)); } static device_method_t pl190_intc_methods[] = { DEVMETHOD(device_probe, pl190_intc_probe), DEVMETHOD(device_attach, pl190_intc_attach), - { 0, 0 } + + DEVMETHOD(pic_disable_intr, pl190_intc_disable_intr), + DEVMETHOD(pic_enable_intr, pl190_intc_enable_intr), + DEVMETHOD(pic_map_intr, pl190_intc_map_intr), + DEVMETHOD(pic_post_filter, pl190_intc_post_filter), + DEVMETHOD(pic_post_ithread, pl190_intc_post_ithread), + DEVMETHOD(pic_pre_ithread, pl190_intc_pre_ithread), + DEVMETHOD(pic_setup_intr, pl190_intc_setup_intr), + + DEVMETHOD_END }; static driver_t pl190_intc_driver = { @@ -153,39 +305,3 @@ static devclass_t pl190_intc_devclass; EARLY_DRIVER_MODULE(intc, simplebus, pl190_intc_driver, pl190_intc_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); - -int -arm_get_next_irq(int last_irq) -{ - uint32_t pending; - int32_t irq = last_irq + 1; - - /* Sanity check */ - if (irq < 0) - irq = 0; - - pending = intc_vic_read_4(VICIRQSTATUS); - while (irq < VIC_NIRQS) { - if (pending & (1 << irq)) - return (irq); - irq++; - } - - return (-1); -} - -void -arm_mask_irq(uintptr_t nb) -{ - - dprintf("%s: %d\n", __func__, nb); - intc_vic_write_4(VICINTENCLEAR, (1 << nb)); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - - dprintf("%s: %d\n", __func__, nb); - intc_vic_write_4(VICINTENABLE, (1 << nb)); -} Modified: head/sys/arm/conf/VERSATILEPB ============================================================================== --- head/sys/arm/conf/VERSATILEPB Sat Apr 1 19:27:06 2017 (r316369) +++ head/sys/arm/conf/VERSATILEPB Sat Apr 1 20:10:08 2017 (r316370) @@ -68,7 +68,9 @@ makeoptions SC_DFLT_FONT=cp437 device md device random # Entropy device +options INTRNG + # Flattened Device Tree options FDT # Configure using FDT/DTB data options FDT_DTB_STATIC -makeoptions FDT_DTS_FILE=versatilepb.dts +makeoptions FDT_DTS_FILE=versatile-pb.dts Modified: head/sys/arm/versatile/files.versatile ============================================================================== --- head/sys/arm/versatile/files.versatile Sat Apr 1 19:27:06 2017 (r316369) +++ head/sys/arm/versatile/files.versatile Sat Apr 1 20:10:08 2017 (r316370) @@ -6,6 +6,7 @@ arm/versatile/versatile_machdep.c stand arm/versatile/versatile_clcd.c optional sc arm/versatile/versatile_common.c standard arm/versatile/versatile_pci.c optional pci +arm/versatile/versatile_scm.c standard arm/versatile/versatile_sic.c standard arm/versatile/versatile_timer.c standard Modified: head/sys/arm/versatile/versatile_clcd.c ============================================================================== --- head/sys/arm/versatile/versatile_clcd.c Sat Apr 1 19:27:06 2017 (r316369) +++ head/sys/arm/versatile/versatile_clcd.c Sat Apr 1 20:10:08 2017 (r316370) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2017 Oleksandr Tymoshenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -49,22 +49,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #define PL110_VENDOR_ARM926PXP 1 -#define MEM_SYS 0 -#define MEM_CLCD 1 -#define MEM_REGIONS 2 - -#define SYS_CLCD 0x00 -#define SYS_CLCD_CLCDID_SHIFT 0x08 -#define SYS_CLCD_CLCDID_MASK 0x1f -#define SYS_CLCD_PWR3V5VSWITCH (1 << 4) -#define SYS_CLCD_VDDPOSSWITCH (1 << 3) -#define SYS_CLCD_NLCDIOON (1 << 2) -#define SYS_CLCD_LCD_MODE_MASK 0x03 - #define CLCD_MODE_RGB888 0x0 #define CLCD_MODE_RGB555 0x01 #define CLCD_MODE_RBG565 0x02 @@ -119,18 +109,13 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif -#define versatile_clcdc_sys_read_4(sc, reg) \ - bus_read_4((sc)->mem_res[MEM_SYS], (reg)) -#define versatile_clcdc_sys_write_4(sc, reg, val) \ - bus_write_4((sc)->mem_res[MEM_SYS], (reg), (val)) - #define versatile_clcdc_read_4(sc, reg) \ - bus_read_4((sc)->mem_res[MEM_CLCD], (reg)) + bus_read_4((sc)->mem_res, (reg)) #define versatile_clcdc_write_4(sc, reg, val) \ - bus_write_4((sc)->mem_res[MEM_CLCD], (reg), (val)) + bus_write_4((sc)->mem_res, (reg), (val)) struct versatile_clcdc_softc { - struct resource* mem_res[MEM_REGIONS]; + struct resource* mem_res; struct mtx mtx; @@ -205,12 +190,6 @@ static u_char mouse_pointer[16] = { static struct video_adapter_softc va_softc; -static struct resource_spec versatile_clcdc_mem_spec[] = { - { SYS_RES_MEMORY, 0, RF_ACTIVE }, - { SYS_RES_MEMORY, 1, RF_ACTIVE }, - { -1, 0, 0 } -}; - static int versatilefb_configure(int); static void versatilefb_update_margins(video_adapter_t *adp); @@ -246,21 +225,25 @@ versatile_clcdc_attach(device_t dev) { struct versatile_clcdc_softc *sc = device_get_softc(dev); struct video_adapter_softc *va_sc = &va_softc; - int err; + int err, rid; uint32_t reg; int clcdid; int dma_size; /* Request memory resources */ - err = bus_alloc_resources(dev, versatile_clcdc_mem_spec, - sc->mem_res); - if (err) { - device_printf(dev, "Error: could not allocate memory resources\n"); + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "could not allocate memory resources\n"); return (ENXIO); } - reg = versatile_clcdc_sys_read_4(sc, SYS_CLCD); - clcdid = (reg >> SYS_CLCD_CLCDID_SHIFT) & SYS_CLCD_CLCDID_MASK; + err = versatile_scm_reg_read_4(SCM_CLCD, ®); + if (err) { + device_printf(dev, "failed to read SCM register\n"); + goto fail; + } + clcdid = (reg >> SCM_CLCD_CLCDID_SHIFT) & SCM_CLCD_CLCDID_MASK; switch (clcdid) { case 31: device_printf(dev, "QEMU VGA 640x480\n"); @@ -272,17 +255,17 @@ versatile_clcdc_attach(device_t dev) goto fail; } - reg &= ~SYS_CLCD_LCD_MODE_MASK; + reg &= ~SCM_CLCD_LCD_MODE_MASK; reg |= CLCD_MODE_RGB565; sc->mode = CLCD_MODE_RGB565; - versatile_clcdc_sys_write_4(sc, SYS_CLCD, reg); - dma_size = sc->width*sc->height*2; - - /* + versatile_scm_reg_write_4(SCM_CLCD, reg); + dma_size = sc->width*sc->height*2; + + /* * Power on LCD */ - reg |= SYS_CLCD_PWR3V5VSWITCH | SYS_CLCD_NLCDIOON; - versatile_clcdc_sys_write_4(sc, SYS_CLCD, reg); + reg |= SCM_CLCD_PWR3V5VSWITCH | SCM_CLCD_NLCDIOON; + versatile_scm_reg_write_4(SCM_CLCD, reg); /* * XXX: hardcoded timing for VGA. For other modes/panels @@ -655,7 +638,6 @@ versatilefb_init(int unit, video_adapter sc->xmargin = (sc->width - (vi->vi_width * vi->vi_cwidth)) / 2; sc->ymargin = (sc->height - (vi->vi_height * vi->vi_cheight))/2; - adp->va_window = (vm_offset_t) versatilefb_static_window; adp->va_flags |= V_ADP_FONT /* | V_ADP_COLOR | V_ADP_MODECHANGE */; Modified: head/sys/arm/versatile/versatile_pci.c ============================================================================== --- head/sys/arm/versatile/versatile_pci.c Sat Apr 1 19:27:06 2017 (r316369) +++ head/sys/arm/versatile/versatile_pci.c Sat Apr 1 20:10:08 2017 (r316370) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2017 Oleksandr Tymoshenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,17 +52,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include #include #include -#define MEM_SYS 0 -#define MEM_CORE 1 -#define MEM_BASE 2 -#define MEM_CONF_BASE 3 -#define MEM_REGIONS 4 - -#define SYS_PCICTL 0x00 +#define MEM_CORE 0 +#define MEM_BASE 1 +#define MEM_CONF_BASE 2 +#define MEM_REGIONS 3 #define PCI_CORE_IMAP0 0x00 #define PCI_CORE_IMAP1 0x04 @@ -92,12 +92,6 @@ __FBSDID("$FreeBSD$"); #define dprintf(fmt, args...) #endif - -#define versatile_pci_sys_read_4(reg) \ - bus_read_4(sc->mem_res[MEM_SYS], (reg)) -#define versatile_pci_sys_write_4(reg, val) \ - bus_write_4(sc->mem_res[MEM_SYS], (reg), (val)) - #define versatile_pci_core_read_4(reg) \ bus_read_4(sc->mem_res[MEM_CORE], (reg)) #define versatile_pci_core_write_4(reg, val) \ @@ -131,13 +125,13 @@ struct versatile_pci_softc { struct rman mem_rman; struct mtx mtx; + struct ofw_bus_iinfo pci_iinfo; }; static struct resource_spec versatile_pci_mem_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_MEMORY, 1, RF_ACTIVE }, { SYS_RES_MEMORY, 2, RF_ACTIVE }, - { SYS_RES_MEMORY, 3, RF_ACTIVE }, { -1, 0, 0 } }; @@ -148,7 +142,7 @@ versatile_pci_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "versatile,pci")) { + if (ofw_bus_is_compatible(dev, "arm,versatile-pci")) { device_set_desc(dev, "Versatile PCI controller"); return (BUS_PROBE_DEFAULT); } @@ -164,6 +158,9 @@ versatile_pci_attach(device_t dev) int slot; uint32_t vendordev_id, class_id; uint32_t val; + phandle_t node; + + node = ofw_bus_get_node(dev); /* Request memory resources */ err = bus_alloc_resources(dev, versatile_pci_mem_spec, @@ -188,7 +185,7 @@ versatile_pci_attach(device_t dev) versatile_pci_core_write_4(PCI_CORE_SMAP1, (PCI_NPREFETCH_WINDOW >> 28)); versatile_pci_core_write_4(PCI_CORE_SMAP2, (PCI_NPREFETCH_WINDOW >> 28)); - versatile_pci_sys_write_4(SYS_PCICTL, 1); + versatile_scm_reg_write_4(SCM_PCICTL, 1); for (slot = 0; slot <= PCI_SLOTMAX; slot++) { vendordev_id = versatile_pci_read_4((slot << 11) + PCIR_DEVVENDOR); @@ -265,6 +262,8 @@ versatile_pci_attach(device_t dev) versatile_pci_conf_write_4((slot << 11) + PCIR_COMMAND, val); } + ofw_bus_setup_iinfo(node, &sc->pci_iinfo, sizeof(cell_t)); + device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); } @@ -318,7 +317,7 @@ versatile_pci_alloc_resource(device_t bu rm = &sc->io_rman; break; case SYS_RES_IRQ: - rm = &sc->irq_rman; + rm = NULL; break; case SYS_RES_MEMORY: rm = &sc->mem_rman; @@ -327,8 +326,11 @@ versatile_pci_alloc_resource(device_t bu return (NULL); } - rv = rman_reserve_resource(rm, start, end, count, flags, child); + if (rm == NULL) + return (BUS_ALLOC_RESOURCE(device_get_parent(bus), + child, type, rid, start, end, count, flags)); + rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == NULL) return (NULL); @@ -389,8 +391,6 @@ versatile_pci_teardown_intr(device_t dev return BUS_TEARDOWN_INTR(device_get_parent(dev), dev, ires, cookie); } - - static int versatile_pci_maxslots(device_t dev) { @@ -399,10 +399,33 @@ versatile_pci_maxslots(device_t dev) } static int -versatile_pci_route_interrupt(device_t pcib, device_t device, int pin) +versatile_pci_route_interrupt(device_t bus, device_t dev, int pin) { - - return (27 + ((pci_get_slot(device) + pin - 1) & 3)); + struct versatile_pci_softc *sc; + struct ofw_pci_register reg; + uint32_t pintr, mintr[4]; + phandle_t iparent; + int intrcells; + + sc = device_get_softc(bus); + pintr = pin; + + bzero(®, sizeof(reg)); + reg.phys_hi = (pci_get_bus(dev) << OFW_PCI_PHYS_HI_BUSSHIFT) | + (pci_get_slot(dev) << OFW_PCI_PHYS_HI_DEVICESHIFT) | + (pci_get_function(dev) << OFW_PCI_PHYS_HI_FUNCTIONSHIFT); + + intrcells = ofw_bus_lookup_imap(ofw_bus_get_node(dev), + &sc->pci_iinfo, ®, sizeof(reg), &pintr, sizeof(pintr), + mintr, sizeof(mintr), &iparent); + if (intrcells) { + pintr = ofw_bus_map_intr(dev, iparent, intrcells, mintr); + return (pintr); + } + + device_printf(bus, "could not route pin %d for device %d.%d\n", + pin, pci_get_slot(dev), pci_get_function(dev)); + return (PCI_INVALID_IRQ); } static uint32_t Added: head/sys/arm/versatile/versatile_scm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/versatile_scm.c Sat Apr 1 20:10:08 2017 (r316370) @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2017 Oleksandr Tymoshenko + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Ben Gray. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BEN GRAY ``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 BEN GRAY 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. + */ + +/* + * SCM - System Control Module + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include "versatile_scm.h" + +struct versatile_scm_softc { + device_t sc_dev; + struct resource * sc_mem_res; +}; + +static struct versatile_scm_softc *versatile_scm_sc; + +#define versatile_scm_read_4(sc, reg) \ + bus_read_4((sc)->sc_mem_res, (reg)) +#define versatile_scm_write_4(sc, reg, val) \ + bus_write_4((sc)->sc_mem_res, (reg), (val)) + +static int +versatile_scm_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "syscon")) + return (ENXIO); + + if (versatile_scm_sc) { + return (EEXIST); + } + + device_set_desc(dev, "Versatile Control Module"); + return (BUS_PROBE_DEFAULT); +} + +static int +versatile_scm_attach(device_t dev) +{ + struct versatile_scm_softc *sc; + int rid; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + + if (sc->sc_mem_res == NULL) { + device_printf(dev, "could not allocate memory resources\n"); + return (ENXIO); + } + + versatile_scm_sc = sc; + + return (0); +} + +int +versatile_scm_reg_read_4(uint32_t reg, uint32_t *val) +{ + if (!versatile_scm_sc) + return (ENXIO); + + *val = versatile_scm_read_4(versatile_scm_sc, reg); + return (0); +} + +int +versatile_scm_reg_write_4(uint32_t reg, uint32_t val) +{ + if (!versatile_scm_sc) + return (ENXIO); + + versatile_scm_write_4(versatile_scm_sc, reg, val); + return (0); +} + +static device_method_t versatile_scm_methods[] = { + DEVMETHOD(device_probe, versatile_scm_probe), + DEVMETHOD(device_attach, versatile_scm_attach), + + DEVMETHOD_END +}; + +static driver_t versatile_scm_driver = { + "scm", + versatile_scm_methods, + sizeof(struct versatile_scm_softc), +}; + +static devclass_t versatile_scm_devclass; + +EARLY_DRIVER_MODULE(versatile_scm, simplebus, versatile_scm_driver, versatile_scm_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Added: head/sys/arm/versatile/versatile_scm.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/versatile/versatile_scm.h Sat Apr 1 20:10:08 2017 (r316370) @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2017 Oleksandr Tymoshenko + * 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Ben Gray. + * 4. The name of the company nor the name of the author may be used to + * endorse or promote products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY BEN GRAY ``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 BEN GRAY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _VERSATILE_SCM_H_ +#define _VERSATILE_SCM_H_ + +#define SCM_PCICTL 0x44 +#define SCM_CLCD 0x50 +#define SCM_CLCD_CLCDID_SHIFT 0x08 +#define SCM_CLCD_CLCDID_MASK 0x1f +#define SCM_CLCD_PWR3V5VSWITCH (1 << 4) +#define SCM_CLCD_VDDPOSSWITCH (1 << 3) +#define SCM_CLCD_NLCDIOON (1 << 2) +#define SCM_CLCD_LCD_MODE_MASK 0x03 + +int versatile_scm_reg_read_4(uint32_t reg, uint32_t *val); +int versatile_scm_reg_write_4(uint32_t reg, uint32_t val); + +#endif /* _VERSATILE_SCM_H_ */ Modified: head/sys/arm/versatile/versatile_sic.c ============================================================================== --- head/sys/arm/versatile/versatile_sic.c Sat Apr 1 19:27:06 2017 (r316369) +++ head/sys/arm/versatile/versatile_sic.c Sat Apr 1 20:10:08 2017 (r316370) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2017 Oleksandr Tymoshenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ - #include __FBSDID("$FreeBSD$"); @@ -34,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -42,6 +42,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" + #ifdef DEBUG #define dprintf(fmt, args...) printf(fmt, ##args) #else @@ -59,16 +61,142 @@ __FBSDID("$FreeBSD$"); #define SIC_PICENSET 0x20 #define SIC_PICENCLR 0x24 +#define SIC_NIRQS 32 + +struct versatile_sic_irqsrc { + struct intr_irqsrc isrc; + u_int irq; +}; + struct versatile_sic_softc { - device_t sc_dev; + device_t dev; + struct mtx mtx; struct resource * mem_res; + struct resource * irq_res; + void *intrh; + struct versatile_sic_irqsrc isrcs[SIC_NIRQS]; }; -#define sic_read_4(sc, reg) \ +#define SIC_LOCK(_sc) mtx_lock_spin(&(_sc)->mtx) +#define SIC_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->mtx) + +#define SIC_READ_4(sc, reg) \ bus_read_4(sc->mem_res, (reg)) -#define sic_write_4(sc, reg, val) \ +#define SIC_WRITE_4(sc, reg, val) \ bus_write_4(sc->mem_res, (reg), (val)) +/* + * Driver stuff + */ +static int versatile_sic_probe(device_t); +static int versatile_sic_attach(device_t); +static int versatile_sic_detach(device_t); + +static void +versatile_sic_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct versatile_sic_softc *sc; + struct versatile_sic_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct versatile_sic_irqsrc *)isrc; + + SIC_LOCK(sc); + SIC_WRITE_4(sc, SIC_ENCLR, (1 << src->irq)); + SIC_UNLOCK(sc); +} + +static void +versatile_sic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct versatile_sic_softc *sc; + struct versatile_sic_irqsrc *src; + + sc = device_get_softc(dev); + src = (struct versatile_sic_irqsrc *)isrc; + + SIC_LOCK(sc); + SIC_WRITE_4(sc, SIC_ENSET, (1 << src->irq)); + SIC_UNLOCK(sc); +} + +static int +versatile_sic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct intr_map_data_fdt *daf; + struct versatile_sic_softc *sc; + + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + daf = (struct intr_map_data_fdt *)data; + if (daf->ncells != 1 || daf->cells[0] >= SIC_NIRQS) + return (EINVAL); + + sc = device_get_softc(dev); + *isrcp = &sc->isrcs[daf->cells[0]].isrc; + return (0); +} + +static void +versatile_sic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + versatile_sic_disable_intr(dev, isrc); +} + +static void +versatile_sic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct versatile_sic_irqsrc *src; + + src = (struct versatile_sic_irqsrc *)isrc; + arm_irq_memory_barrier(src->irq); + versatile_sic_enable_intr(dev, isrc); +} + +static void +versatile_sic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct versatile_sic_irqsrc *src; + + src = (struct versatile_sic_irqsrc *)isrc; + arm_irq_memory_barrier(src->irq); +} + +static int +versatile_sic_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + + return (0); +} + +static int +versatile_sic_filter(void *arg) +{ + struct versatile_sic_softc *sc; + struct intr_irqsrc *isrc; + uint32_t i, interrupts; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Apr 1 20:38:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA6E6D2710A; Sat, 1 Apr 2017 20:38:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85B7A6E4; Sat, 1 Apr 2017 20:38:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31KcCVe064004; Sat, 1 Apr 2017 20:38:12 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31KcCR3064003; Sat, 1 Apr 2017 20:38:12 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201704012038.v31KcCR3064003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 1 Apr 2017 20:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316371 - head/sys/arm/versatile X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 20:38:13 -0000 Author: gonzo Date: Sat Apr 1 20:38:12 2017 New Revision: 316371 URL: https://svnweb.freebsd.org/changeset/base/316371 Log: [versatilepb] Fix keyboard driver after switching to upstream DTS FreeBSD's DTS contained only one PL050 node and driver considered it to be PS/2 keyboard. In reality PL050 is a PS/2 port that pushes bytes to/from the periphers connected to it. New DTS contains two nodes and QEMU emulates keyboard connected to port #0 and mouse connected to port #1. Since there is no way to say what's connected to port by checking DTS we hardcode this knowledge in the driver: it assumes keyboard on port #0 and ignores port #1 altogether. Also QEMU defaults emulated keyboard to scan code set 2 while driver used to work with scan code set 1 so when initializing driver make sure keyboard is switched to scan code set 1 Modified: head/sys/arm/versatile/pl050.c Modified: head/sys/arm/versatile/pl050.c ============================================================================== --- head/sys/arm/versatile/pl050.c Sat Apr 1 20:10:08 2017 (r316370) +++ head/sys/arm/versatile/pl050.c Sat Apr 1 20:38:12 2017 (r316371) @@ -106,7 +106,10 @@ __FBSDID("$FreeBSD$"); #define KMI_DRIVER_NAME "kmi" #define KMI_NFKEY (sizeof(fkey_tab)/sizeof(fkey_tab[0])) /* units */ +#define SET_SCANCODE_SET 0xf0 + struct kmi_softc { + device_t sc_dev; keyboard_t sc_kbd; keymap_t sc_keymap; accentmap_t sc_accmap; @@ -142,6 +145,8 @@ static int kmi_ioctl(keyboard_t *, u_lon static int kmi_enable(keyboard_t *); static int kmi_disable(keyboard_t *); +static int kmi_attached = 0; + /* early keyboard probe, not supported */ static int kmi_configure(int flags) @@ -480,7 +485,6 @@ kmi_ioctl(keyboard_t *kbd, u_long cmd, c } } - /* clear the internal state of the keyboard */ static void kmi_clear_state(keyboard_t *kbd) @@ -610,6 +614,17 @@ pl050_kmi_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); + /* + * PL050 is plain PS2 port that pushes bytes to/from computer + * VersatilePB has two such ports and QEMU simulates keyboard + * connected to port #0 and mouse connected to port #1. This + * information can't be obtained from device tree so we just + * hardcode this knowledge here. We attach keyboard driver to + * port #0 and ignore port #1 + */ + if (kmi_attached) + return (ENXIO); + if (ofw_bus_is_compatible(dev, "arm,pl050")) { device_set_desc(dev, "PL050 Keyboard/Mouse Interface"); return (BUS_PROBE_DEFAULT); @@ -625,7 +640,9 @@ pl050_kmi_attach(device_t dev) keyboard_t *kbd; int rid; int i; + uint32_t ack; + sc->sc_dev = dev; kbd = &sc->sc_kbd; rid = 0; @@ -654,6 +671,16 @@ pl050_kmi_attach(device_t dev) /* TODO: clock & divisor */ + pl050_kmi_write_4(sc, KMICR, KMICR_EN); + + pl050_kmi_write_4(sc, KMIDATA, SET_SCANCODE_SET); + /* read out ACK */ + ack = pl050_kmi_read_4(sc, KMIDATA); + /* Set Scan Code set 1 (XT) */ + pl050_kmi_write_4(sc, KMIDATA, 1); + /* read out ACK */ + ack = pl050_kmi_read_4(sc, KMIDATA); + pl050_kmi_write_4(sc, KMICR, KMICR_EN | KMICR_RXINTREN); kbd_init_struct(kbd, KMI_DRIVER_NAME, KB_OTHER, @@ -689,6 +716,7 @@ pl050_kmi_attach(device_t dev) if (bootverbose) { genkbd_diag(kbd, bootverbose); } + kmi_attached = 1; return (0); detach: From owner-svn-src-all@freebsd.org Sat Apr 1 20:51:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 21:06:24 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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-all@freebsd.org Sat Apr 1 21:51:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8EB3D28BAC; Sat, 1 Apr 2017 21:51:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B971DEF9; Sat, 1 Apr 2017 21:51:35 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31LpY6I096986; Sat, 1 Apr 2017 21:51:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31LpYad096985; Sat, 1 Apr 2017 21:51:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704012151.v31LpYad096985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 1 Apr 2017 21:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316374 - head/sys/boot/arm/uboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 21:51:36 -0000 Author: ian Date: Sat Apr 1 21:51:34 2017 New Revision: 316374 URL: https://svnweb.freebsd.org/changeset/base/316374 Log: Preserve the registers containing argc, argv, and return address values passed in from u-boot across the call to self_reloc and any other early-init code, and restore them before calling main(). The self_reloc() routine uses r0 and r1 (and calling it uses lr), and depending on what values get left in them, main() would intermittantly lock up trying to interpret them as argc and argv values. This problem affected the self-relocatable ubldr.bin but not ubldr (the elf version). Modified: head/sys/boot/arm/uboot/start.S Modified: head/sys/boot/arm/uboot/start.S ============================================================================== --- head/sys/boot/arm/uboot/start.S Sat Apr 1 21:06:22 2017 (r316373) +++ head/sys/boot/arm/uboot/start.S Sat Apr 1 21:51:34 2017 (r316374) @@ -45,6 +45,13 @@ _start: orr ip, ip, #(CPU_CONTROL_AFLT_ENABLE) mcr p15, 0, ip, c1, c0, 0 #endif + + /* + * Save r0 and r1 (argc and argv passed from u-boot), and lr (trashed + * by the call to self_reloc below) until we're ready to call main(). + */ + push {r0, r1, lr} + /* * Do self-relocation when the weak external symbol _DYNAMIC is non-NULL. * When linked as a dynamic relocatable file, the linker automatically @@ -71,9 +78,11 @@ _start: str r9, [ip, #4] /* + * First restore argc, argv, and the u-boot return address, then * Start loader. This is basically a tail-recursion call; if main() * returns, it returns to u-boot (which reports the value returned r0). */ + pop {r0, r1, lr} b main /* From owner-svn-src-all@freebsd.org Sat Apr 1 21:54:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: 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 From owner-svn-src-all@freebsd.org Sat Apr 1 21:55:10 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCB98D28CB5; Sat, 1 Apr 2017 21:55:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA682B2; Sat, 1 Apr 2017 21:55:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31Lt9KQ098933; Sat, 1 Apr 2017 21:55:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31Lt97B098932; Sat, 1 Apr 2017 21:55:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201704012155.v31Lt97B098932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 1 Apr 2017 21:55:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316376 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 21:55:11 -0000 Author: manu Date: Sat Apr 1 21:55:09 2017 New Revision: 316376 URL: https://svnweb.freebsd.org/changeset/base/316376 Log: Reduce the diff on beaglebone-black DTS. The HDMI TX (tda19988) is already enabled in upstream DTS so use it directly instead. Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts Modified: head/sys/boot/fdt/dts/arm/beaglebone-black.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/beaglebone-black.dts Sat Apr 1 21:53:58 2017 (r316375) +++ head/sys/boot/fdt/dts/arm/beaglebone-black.dts Sat Apr 1 21:55:09 2017 (r316376) @@ -49,12 +49,6 @@ }; }; -&i2c0 { - tda998x: tda19988 { - status = "okay"; - }; -}; - &i2c1 { pinctrl-names = "default"; pinctrl-0 = <&i2c1_pins>; @@ -77,11 +71,5 @@ }; &lcdc { - hdmi = <&tda998x>; -}; - -/ { - hdmi { - status = "disabled"; - }; + hdmi = <&tda19988>; }; From owner-svn-src-all@freebsd.org Sat Apr 1 22:02:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC6ED28FB7; Sat, 1 Apr 2017 22:02:18 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1220EBBF; Sat, 1 Apr 2017 22:02:17 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from [127.0.0.1] (helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1cuR64-000D5f-Ho; Sat, 01 Apr 2017 15:02:12 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id v31M2B55050322; Sat, 1 Apr 2017 15:02:11 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Sat, 1 Apr 2017 15:02:11 -0700 From: Oleksandr Tymoshenko To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316376 - head/sys/boot/fdt/dts/arm Message-ID: <20170401220211.GA50292@bluezbox.com> References: <201704012155.v31Lt97B098932@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704012155.v31Lt97B098932@repo.freebsd.org> X-Operating-System: FreeBSD/11.0-RELEASE-p2 (amd64) User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Emmanuel Vadot (manu@FreeBSD.org) wrote: > Author: manu > Date: Sat Apr 1 21:55:09 2017 > New Revision: 316376 > URL: https://svnweb.freebsd.org/changeset/base/316376 > > Log: > Reduce the diff on beaglebone-black DTS. > > The HDMI TX (tda19988) is already enabled in upstream DTS so use it directly > instead. > > Modified: > head/sys/boot/fdt/dts/arm/beaglebone-black.dts [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 22:02:18 -0000 Emmanuel Vadot (manu@FreeBSD.org) wrote: > Author: manu > Date: Sat Apr 1 21:55:09 2017 > New Revision: 316376 > URL: https://svnweb.freebsd.org/changeset/base/316376 > > Log: > Reduce the diff on beaglebone-black DTS. > > The HDMI TX (tda19988) is already enabled in upstream DTS so use it directly > instead. > > Modified: > head/sys/boot/fdt/dts/arm/beaglebone-black.dts BBB switched to using upstream DTS. I don't think sys/boot/fdt/dts/arm/beaglebone* files are used anywhere. -- gonzo From owner-svn-src-all@freebsd.org Sat Apr 1 22:03:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B12C8D2904C; Sat, 1 Apr 2017 22:03:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 819DFD61; Sat, 1 Apr 2017 22:03:01 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v31M30o6002885; Sat, 1 Apr 2017 22:03:00 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31M30eJ002884; Sat, 1 Apr 2017 22:03:00 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704012203.v31M30eJ002884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 1 Apr 2017 22:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316377 - head/sys/boot/uboot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 22:03:01 -0000 Author: ian Date: Sat Apr 1 22:03:00 2017 New Revision: 316377 URL: https://svnweb.freebsd.org/changeset/base/316377 Log: Correct a comment... the stack used by ubldr is the same stack u-boot was running on when it jumped to the ubldr entry point. None of the arches that use this code set up a different stack in their start.S routines. Modified: head/sys/boot/uboot/common/main.c Modified: head/sys/boot/uboot/common/main.c ============================================================================== --- head/sys/boot/uboot/common/main.c Sat Apr 1 21:55:09 2017 (r316376) +++ head/sys/boot/uboot/common/main.c Sat Apr 1 22:03:00 2017 (r316377) @@ -416,7 +416,9 @@ main(int argc, char **argv) /* * Initialise the heap as early as possible. Once this is done, - * alloc() is usable. The stack is buried inside us, so this is safe. + * alloc() is usable. We are using the stack u-boot set up near the top + * of physical ram; hopefully there is sufficient space between the end + * of our bss and the bottom of the u-boot stack to avoid overlap. */ uboot_heap_start = round_page((uintptr_t)end); uboot_heap_end = uboot_heap_start + 512 * 1024; From owner-svn-src-all@freebsd.org Sat Apr 1 22:06:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1773D2913F; Sat, 1 Apr 2017 22:06:43 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 968D1D2; Sat, 1 Apr 2017 22:06:41 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id ffbbc4a9; Sun, 2 Apr 2017 00:06:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=PVS4/lT33h2bO4Ys5F6LvK3kNyA=; b=ZI5p5b73KJ7HcYhU2VySDW/EM+hx ieXBL2OAQzG1UEcmvQ2h2l/qmfRZawrUS6dDBbb8ooP53S+G3ah38IP7k3GLeSid Mvo6qmKS6aYUuQMAk1G7y32mVGPrHftLT/keJdEcUeaQO44/JuDQ4PV7n89Y+A8m xUd/c7aIBPJ7yvo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=r4YSQF3MYo9hhM8/yef2D2Fc12WH5zU8ySOqqTJHYFqqmYrSDxdbAOeH EjCqztrW7dnbnP4VZOpgnLOSjxlPh64hBmxf3IvxB8p64cTkPwqswh9btUogGkjC oH0VX7lv4Z9fDf3f1qPDt23HTyxGVJfMSo58B1szUQFIkA3mYF0= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id e56d8ba4 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sun, 2 Apr 2017 00:06:32 +0200 (CEST) Date: Sun, 2 Apr 2017 00:06:29 +0200 From: Emmanuel Vadot To: Oleksandr Tymoshenko Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316376 - head/sys/boot/fdt/dts/arm Message-Id: <20170402000629.4a9d884fddd6a0841b8f1ef8@bidouilliste.com> In-Reply-To: <20170401220211.GA50292@bluezbox.com> References: <201704012155.v31Lt97B098932@repo.freebsd.org> <20170401220211.GA50292@bluezbox.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 22:06:43 -0000 On Sat, 1 Apr 2017 15:02:11 -0700 Oleksandr Tymoshenko wrote: > Emmanuel Vadot (manu@FreeBSD.org) wrote: > > Author: manu > > Date: Sat Apr 1 21:55:09 2017 > > New Revision: 316376 > > URL: https://svnweb.freebsd.org/changeset/base/316376 > > > > Log: > > Reduce the diff on beaglebone-black DTS. > > > > The HDMI TX (tda19988) is already enabled in upstream DTS so use it directly > > instead. > > > > Modified: > > head/sys/boot/fdt/dts/arm/beaglebone-black.dts > > BBB switched to using upstream DTS. I don't think > sys/boot/fdt/dts/arm/beaglebone* files are used anywhere. > > -- > gonzo True, this was just in case people still uses this dts but I guess that it will be better to remove it just to be sure. -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Sat Apr 1 22:29:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 763A0D297D3; Sat, 1 Apr 2017 22:29:12 +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 482BE31; Sat, 1 Apr 2017 22:29:12 +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 v31MTBLb012690; Sat, 1 Apr 2017 22:29:11 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31MTBDU012688; Sat, 1 Apr 2017 22:29:11 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201704012229.v31MTBDU012688@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 22:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316378 - head/sys/powerpc/mpc85xx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 22:29:12 -0000 Author: jhibbits Date: Sat Apr 1 22:29:11 2017 New Revision: 316378 URL: https://svnweb.freebsd.org/changeset/base/316378 Log: Add a helper function to get system reference clock Many devices are clocked from the SoC's platform clock / 2. Some device nodes include their own clock-frequency property, while others are dependent on the SoC's bus-frequency property instead. To simplify, add a helper function to get this clock. Modified: head/sys/powerpc/mpc85xx/mpc85xx.c head/sys/powerpc/mpc85xx/mpc85xx.h Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Sat Apr 1 22:03:00 2017 (r316377) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Sat Apr 1 22:29:11 2017 (r316378) @@ -436,3 +436,18 @@ mpc85xx_fix_errata(vm_offset_t va_ccsr) err: return; } + +uint32_t +mpc85xx_get_system_clock(void) +{ + phandle_t soc; + uint32_t freq; + + soc = OF_finddevice("/soc"); + freq = 0; + + /* freq isn't modified on error. */ + OF_getencprop(soc, "bus-frequency", (void *)&freq, sizeof(freq)); + + return (freq / 2); +} Modified: head/sys/powerpc/mpc85xx/mpc85xx.h ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.h Sat Apr 1 22:03:00 2017 (r316377) +++ head/sys/powerpc/mpc85xx/mpc85xx.h Sat Apr 1 22:29:11 2017 (r316378) @@ -171,5 +171,6 @@ void mpc85xx_enable_l3_cache(void); void mpc85xx_fix_errata(vm_offset_t); void dataloss_erratum_access(vm_offset_t, uint32_t); int mpc85xx_is_qoriq(void); +uint32_t mpc85xx_get_system_clock(void); #endif /* _MPC85XX_H_ */ From owner-svn-src-all@freebsd.org Sat Apr 1 22:35:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 284F1D29A53; Sat, 1 Apr 2017 22:35:05 +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 EE55B768; Sat, 1 Apr 2017 22:35:04 +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 v31MZ4mB016766; Sat, 1 Apr 2017 22:35:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v31MZ4nM016765; Sat, 1 Apr 2017 22:35:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201704012235.v31MZ4nM016765@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 22:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316379 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Apr 2017 22:35:05 -0000 Author: jhibbits Date: Sat Apr 1 22:35:03 2017 New Revision: 316379 URL: https://svnweb.freebsd.org/changeset/base/316379 Log: Use the newly added mpc85xx_get_system_clock() Simplify the platform clock acquisition by using the new helper function. Modified: head/sys/dev/sdhci/fsl_sdhci.c Modified: head/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Sat Apr 1 22:29:11 2017 (r316378) +++ head/sys/dev/sdhci/fsl_sdhci.c Sat Apr 1 22:35:03 2017 (r316379) @@ -58,6 +58,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef __powerpc__ +#include +#endif + #include #include @@ -767,7 +771,6 @@ fsl_sdhci_get_card_present(device_t dev, static uint32_t fsl_sdhci_get_platform_clock(device_t dev) { - device_t parent; phandle_t node; uint32_t clock; @@ -777,23 +780,14 @@ fsl_sdhci_get_platform_clock(device_t de if((OF_getprop(node, "clock-frequency", (void *)&clock, sizeof(clock)) <= 0) || (clock == 0)) { - /* - * Trying to get clock from parent device (soc) if correct - * clock cannot be acquired from sdhci node. - */ - parent = device_get_parent(dev); - node = ofw_bus_get_node(parent); + clock = mpc85xx_get_system_clock(); - /* Get soc properties */ - if ((OF_getprop(node, "bus-frequency", (void *)&clock, - sizeof(clock)) <= 0) || (clock == 0)) { + if (clock == 0) { device_printf(dev,"Cannot acquire correct sdhci " "frequency from DTS.\n"); return (0); } - /* eSDHC clock is 1/2 platform clock. */ - clock /= 2; } if (bootverbose)