From owner-svn-src-head@freebsd.org Sun Mar 26 00:40:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 08:30:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 08:36:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 08:36:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 09:10:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 09:41:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 10:31:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 13:03:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 14:09:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 14:31:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 14:37:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 14:43:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 16:46:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 17:22:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 17:59:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 18:06:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 18:46:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 19:47:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 20:15:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 20:24:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 20:36:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 21:00:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 21:14:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sun Mar 26 23:08:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 03:11:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 04:11:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 06:37:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 07:02:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 07:04:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 07:06:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 07:56:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 08:18:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 08:29:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 08:31:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 09:45:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 10:38:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 10:48:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 11:04:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 11:05:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 12:30:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 12:34:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 13:27:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 13:37:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 14:32:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 14:37:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 14:55:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 15:08:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 15:20:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 15:37:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 16:01:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 16:18:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 16:25:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:04:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:09:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:18:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:24:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:24:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:27:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 17:40:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E727ED20A48 for ; Mon, 27 Mar 2017 17:40:04 +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 A54177E0 for ; Mon, 27 Mar 2017 17:40:04 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22a.google.com with SMTP id y18so83554690itc.0 for ; Mon, 27 Mar 2017 10:40:04 -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=ZbZHYmrYePD/yExNgPix2hU8Is0BNFkW5xf9OvKbcVQnDTgE3JZcq2HcigH/q+W4Fq wQh3jt8lRxk8gVqDfjPIfdQPKupxYe6DAkWG1fH3kG5ZIVjN9dwpUu3NURbxHdIZIfx3 e44aduBlTGpIs5bm66pgQePUQQhhQuwp2lEE2LJlCWZszEpaoUcV6/gXgFdx89B+/1rj IM0+QNOCIM58ZueVIQ6tsFdF3PYpWiSUtfe8D7TfRWEC8fd8f/VXYZdxt0rT/9q4A6CB MD1bRNUMxRkhLB4AgQxuQeL9c6BR3EPd1PkWu48wGKA82j1sdRCB2uf67hTr0nvohWUW Sx0g== X-Gm-Message-State: AFeK/H330PoZrFUV8IzvNR/rWKNXJ9DiPPKPO/VQupfmBB8Es9E5HZvhkNEWGCHEc8m2HuUfBVxIgj/GxxpGiw== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Mar 2017 17:40:05 -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-head@freebsd.org Mon Mar 27 18:20:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 18:40:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 18:59:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 19:01:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 19:06:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 19:17:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 19:26:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 19:42:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 20:24:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 20:28:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 20:32:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 21:00:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 21:02:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 22:00:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 22:34:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 22:53:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Mon Mar 27 23:48:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 00:39:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 00:57:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 05:53:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 06:19:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 06:39:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 07:01:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 07:10:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 07:58:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 08:03:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 347ADD1B517 for ; Tue, 28 Mar 2017 08:03:26 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1552837 for ; Tue, 28 Mar 2017 08:03:25 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id y18so103364086itc.0 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=QVHdJArVbKXg6zDt5evc0w2mTIc6CN9vuvUSzobqIF7l07mb1CuXalmmMtYQYRC4p3 Qp2rJdHj1Tbl6ay83cQBjsZ2zyvSYUUpMdWXO4FJWLkqaqdZ20qyP1fVRADIaEATyx7h ajJkbDSHYQMrfn8oR3gz/c5aeqnVwoYEc37y/MvMO7k+fdzdzVvxACMGqk52fscWiUBT Yqul3g5MoP+we2chkSWF0ZCR9WTp70lq9HDHHYqAQ2tkyJgqOygin+3TuZxCZlWv+sOp nPGva0jdlX6PZ++lyi/76UeKiHVG1XVqxP8EsZl1yF+Xsj67p1aD+JatO8hcfWJQX5eM cfVg== X-Gm-Message-State: AFeK/H3CLAh7CqZYuCKshy91hQ6UPa4jX5EFpImaaxyTqyvUTak7ZKVo7Hfo+uklUhSUG4/lbR+ulE919oe6ig== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 08:19:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 08:24:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 08:54:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 09:02:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 10:20:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 10:26:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 10:39:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 10:53:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 15:55:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 16:07:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 16:35:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 17:37:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 17:48:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 17:49:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 18:09:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 18:20:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 18:42:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 19:01:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 19:02:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 19:48:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 20:22:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 20:26:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 20:30:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 20:34:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 20:39:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 20:53:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:11:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:16:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:35:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:39:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:47:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:50:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 21:54:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 22:31:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 22:32:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 22:40:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 23:02:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 23:39:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Tue Mar 28 23:56:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 03:36:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 08:39:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 08:55:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 09:30:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 10:24:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 14:46:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 15:28:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 15:45:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 18:19:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ACA2D245E2 for ; Wed, 29 Mar 2017 18:19:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3766E2E8C for ; Wed, 29 Mar 2017 18:19:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id y18so63394814itc.1 for ; Wed, 29 Mar 2017 11:19:13 -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=PMEtI8tDBvk7y6el/ZwSItgKsn2qz80J1muJLz1/emRnEIFiTYin+SZImoL3oXy6x5 1RcLwE6FlEYp0BV76yiiNZnVjIT14Q9SNcHeulstezXYABlN2jnw9QQ7EtqiH2QPCy6f /cm3aw7HWg9fLmvj6fVRam1RaAqyvp3m4qS0XgyswQ9NWwQdRDyuxEGzH8c0HakCnjq2 2YJUfkQydOcoooKoZW3PZN87vllAA6QzqrDNTRNvNqiT/sXDa9wQty2CGN437jAo4tdl t2EDjT1MI8YpMUit7noVA/sDJKYnfbSmLyvKC7LC7eyT2eYQaWmoUa/n327fgW9Hq+0X 7/bw== X-Gm-Message-State: AFeK/H3bT2UBU/OgtvdoWjACInR58KUW4LwXfMN7ePo0KUYY9ty+5RuuU2j8el92/l4Te2dlwG5S0X12odmTSA== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 18:19:13 -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-head@freebsd.org Wed Mar 29 18:35:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 19:25:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 19:30:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 19:30:24 -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-head@freebsd.org Wed Mar 29 19:35:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 19:39:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 19:59:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 20:49:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:04:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:27:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:29:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:29:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:31:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:36:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 21:55:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5771ED24469 for ; Wed, 29 Mar 2017 21:55:50 +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 163CA7D4 for ; Wed, 29 Mar 2017 21:55:50 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id e75so102247419itd.1 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=edhLWvLSKTYBtP9RvkGcVs2B4VBTSmz755C1SkRibJqvr02Q6RNkSU4+xMsUWNETR2 Tl0K6Is5CjT1V3T66YZrycyMlz06J0QU3X3HXzd0PPJRDQeEr8Kl+tDjlg9Vy88TZ59Y xhpcAgkjWxTOlC6fnjNuPa/YGJMcLg38yLPln1ZpgCpKrLJC+MatvFuVSz5xICoE82+G yuzXWncsHfVBqeqXy7LxNsfIROW1CzA0glCpnqXJcn4qHywGbCYGgIGT3JtsJNM8O34t MNX5ozjN3jz6iwy40bprhsGROHo4ANv5sVeiHJWIZB/j3/S/EYWVL9ApCnuwBY/msn3X hbwg== X-Gm-Message-State: AFeK/H2vbFS8MHBxVdCpt/Ueb0EKhjILrAuRYaSOlmq5e0DDAP+rXMALzyAE1utvhtONiTBm24Z2K0cnJl/9Zw== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 22:13:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 22:14:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 22:33:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 23:00:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 23:13:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Wed Mar 29 23:31:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 01:03:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 01:04:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 01:24:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C77DD23622 for ; Thu, 30 Mar 2017 01:24:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::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 5344BF65 for ; Thu, 30 Mar 2017 01:24:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id 68so1561222ioh.3 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=BrUA/PcyyQPfySVDC3d0D+rBJ3Qk3YtS66xAOiVX3t6XZT/9eFoxeXv6UMUhYfIXJa miyfFqx8Wa59LE5MN9DIcYYhYxMjk1ovPoMBqJMqit1rc3fRKAyvmLcLjdSFaMuhm1JL 8SDsl+27N41q9y0PI9IZlxHt+U4egGJcbw6jwyz7No1blURDwHqw3Qidcd7AsCAf30zn ZYjWQtjr2jKqcNnA6lkaA3NoXP1AOkcz2N0+L1xqFH3YzyFr3PcEE+1gVbhIlRn/j3Ij g223wheMzCYwMN2g+Zj3COLenkXIvhHuVepep4R9QsqcrS/bVHPSOz2czOmXb/5YVVgL xWeg== X-Gm-Message-State: AFeK/H3UuHP8EFdHe6OQf4S37H0/uv01UUM1S2XApSrPZYZJWmB9vOT6GRVdQmnLtaqqoHdKkCB4rkjri1NTAA== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 02:34:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 03:49:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 04:21:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 04:56:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 04:57:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 05:00:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 05:11:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 05:19:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7ECD25705 for ; Thu, 30 Mar 2017 05:19:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x231.google.com (mail-it0-x231.google.com [IPv6:2607:f8b0:4001:c0b::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D6D9C02 for ; Thu, 30 Mar 2017 05:19:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x231.google.com with SMTP id y18so70490703itc.1 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=n+S/llES7KFNhr9sonfF+4SqtYEgyjEoVdJ42T3KYLxs8EEc3xdELSKnKpgF+t1WXK /2BtzYQkBest3ZyCpTCeZUr2+tkGsA9Lnm0YyumbeyHWq29krJvuZKE+AWYhjuv0cC9j 76EDcKtGswrZP9r08dJLYdOpTdUNatGcJj7OFfuB0iZnlgRELGaykG4Y57YRTPRTOhqN AP93avAc9SjUgSsUeoid4pCW84r2TPj7hkga7M1CFiVZJqOriHivZtmXVHAkk7CZr0RP 1nrBSg2aEkygyVzwtixYuizJU0ioXXgexFiYqMpRd4gjWCQoPtlpjgxtdQ6rnAWtRnsa w+wQ== X-Gm-Message-State: AFeK/H1iSuEyOFTVcrj1p96Y5N/N9uIXjfDZGSoGObusgRC95OCUSYWsxxR+NMj2w1zqKFg0at7HYuNDIil12g== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 05:51:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4C7AD255FB 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 6F562F98 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:23:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:24:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:34:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:38:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FDE8D25D15 for ; Thu, 30 Mar 2017 06:38:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::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 25D107BB for ; Thu, 30 Mar 2017 06:38:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id z13so13221390iof.2 for ; Wed, 29 Mar 2017 23:38:49 -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=QRAdaegTFsHmgZeWFo31uzhGsbOu2hXmU2LvczoN0aysC+N7WAXYZFbgBDDQvAdewd 6SrEOsVqPdvy84aJBB0jfv+leXsnihdkfHg/0ce6Uk3Fyv+1v6ladExvpb7miJSsFYWn /TBpFq9VzzAsvVl4cxEkk4+BO18FQ/QR4oTAQsrS2TP0SqLNPuRXFDvatP1j65pM5oEr wrk4rRi2oCvKfVTdBs8VIH5zesZaVrLAWRaM7gh23s3PiT+fCthHOH0hG5+tpsyGdz/7 2BQv1Itu7xdeqittOptTr8rnwQuYxW9+LMrw9VBARPbtOE3UByx+dlz+5CXUczX81Cgk zxzA== X-Gm-Message-State: AFeK/H0ItmoxbgWJMy2zstGjLy2QfXe4dGe8WJrA7SfYuotqIx/oTBzIBnHxYZ+5dmoKBrnlzFNcqI3VzNfCRw== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:39:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:42:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:44:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 06:47:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F9D8D25118 for ; Thu, 30 Mar 2017 06:47:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::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 5300D169 for ; Thu, 30 Mar 2017 06:47:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id 68so2058558ioh.3 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=qGIwq3wvWYbFCl5KNdTpYNxy1pgw/JYiuNW/0JOorAYIDmiuDL8z+WHWllT/oNDHeS 7eEdSeSeSeROFd0vGBt8E+YKearf1mq4vbMgvx8XeSOWmyQRG+OG2nOhnqC1G9ALLOJ6 c3qsTwmEoWWzFXSSb2MqETZ5Bx9X+D/tr0vik1dKHC5s9MYGnzdsyOi/sSoxR5vDUdEw tAO4SCTrAG5a3A2jTlWTNk+gBC5pXSFwOE+gEM7Hl3H268pxEVEZ4C6Gj6Iy4AhgLMDZ HweaGs3ob7yOD4F0aK9rxL91JItYWeH2fjCrc2xma2bOJ6EstgB82RdBhrXMbhuSB0oW aobg== X-Gm-Message-State: AFeK/H3UybU4ra/S6/GhLj29eLvLZYqoUOZVGtapC2cX42GJzILtHwmkxVFAo7v1dUUK4IFwMuNsIxyc1qeK4w== 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 07:13:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 07:37:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 07:53:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 08:22:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 09:02:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 12:35:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 15:05:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 16:03:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 16:23:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 16:31:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 16:54:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 17:31:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 17:37:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 18:20:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 18:21:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 18:33:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 19:32:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 19:42:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 19:45:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 20:42:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 21:39:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 21:54:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 22:00:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 22:27:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 22:44:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 23:02:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 23:07:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 23:11:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 23:39:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Thu Mar 30 23:49:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 00:04:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 00:08:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 00:41:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 03:08:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 09:10:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 09:26:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 13:43:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 14:13:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 14:17:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 15:17:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93D1DD27728 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 31DFBF65 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 15:27:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51591D27949 for ; Fri, 31 Mar 2017 15:27:16 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E1A448BF for ; Fri, 31 Mar 2017 15:27:15 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x233.google.com with SMTP id w204so353859wmd.1 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=qQRpQxzOA35CldEeBGI0n6GhNiD8KFHb/UPa+LDHLdshGj+8uWN+QvUJrgV7l1blzr gtBufW6nVgn5Aw7jOFsQAq8hwRb3YJtfwhysPJQ+zWwO9qebyn62ZdmjBIQsKaM2Id7Q QFtL6UKbBn0p4PXLfUFDylzSg+H4WtC/xi0I534/fmLdSTM7+1PQKtJXL+ggqO7XZH+e z1JOxg1rjyaiSfcgd64bsjqQgHZ6msmWiOeukFcArHMRXQ2X4XL0veSW7g/GV4t1XH6y aLCjgD2eTdnHR5eu1OcsUbh4mL7IEo1H9lnt4h3Tu4nzD3eT8N9k+JMjBaAHZc5P+wpO DmXQ== X-Gm-Message-State: AFeK/H3cIAQk4sUbQZ0jmcHvKLvv/eR+vv/E9HdkNvRtmZSyD092d186htOTLsrrg0HYRGOt 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 15:33:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F528D27BE7 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 42602D4C 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 16:04:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67062D2754B 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 2156087A 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 BF4C420230F4 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 B332D280A38 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 rVqLuXvyN-iq 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 18:04:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 18:45:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 19:12:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 21:29:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Fri Mar 31 22:05:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 01:00:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 04:42:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 05:05:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 05:31:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 05:49:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 07:44:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 12:22:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 15:01:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 15:04:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 19:08:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 20:10:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 20:38:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 21:51:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 21:55:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 22:02:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 22:03:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 22:06:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 22:29:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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-head@freebsd.org Sat Apr 1 22:35:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current 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)