From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 00:08:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6876710B; Sun, 20 Jul 2014 00:08:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 558B92BF1; Sun, 20 Jul 2014 00:08:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K08pOZ064212; Sun, 20 Jul 2014 00:08:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K08pZV064211; Sun, 20 Jul 2014 00:08:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201407200008.s6K08pZV064211@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 20 Jul 2014 00:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268898 - head/sys/powerpc/ps3 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.18 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, 20 Jul 2014 00:08:51 -0000 Author: nwhitehorn Date: Sun Jul 20 00:08:50 2014 New Revision: 268898 URL: http://svnweb.freebsd.org/changeset/base/268898 Log: Fix allocation of 128MB extended memory region, broken since some careless modifications in December. MFC after: 3 days Modified: head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Sat Jul 19 23:57:36 2014 (r268897) +++ head/sys/powerpc/ps3/platform_ps3.c Sun Jul 20 00:08:50 2014 (r268898) @@ -110,14 +110,6 @@ ps3_probe(platform_t plat) static int ps3_attach(platform_t plat) { - uint64_t junk; - int count; - struct mem_region avail_regions[2]; - - ps3_mem_regions(plat, NULL, NULL, avail_regions, &count); - - lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */, - 0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk); pmap_mmu_install("mmu_ps3", BUS_PROBE_SPECIFIC); cpu_idle_hook = ps3_cpu_idle; @@ -152,6 +144,11 @@ ps3_mem_regions(platform_t plat, struct /* Convert to maximum amount we can allocate in 16 MB pages */ avail_regions[1].mr_size -= avail_regions[0].mr_size; avail_regions[1].mr_size -= avail_regions[1].mr_size % (16*1024*1024); + + /* Allocate extended memory region */ + lv1_allocate_memory(avail_regions[1].mr_size, 24 /* 16 MB pages */, + 0, 0x04 /* any address */, &avail_regions[1].mr_start, &junk); + *availsz = 2; if (phys != NULL) { From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 04:11:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB549C8D; Sun, 20 Jul 2014 04:11:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A91022D2A; Sun, 20 Jul 2014 04:11:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K4BICp084818; Sun, 20 Jul 2014 04:11:18 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K4BI3u084817; Sun, 20 Jul 2014 04:11:18 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200411.s6K4BI3u084817@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 04:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268907 - head/sys/dev/ixgbe 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.18 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, 20 Jul 2014 04:11:18 -0000 Author: adrian Date: Sun Jul 20 04:11:18 2014 New Revision: 268907 URL: http://svnweb.freebsd.org/changeset/base/268907 Log: Correctly program the RSS redirection table entries. Without this, the RSS bucket assignments aren't correct - they're DCBA instead of ABCD in each DWORD. Tested: 82599EB ixgbe(4), TCP and UDP RSS Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 02:38:58 2014 (r268906) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 04:11:18 2014 (r268907) @@ -4230,10 +4230,16 @@ ixgbe_initialise_rss_mapping(struct adap #else queue_id = (j * 0x11); #endif - /* XXX endian? */ - reta = (reta << 8) | queue_id; - if ((i & 3) == 3) + /* + * The low 8 bits are for hash value (n+0); + * The next 8 bits are for hash value (n+1), etc. + */ + reta = reta >> 8; + reta = reta | ( ((uint32_t) queue_id) << 24); + if ((i & 3) == 3) { IXGBE_WRITE_REG(hw, IXGBE_RETA(i >> 2), reta); + reta = 0; + } } /* Now fill our hash function seeds */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 06:30:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BEF5F28; Sun, 20 Jul 2014 06:30:47 +0000 (UTC) Received: from mail-qc0-x22b.google.com (mail-qc0-x22b.google.com [IPv6:2607:f8b0:400d:c01::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8BEB26D5; Sun, 20 Jul 2014 06:30:46 +0000 (UTC) Received: by mail-qc0-f171.google.com with SMTP id i17so4623219qcy.2 for ; Sat, 19 Jul 2014 23:30:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=UzKHSALb5RAsA6XJFmv42EppQtYKy0W447Z/2El7Zvw=; b=HwCCSebgqXzz7CJZmso7GceL9M+yl1DlYYex/kh8jL9dB6htVdcRWD0d5Rsrpbd2+P 0IFejwYxV0PHxe5vqbYx4iTlFNUaQP6GZwFk6O6fWPpn1rExzV6XA3J9xZr5pU/RQDqK gtudEophyLZUo0AMEHwC363CZpjahmClTzHc+q1IHUaPJK9pGLwEbvMkj9y01drgGg5s aJ0+mLPCtI053KzHh5gTbcqxhpB9qeVFb7ILakT9D1kS12Pv/bErPUy2ztiNeHlqplLf iVTqP8HhLEk8RI0i5FCHW+izFYNsD2JL3W/ir5HeDV6vf1YoZTVHeKCCz3P1DQdS0vSf x5og== MIME-Version: 1.0 X-Received: by 10.224.71.198 with SMTP id i6mr27194791qaj.76.1405837845600; Sat, 19 Jul 2014 23:30:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sat, 19 Jul 2014 23:30:45 -0700 (PDT) In-Reply-To: <201407192059.s6JKx8un072543@svn.freebsd.org> References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sat, 19 Jul 2014 23:30:45 -0700 X-Google-Sender-Auth: QXZuCMbAHfRxwibbkylEwGh2DJU Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Adrian Chadd To: Neel Natu Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 06:30:47 -0000 Hi! This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer initialised before use /and/ it's part of a KASSERT() output. Thanks! -a On 19 July 2014 13:59, Neel Natu wrote: > Author: neel > Date: Sat Jul 19 20:59:08 2014 > New Revision: 268889 > URL: http://svnweb.freebsd.org/changeset/base/268889 > > Log: > Handle nested exceptions in bhyve. > > A nested exception condition arises when a second exception is triggered while > delivering the first exception. Most nested exceptions can be handled serially > but some are converted into a double fault. If an exception is generated during > delivery of a double fault then the virtual machine shuts down as a result of > a triple fault. > > vm_exit_intinfo() is used to record that a VM-exit happened while an event was > being delivered through the IDT. If an exception is triggered while handling > the VM-exit it will be treated like a nested exception. > > vm_entry_intinfo() is used by processor-specific code to get the event to be > injected into the guest on the next VM-entry. This function is responsible for > deciding the disposition of nested exceptions. > > Modified: > head/lib/libvmmapi/vmmapi.c > head/lib/libvmmapi/vmmapi.h > head/sys/amd64/include/vmm.h > head/sys/amd64/include/vmm_dev.h > head/sys/amd64/vmm/intel/vmx.c > head/sys/amd64/vmm/vmm.c > head/sys/amd64/vmm/vmm_dev.c > head/usr.sbin/bhyve/bhyverun.c > head/usr.sbin/bhyve/task_switch.c > head/usr.sbin/bhyvectl/bhyvectl.c > > Modified: head/lib/libvmmapi/vmmapi.c > ============================================================================== > --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v > error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); > return (error); > } > + > +int > +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) > +{ > + struct vm_intinfo vmii; > + int error; > + > + bzero(&vmii, sizeof(struct vm_intinfo)); > + vmii.vcpuid = vcpu; > + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); > + if (error == 0) { > + *info1 = vmii.info1; > + *info2 = vmii.info2; > + } > + return (error); > +} > + > +int > +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) > +{ > + struct vm_intinfo vmii; > + int error; > + > + bzero(&vmii, sizeof(struct vm_intinfo)); > + vmii.vcpuid = vcpu; > + vmii.info1 = info1; > + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); > + return (error); > +} > > Modified: head/lib/libvmmapi/vmmapi.h > ============================================================================== > --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) > +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) > @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c > int func, int idx, uint64_t addr, uint64_t msg, > uint32_t vector_control); > > +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); > +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); > + > /* > * Return a pointer to the statistics buffer. Note that this is not MT-safe. > */ > > Modified: head/sys/amd64/include/vmm.h > ============================================================================== > --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) > @@ -34,6 +34,7 @@ enum vm_suspend_how { > VM_SUSPEND_RESET, > VM_SUSPEND_POWEROFF, > VM_SUSPEND_HALT, > + VM_SUSPEND_TRIPLEFAULT, > VM_SUSPEND_LAST > }; > > @@ -88,6 +89,16 @@ enum x2apic_state { > X2APIC_STATE_LAST > }; > > +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) > +#define VM_INTINFO_DEL_ERRCODE 0x800 > +#define VM_INTINFO_RSVD 0x7ffff000 > +#define VM_INTINFO_VALID 0x80000000 > +#define VM_INTINFO_TYPE 0x700 > +#define VM_INTINFO_HWINTR (0 << 8) > +#define VM_INTINFO_NMI (2 << 8) > +#define VM_INTINFO_HWEXCEPTION (3 << 8) > +#define VM_INTINFO_SWINTR (4 << 8) > + > #ifdef _KERNEL > > #define VM_MAX_NAMELEN 32 > @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); > int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); > > /* > - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an > - * exception is pending and also updates 'vme'. The pending exception is > - * cleared when this function returns. > + * This function is called after a VM-exit that occurred during exception or > + * interrupt delivery through the IDT. The format of 'intinfo' is described > + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. > * > - * This function should only be called in the context of the thread that is > - * executing this vcpu. > + * If a VM-exit handler completes the event delivery successfully then it > + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., > + * if the task switch emulation is triggered via a task gate then it should > + * call this function with 'intinfo=0' to indicate that the external event > + * is not pending anymore. > + * > + * Return value is 0 on success and non-zero on failure. > */ > -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); > +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); > + > +/* > + * This function is called before every VM-entry to retrieve a pending > + * event that should be injected into the guest. This function combines > + * nested events into a double or triple fault. > + * > + * Returns 0 if there are no events that need to be injected into the guest > + * and non-zero otherwise. > + */ > +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); > + > +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); > > void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ > void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ > > Modified: head/sys/amd64/include/vmm_dev.h > ============================================================================== > --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) > @@ -189,6 +189,12 @@ struct vm_cpuset { > #define VM_ACTIVE_CPUS 0 > #define VM_SUSPENDED_CPUS 1 > > +struct vm_intinfo { > + int vcpuid; > + uint64_t info1; > + uint64_t info2; > +}; > + > enum { > /* general routines */ > IOCNUM_ABIVERS = 0, > @@ -211,6 +217,8 @@ enum { > IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, > > /* interrupt injection */ > + IOCNUM_GET_INTINFO = 28, > + IOCNUM_SET_INTINFO = 29, > IOCNUM_INJECT_EXCEPTION = 30, > IOCNUM_LAPIC_IRQ = 31, > IOCNUM_INJECT_NMI = 32, > @@ -324,4 +332,8 @@ enum { > _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) > #define VM_GET_CPUS \ > _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) > +#define VM_SET_INTINFO \ > + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) > +#define VM_GET_INTINFO \ > + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) > #endif > > Modified: head/sys/amd64/vmm/intel/vmx.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i > { > struct vm_exception exc; > int vector, need_nmi_exiting, extint_pending; > - uint64_t rflags; > + uint64_t rflags, entryinfo; > uint32_t gi, info; > > - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { > - KASSERT(exc.vector >= 0 && exc.vector < 32, > - ("%s: invalid exception vector %d", __func__, exc.vector)); > + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { > + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " > + "intinfo is not valid: %#lx", __func__, entryinfo)); > > info = vmcs_read(VMCS_ENTRY_INTR_INFO); > KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " > "pending exception %d: %#x", __func__, exc.vector, info)); > > - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; > - if (exc.error_code_valid) { > - info |= VMCS_INTR_DEL_ERRCODE; > - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); > + info = entryinfo; > + vector = info & 0xff; > + if (vector == IDT_BP || vector == IDT_OF) { > + /* > + * VT-x requires #BP and #OF to be injected as software > + * exceptions. > + */ > + info &= ~VMCS_INTR_T_MASK; > + info |= VMCS_INTR_T_SWEXCEPTION; > } > + > + if (info & VMCS_INTR_DEL_ERRCODE) > + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); > + > vmcs_write(VMCS_ENTRY_INTR_INFO, info); > } > > @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, > vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); > } > > +static void > +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) > +{ > + uint32_t gi; > + > + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); > + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, > + ("NMI blocking is not in effect %#x", gi)); > +} > + > static int > vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) > { > @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc > struct vm_task_switch *ts; > uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; > uint32_t intr_type, reason; > - uint64_t qual, gpa; > + uint64_t exitintinfo, qual, gpa; > bool retu; > > CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); > @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc > * be handled specially by re-injecting the event if the IDT > * vectoring information field's valid bit is set. > * > - * If the VM-exit is due to a task gate in the IDT then we don't > - * reinject the event because emulating the task switch also > - * completes the event delivery. > - * > * See "Information for VM Exits During Event Delivery" in Intel SDM > * for details. > */ > - switch (reason) { > - case EXIT_REASON_EPT_FAULT: > - case EXIT_REASON_EPT_MISCONFIG: > - case EXIT_REASON_APIC_ACCESS: > - case EXIT_REASON_TASK_SWITCH: > - case EXIT_REASON_EXCEPTION: > - idtvec_info = vmcs_idt_vectoring_info(); > - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", > - exit_reason_to_str(reason), idtvec_info); > - if ((idtvec_info & VMCS_IDT_VEC_VALID) && > - (reason != EXIT_REASON_TASK_SWITCH)) { > - idtvec_info &= ~(1 << 12); /* clear undefined bit */ > - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); > - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { > - idtvec_err = vmcs_idt_vectoring_err(); > - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, > - idtvec_err); > - } > - /* > - * If 'virtual NMIs' are being used and the VM-exit > - * happened while injecting an NMI during the previous > - * VM-entry, then clear "blocking by NMI" in the Guest > - * Interruptibility-state. > - */ > - if ((idtvec_info & VMCS_INTR_T_MASK) == > - VMCS_INTR_T_NMI) { > - vmx_clear_nmi_blocking(vmx, vcpu); > - } > + idtvec_info = vmcs_idt_vectoring_info(); > + if (idtvec_info & VMCS_IDT_VEC_VALID) { > + idtvec_info &= ~(1 << 12); /* clear undefined bit */ > + exitintinfo = idtvec_info; > + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { > + idtvec_err = vmcs_idt_vectoring_err(); > + exitintinfo |= (uint64_t)idtvec_err << 32; > + } > + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); > + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", > + __func__, error)); > + > + /* > + * If 'virtual NMIs' are being used and the VM-exit > + * happened while injecting an NMI during the previous > + * VM-entry, then clear "blocking by NMI" in the > + * Guest Interruptibility-State so the NMI can be > + * reinjected on the subsequent VM-entry. > + * > + * However, if the NMI was being delivered through a task > + * gate, then the new task must start execution with NMIs > + * blocked so don't clear NMI blocking in this case. > + */ > + intr_type = idtvec_info & VMCS_INTR_T_MASK; > + if (intr_type == VMCS_INTR_T_NMI) { > + if (reason != EXIT_REASON_TASK_SWITCH) > + vmx_clear_nmi_blocking(vmx, vcpu); > + else > + vmx_assert_nmi_blocking(vmx, vcpu); > + } > + > + /* > + * Update VM-entry instruction length if the event being > + * delivered was a software interrupt or software exception. > + */ > + if (intr_type == VMCS_INTR_T_SWINTR || > + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || > + intr_type == VMCS_INTR_T_SWEXCEPTION) { > vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); > } > - break; > - default: > - idtvec_info = 0; > - break; > } > > switch (reason) { > @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc > */ > if (ts->reason == TSR_IDT_GATE) { > KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, > - ("invalid idtvec_info %x for IDT task switch", > + ("invalid idtvec_info %#x for IDT task switch", > idtvec_info)); > intr_type = idtvec_info & VMCS_INTR_T_MASK; > if (intr_type != VMCS_INTR_T_SWINTR && > @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc > * the guest. > * > * See "Resuming Guest Software after Handling an Exception". > + * See "Information for VM Exits Due to Vectored Events". > */ > if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && > (intr_info & 0xff) != IDT_DF && > @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t > * pmap_invalidate_ept(). > */ > disable_intr(); > + vmx_inject_interrupts(vmx, vcpu, vlapic); > + > + /* > + * Check for vcpu suspension after injecting events because > + * vmx_inject_interrupts() can suspend the vcpu due to a > + * triple fault. > + */ > if (vcpu_suspended(suspend_cookie)) { > enable_intr(); > vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); > @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t > break; > } > > - vmx_inject_interrupts(vmx, vcpu, vlapic); > vmx_run_trace(vmx, vcpu); > rc = vmx_enter_guest(vmxctx, vmx, launched); > > > Modified: head/sys/amd64/vmm/vmm.c > ============================================================================== > --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -97,6 +97,7 @@ struct vcpu { > int hostcpu; /* (o) vcpu's host cpu */ > struct vlapic *vlapic; /* (i) APIC device model */ > enum x2apic_state x2apic_state; /* (i) APIC mode */ > + uint64_t exitintinfo; /* (i) events pending at VM exit */ > int nmi_pending; /* (i) NMI pending */ > int extint_pending; /* (i) INTR pending */ > struct vm_exception exception; /* (x) exception collateral */ > @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo > > vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); > vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); > + vcpu->exitintinfo = 0; > vcpu->nmi_pending = 0; > vcpu->extint_pending = 0; > vcpu->exception_pending = 0; > @@ -1458,6 +1460,202 @@ restart: > } > > int > +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) > +{ > + struct vcpu *vcpu; > + int type, vector; > + > + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) > + return (EINVAL); > + > + vcpu = &vm->vcpu[vcpuid]; > + > + if (info & VM_INTINFO_VALID) { > + type = info & VM_INTINFO_TYPE; > + vector = info & 0xff; > + if (type == VM_INTINFO_NMI && vector != IDT_NMI) > + return (EINVAL); > + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) > + return (EINVAL); > + if (info & VM_INTINFO_RSVD) > + return (EINVAL); > + } else { > + info = 0; > + } > + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); > + vcpu->exitintinfo = info; > + return (0); > +} > + > +enum exc_class { > + EXC_BENIGN, > + EXC_CONTRIBUTORY, > + EXC_PAGEFAULT > +}; > + > +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ > + > +static enum exc_class > +exception_class(uint64_t info) > +{ > + int type, vector; > + > + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); > + type = info & VM_INTINFO_TYPE; > + vector = info & 0xff; > + > + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ > + switch (type) { > + case VM_INTINFO_HWINTR: > + case VM_INTINFO_SWINTR: > + case VM_INTINFO_NMI: > + return (EXC_BENIGN); > + default: > + /* > + * Hardware exception. > + * > + * SVM and VT-x use identical type values to represent NMI, > + * hardware interrupt and software interrupt. > + * > + * SVM uses type '3' for all exceptions. VT-x uses type '3' > + * for exceptions except #BP and #OF. #BP and #OF use a type > + * value of '5' or '6'. Therefore we don't check for explicit > + * values of 'type' to classify 'intinfo' into a hardware > + * exception. > + */ > + break; > + } > + > + switch (vector) { > + case IDT_PF: > + case IDT_VE: > + return (EXC_PAGEFAULT); > + case IDT_DE: > + case IDT_TS: > + case IDT_NP: > + case IDT_SS: > + case IDT_GP: > + return (EXC_CONTRIBUTORY); > + default: > + return (EXC_BENIGN); > + } > +} > + > +static int > +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, > + uint64_t *retinfo) > +{ > + enum exc_class exc1, exc2; > + int type1, vector1; > + > + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); > + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); > + > + /* > + * If an exception occurs while attempting to call the double-fault > + * handler the processor enters shutdown mode (aka triple fault). > + */ > + type1 = info1 & VM_INTINFO_TYPE; > + vector1 = info1 & 0xff; > + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { > + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", > + info1, info2); > + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); > + *retinfo = 0; > + return (0); > + } > + > + /* > + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 > + */ > + exc1 = exception_class(info1); > + exc2 = exception_class(info2); > + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || > + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { > + /* Convert nested fault into a double fault. */ > + *retinfo = IDT_DF; > + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; > + *retinfo |= VM_INTINFO_DEL_ERRCODE; > + } else { > + /* Handle exceptions serially */ > + *retinfo = info2; > + } > + return (1); > +} > + > +static uint64_t > +vcpu_exception_intinfo(struct vcpu *vcpu) > +{ > + uint64_t info = 0; > + > + if (vcpu->exception_pending) { > + info = vcpu->exception.vector & 0xff; > + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; > + if (vcpu->exception.error_code_valid) { > + info |= VM_INTINFO_DEL_ERRCODE; > + info |= (uint64_t)vcpu->exception.error_code << 32; > + } > + } > + return (info); > +} > + > +int > +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) > +{ > + struct vcpu *vcpu; > + uint64_t info1, info2; > + int valid; > + > + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); > + > + vcpu = &vm->vcpu[vcpuid]; > + > + info1 = vcpu->exitintinfo; > + vcpu->exitintinfo = 0; > + > + info2 = 0; > + if (vcpu->exception_pending) { > + info2 = vcpu_exception_intinfo(vcpu); > + vcpu->exception_pending = 0; > + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", > + vcpu->exception.vector, info2); > + } > + > + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { > + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); > + } else if (info1 & VM_INTINFO_VALID) { > + *retinfo = info1; > + valid = 1; > + } else if (info2 & VM_INTINFO_VALID) { > + *retinfo = info2; > + valid = 1; > + } else { > + valid = 0; > + } > + > + if (valid) { > + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " > + "retinfo(%#lx)", __func__, info1, info2, *retinfo); > + } > + > + return (valid); > +} > + > +int > +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) > +{ > + struct vcpu *vcpu; > + > + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) > + return (EINVAL); > + > + vcpu = &vm->vcpu[vcpuid]; > + *info1 = vcpu->exitintinfo; > + *info2 = vcpu_exception_intinfo(vcpu); > + return (0); > +} > + > +int > vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) > { > struct vcpu *vcpu; > @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v > if (exception->vector < 0 || exception->vector >= 32) > return (EINVAL); > > + /* > + * A double fault exception should never be injected directly into > + * the guest. It is a derived exception that results from specific > + * combinations of nested faults. > + */ > + if (exception->vector == IDT_DF) > + return (EINVAL); > + > vcpu = &vm->vcpu[vcpuid]; > > if (vcpu->exception_pending) { > @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v > return (0); > } > > -int > -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) > -{ > - struct vcpu *vcpu; > - int pending; > - > - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); > - > - vcpu = &vm->vcpu[vcpuid]; > - pending = vcpu->exception_pending; > - if (pending) { > - vcpu->exception_pending = 0; > - *exception = vcpu->exception; > - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", > - exception->vector); > - } > - return (pending); > -} > - > static void > vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) > { > > Modified: head/sys/amd64/vmm/vmm_dev.c > ============================================================================== > --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c > struct vm_gla2gpa *gg; > struct vm_activate_cpu *vac; > struct vm_cpuset *vm_cpuset; > + struct vm_intinfo *vmii; > > sc = vmmdev_lookup2(cdev); > if (sc == NULL) > @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c > case VM_SET_X2APIC_STATE: > case VM_GLA2GPA: > case VM_ACTIVATE_CPU: > + case VM_SET_INTINFO: > + case VM_GET_INTINFO: > /* > * XXX fragile, handle with care > * Assumes that the first field of the ioctl data is the vcpu. > @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c > error = copyout(cpuset, vm_cpuset->cpus, size); > free(cpuset, M_TEMP); > break; > + case VM_SET_INTINFO: > + vmii = (struct vm_intinfo *)data; > + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); > + break; > + case VM_GET_INTINFO: > + vmii = (struct vm_intinfo *)data; > + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, > + &vmii->info2); > + break; > default: > error = ENOTTY; > break; > > Modified: head/usr.sbin/bhyve/bhyverun.c > ============================================================================== > --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct > exit(1); > case VM_SUSPEND_HALT: > exit(2); > + case VM_SUSPEND_TRIPLEFAULT: > + exit(3); > default: > fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); > exit(100); > > Modified: head/usr.sbin/bhyve/task_switch.c > ============================================================================== > --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st > */ > > /* > - * XXX is the original task switch was triggered by a hardware > - * exception then do we generate a double-fault if we encounter > - * an exception during the task switch? > + * If the task switch was triggered by an event delivered through > + * the IDT then extinguish the pending event from the vcpu's > + * exitintinfo. > */ > + if (task_switch->reason == TSR_IDT_GATE) { > + error = vm_set_intinfo(ctx, vcpu, 0); > + assert(error == 0); > + } > > /* > * XXX should inject debug exception if 'T' bit is 1 > > Modified: head/usr.sbin/bhyvectl/bhyvectl.c > ============================================================================== > --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -195,7 +195,8 @@ usage(void) > " [--force-reset]\n" > " [--force-poweroff]\n" > " [--get-active-cpus]\n" > - " [--get-suspended-cpus]\n", > + " [--get-suspended-cpus]\n" > + " [--get-intinfo]\n", > progname); > exit(1); > } > @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; > static int force_reset, force_poweroff; > static const char *capname; > static int create, destroy, get_lowmem, get_highmem; > +static int get_intinfo; > static int get_active_cpus, get_suspended_cpus; > static uint64_t memsize; > static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; > @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu > printf("\n"); > } > > +static void > +print_intinfo(const char *banner, uint64_t info) > +{ > + int type; > + > + printf("%s:\t", banner); > + if (info & VM_INTINFO_VALID) { > + type = info & VM_INTINFO_TYPE; > + switch (type) { > + case VM_INTINFO_HWINTR: > + printf("extint"); > + break; > + case VM_INTINFO_NMI: > + printf("nmi"); > + break; > + case VM_INTINFO_SWINTR: > + printf("swint"); > + break; > + default: > + printf("exception"); > + break; > + } > + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); > + if (info & VM_INTINFO_DEL_ERRCODE) > + printf(" errcode %#x", (u_int)(info >> 32)); > + } else { > + printf("n/a"); > + } > + printf("\n"); > +} > + > int > main(int argc, char *argv[]) > { > @@ -420,7 +453,7 @@ main(int argc, char *argv[]) > vm_paddr_t gpa, gpa_pmap; > size_t len; > struct vm_exit vmexit; > - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; > + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; > struct vmctx *ctx; > int wired; > cpuset_t cpus; > @@ -595,6 +628,7 @@ main(int argc, char *argv[]) > { "force-poweroff", NO_ARG, &force_poweroff, 1 }, > { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, > { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, > + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, > { NULL, 0, NULL, 0 } > }; > > @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) > print_cpus("suspended cpus", &cpus); > } > > + if (!error && (get_intinfo || get_all)) { > + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); > + if (!error) { > + print_intinfo("pending", info[0]); > + print_intinfo("current", info[1]); > + } > + } > + > if (!error && run) { > error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); > assert(error == 0); > From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:31:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E7EF685; Sun, 20 Jul 2014 07:31:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0012ADC; Sun, 20 Jul 2014 07:31:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7Vunr082295; Sun, 20 Jul 2014 07:31:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7VuxQ082294; Sun, 20 Jul 2014 07:31:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200731.s6K7VuxQ082294@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268909 - 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.18 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, 20 Jul 2014 07:31:56 -0000 Author: adrian Date: Sun Jul 20 07:31:55 2014 New Revision: 268909 URL: http://svnweb.freebsd.org/changeset/base/268909 Log: Update the comment to be more concise. Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jul 20 06:03:52 2014 (r268908) +++ head/sys/netinet/in_rss.c Sun Jul 20 07:31:55 2014 (r268909) @@ -149,9 +149,8 @@ SYSCTL_INT(_net_inet_rss, OID_AUTO, base * * XXXRW: And that we don't randomize it yet! * - * XXXRW: This default is actually the default key from Chelsio T5 cards, as - * it offers reasonable distribution, unlike all-0 keys which always - * generate a hash of 0 (upsettingly). + * This is the default Microsoft RSS specification key which is also + * the Chelsio T5 firmware default key. */ static uint8_t rss_key[RSS_KEYSIZE] = { 0xbe, 0xac, 0x01, 0xfa, 0x6a, 0x42, 0xb7, 0x3b, From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:37:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45CE0942; Sun, 20 Jul 2014 07:37:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 330832AFE; Sun, 20 Jul 2014 07:37:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7b0LO083215; Sun, 20 Jul 2014 07:37:00 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7axG6083204; Sun, 20 Jul 2014 07:36:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200736.s6K7axG6083204@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268911 - 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.18 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, 20 Jul 2014 07:37:00 -0000 Author: adrian Date: Sun Jul 20 07:36:59 2014 New Revision: 268911 URL: http://svnweb.freebsd.org/changeset/base/268911 Log: Implement rss_gethashconfig() - return the currently supported hash methods by the stack. Right now the stack isn't really setup for RSS with 4-tuple UDP hashing for either IPv4 and IPv6. The specifics: * The UDP init path udp_init() and udplite_init() specify the hash as 2-tuple, so the PCBGROUPS code only tries a 2-tuple check; * The PCBGROUPS and RSS code doesn't know about the UDP hash types just yet, so they're never treated as valid hashes. * For correctness, 4-tuple can't be enabled in the general case because UDP datagrams can be more fragmented than IP datagrams may be. Strictly speaking, TCP datagrams may also be fragmented and this could cause issues with PCBGROUPS/RSS until the IP defragment path grows some code to re-calculate the RSS hash. I'll follow this commit up with awareness of the UDP 4-tuple for those who wish to configure it, but for now it'll stay disabled. No drivers (yet) know to use this function when RSS is enabled. Modified: head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jul 20 07:35:00 2014 (r268910) +++ head/sys/netinet/in_rss.c Sun Jul 20 07:36:59 2014 (r268911) @@ -535,6 +535,40 @@ rss_getnumcpus(void) } /* + * Return the supported RSS hash configuration. + * + * NICs should query this to determine what to configure in their redirection + * matching table. + */ +u_int +rss_gethashconfig(void) +{ + /* Return 4-tuple for TCP; 2-tuple for others */ + /* + * UDP may fragment more often than TCP and thus we'll end up with + * NICs returning 2-tuple fragments. + * udp_init() and udplite_init() both currently initialise things + * as 2-tuple. + * So for now disable UDP 4-tuple hashing until all of the other + * pieces are in place. + */ + return ( + RSS_HASHTYPE_RSS_IPV4 + | RSS_HASHTYPE_RSS_TCP_IPV4 + | RSS_HASHTYPE_RSS_IPV6 + | RSS_HASHTYPE_RSS_TCP_IPV6 + | RSS_HASHTYPE_RSS_IPV6_EX + | RSS_HASHTYPE_RSS_TCP_IPV6_EX +#if 0 + | RSS_HASHTYPE_RSS_UDP_IPV4 + | RSS_HASHTYPE_RSS_UDP_IPV4_EX + | RSS_HASHTYPE_RSS_UDP_IPV6 + | RSS_HASHTYPE_RSS_UDP_IPV6_EX +#endif + ); +} + +/* * XXXRW: Confirm that sysctl -a won't dump this keying material, don't want * it appearing in debugging output unnecessarily. */ Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Sun Jul 20 07:35:00 2014 (r268910) +++ head/sys/netinet/in_rss.h Sun Jul 20 07:36:59 2014 (r268911) @@ -52,6 +52,25 @@ #define RSS_HASHFIELDS_2TUPLE 2 /* + * Define RSS representations of the M_HASHTYPE_* values, representing + * which particular bits are supported. The NICs can then use this to + * calculate which hash types to enable and which not to enable. + * + * The fact that these line up with M_HASHTYPE_* is not to be relied + * upon. + */ +#define RSS_HASHTYPE_RSS_IPV4 (1 << 1) /* IPv4 2-tuple */ +#define RSS_HASHTYPE_RSS_TCP_IPV4 (1 << 2) /* TCPv4 4-tuple */ +#define RSS_HASHTYPE_RSS_IPV6 (1 << 3) /* IPv6 2-tuple */ +#define RSS_HASHTYPE_RSS_TCP_IPV6 (1 << 4) /* TCPv6 4-tuple */ +#define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) /* IPv6 2-tuple + ext hdrs */ +#define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) /* TCPv6 4-tiple + ext hdrs */ +#define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) /* IPv4 UDP 4-tuple */ +#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) /* IPv4 UDP 4-tuple + ext hdrs */ +#define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) /* IPv6 UDP 4-tuple */ +#define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) /* IPv6 UDP 4-tuple + ext hdrs */ + +/* * Compile-time limits on the size of the indirection table. */ #define RSS_MAXBITS 7 @@ -75,6 +94,7 @@ void rss_getkey(uint8_t *key); u_int rss_gethashalgo(void); u_int rss_getnumbuckets(void); u_int rss_getnumcpus(void); +u_int rss_gethashconfig(void); /* * Network stack interface to generate a hash for a protocol tuple. From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:37:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CDC2AA9; Sun, 20 Jul 2014 07:37:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A7D02B18; Sun, 20 Jul 2014 07:37:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7bmQk083422; Sun, 20 Jul 2014 07:37:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7bmtK083421; Sun, 20 Jul 2014 07:37:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200737.s6K7bmtK083421@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268912 - 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.18 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, 20 Jul 2014 07:37:48 -0000 Author: adrian Date: Sun Jul 20 07:37:47 2014 New Revision: 268912 URL: http://svnweb.freebsd.org/changeset/base/268912 Log: Add hash awareness of the IPv4 and IPv6 UDP 4-tuple. Note: it would be nice if the supported hash check would be used here! Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Sun Jul 20 07:36:59 2014 (r268911) +++ head/sys/netinet/in_rss.c Sun Jul 20 07:37:47 2014 (r268912) @@ -436,8 +436,10 @@ rss_hash2cpuid(uint32_t hash_val, uint32 switch (hash_type) { case M_HASHTYPE_RSS_IPV4: case M_HASHTYPE_RSS_TCP_IPV4: + case M_HASHTYPE_RSS_UDP_IPV4: case M_HASHTYPE_RSS_IPV6: case M_HASHTYPE_RSS_TCP_IPV6: + case M_HASHTYPE_RSS_UDP_IPV6: return (rss_getcpu(rss_getbucket(hash_val))); default: return (NETISR_CPUID_NONE); @@ -455,8 +457,10 @@ rss_hash2bucket(uint32_t hash_val, uint3 switch (hash_type) { case M_HASHTYPE_RSS_IPV4: case M_HASHTYPE_RSS_TCP_IPV4: + case M_HASHTYPE_RSS_UDP_IPV4: case M_HASHTYPE_RSS_IPV6: case M_HASHTYPE_RSS_TCP_IPV6: + case M_HASHTYPE_RSS_UDP_IPV6: *bucket_id = rss_getbucket(hash_val); return (0); default: From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:38:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF8D7BF1; Sun, 20 Jul 2014 07:38:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D21D2B20; Sun, 20 Jul 2014 07:38:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7ccdn083613; Sun, 20 Jul 2014 07:38:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7ccYN083612; Sun, 20 Jul 2014 07:38:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200738.s6K7ccYN083612@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268913 - 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.18 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, 20 Jul 2014 07:38:38 -0000 Author: adrian Date: Sun Jul 20 07:38:38 2014 New Revision: 268913 URL: http://svnweb.freebsd.org/changeset/base/268913 Log: Make the PCBGROUPS code aware of IPv4 UDP 4-tuple. Modified: head/sys/netinet/in_pcbgroup.c Modified: head/sys/netinet/in_pcbgroup.c ============================================================================== --- head/sys/netinet/in_pcbgroup.c Sun Jul 20 07:37:47 2014 (r268912) +++ head/sys/netinet/in_pcbgroup.c Sun Jul 20 07:38:38 2014 (r268913) @@ -243,6 +243,8 @@ in_pcbgroup_byhash(struct inpcbinfo *pcb #ifdef RSS if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && hashtype == M_HASHTYPE_RSS_TCP_IPV4) || + (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && + hashtype == M_HASHTYPE_RSS_UDP_IPV4) || (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && hashtype == M_HASHTYPE_RSS_IPV4)) return (&pcbinfo->ipi_pcbgroups[ From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:39:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FAD0D49; Sun, 20 Jul 2014 07:39:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2562B2E; Sun, 20 Jul 2014 07:39:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7dtJK083807; Sun, 20 Jul 2014 07:39:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7dtEv083806; Sun, 20 Jul 2014 07:39:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200739.s6K7dtEv083806@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268914 - 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.18 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, 20 Jul 2014 07:39:55 -0000 Author: adrian Date: Sun Jul 20 07:39:54 2014 New Revision: 268914 URL: http://svnweb.freebsd.org/changeset/base/268914 Log: When it's time to do 4-tuple UDP IPv6 hashing, make sure this is a known type. Modified: head/sys/netinet6/in6_pcbgroup.c Modified: head/sys/netinet6/in6_pcbgroup.c ============================================================================== --- head/sys/netinet6/in6_pcbgroup.c Sun Jul 20 07:38:38 2014 (r268913) +++ head/sys/netinet6/in6_pcbgroup.c Sun Jul 20 07:39:54 2014 (r268914) @@ -73,6 +73,8 @@ in6_pcbgroup_byhash(struct inpcbinfo *pc #ifdef RSS if ((pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && hashtype == M_HASHTYPE_RSS_TCP_IPV6) || + (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_4TUPLE && + hashtype == M_HASHTYPE_RSS_UDP_IPV6) || (pcbinfo->ipi_hashfields == IPI_HASHFIELDS_2TUPLE && hashtype == M_HASHTYPE_RSS_IPV6)) return (&pcbinfo->ipi_pcbgroups[ From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:43:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A04F2ED5; Sun, 20 Jul 2014 07:43:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D4F12BB5; Sun, 20 Jul 2014 07:43:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7hffZ087497; Sun, 20 Jul 2014 07:43:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7hfkh087496; Sun, 20 Jul 2014 07:43:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200743.s6K7hfkh087496@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268915 - head/sys/dev/ixgbe 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.18 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, 20 Jul 2014 07:43:41 -0000 Author: adrian Date: Sun Jul 20 07:43:41 2014 New Revision: 268915 URL: http://svnweb.freebsd.org/changeset/base/268915 Log: Disable the ixgbe(4) UDP 4-tuple hashing for the time being. A mix of fragmented and non-fragmented UDP in a single stream will end up being hashed differently, resulting in out-of-order behaviour in the receive path. This was done in the linux e1000 driver in 2011. Discussed with: jfv Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:39:54 2014 (r268914) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:43:41 2014 (r268915) @@ -4247,16 +4247,26 @@ ixgbe_initialise_rss_mapping(struct adap IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]); /* Perform hash on these packet types */ + /* + * Disable UDP - IP fragments aren't currently being handled + * and so we end up with a mix of 2-tuple and 4-tuple + * traffic. + */ mrqc = IXGBE_MRQC_RSSEN | IXGBE_MRQC_RSS_FIELD_IPV4 | IXGBE_MRQC_RSS_FIELD_IPV4_TCP +#if 0 | IXGBE_MRQC_RSS_FIELD_IPV4_UDP +#endif | IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP | IXGBE_MRQC_RSS_FIELD_IPV6_EX | IXGBE_MRQC_RSS_FIELD_IPV6 | IXGBE_MRQC_RSS_FIELD_IPV6_TCP +#if 0 | IXGBE_MRQC_RSS_FIELD_IPV6_UDP - | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; + | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP +#endif + ; IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:45:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18DEFC7; Sun, 20 Jul 2014 07:45:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0EF22BC3; Sun, 20 Jul 2014 07:45:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K7jmKY087874; Sun, 20 Jul 2014 07:45:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K7jmxQ087873; Sun, 20 Jul 2014 07:45:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200745.s6K7jmxQ087873@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 07:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268916 - head/sys/dev/ixgbe 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.18 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, 20 Jul 2014 07:45:49 -0000 Author: adrian Date: Sun Jul 20 07:45:48 2014 New Revision: 268916 URL: http://svnweb.freebsd.org/changeset/base/268916 Log: Teach ixgbe(4) about rss_gethashconfig(). If RSS is enabled, ixgbe(4) will query the RSS API for the types of hashes which should be used. It'll then only enable hashes that are exposed via the RSS layer. This way it won't try to do things like enable UDP hashing if RSS explicitly states that it isn't supported in lookups. Tested: * 82599EB ixgbe(4) NIC Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:43:41 2014 (r268915) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:45:48 2014 (r268916) @@ -4204,6 +4204,9 @@ ixgbe_initialise_rss_mapping(struct adap int i, j, queue_id; uint32_t rss_key[10]; uint32_t mrqc; +#ifdef RSS + uint32_t rss_hash_config; +#endif /* Setup RSS */ reta = 0; @@ -4247,6 +4250,32 @@ ixgbe_initialise_rss_mapping(struct adap IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), rss_key[i]); /* Perform hash on these packet types */ +#ifdef RSS + mrqc = IXGBE_MRQC_RSSEN; + rss_hash_config = rss_gethashconfig(); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX; + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) + device_printf(adapter->dev, + "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, " + "but not supported\n", __func__); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) + mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; +#else /* * Disable UDP - IP fragments aren't currently being handled * and so we end up with a mix of 2-tuple and 4-tuple @@ -4267,6 +4296,7 @@ ixgbe_initialise_rss_mapping(struct adap | IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP #endif ; +#endif /* RSS */ IXGBE_WRITE_REG(hw, IXGBE_MRQC, mrqc); } From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:47:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AEB04225; Sun, 20 Jul 2014 07:47:17 +0000 (UTC) Received: from mail-qg0-x22a.google.com (mail-qg0-x22a.google.com [IPv6:2607:f8b0:400d:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 253262BD3; Sun, 20 Jul 2014 07:47:17 +0000 (UTC) Received: by mail-qg0-f42.google.com with SMTP id j5so4603399qga.29 for ; Sun, 20 Jul 2014 00:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nc/Q96bGcSzP6zdaJ7n3Vab2FGTnW4n+maeyHHQtmgs=; b=JRIAhR83LF3vHQgWJAASgaGUkq+eUQYCwv05yaFRsIClytvr7AEBqznWBa/G+veHKf tPbTsIzSuyjbwxV1C1s59lBysCwvpt6olAcRGY8NSSq9+ZbLHT4F6Y2Lu0JaXUgcqf1L ye8ZhvfM40EAHeNE1zTQ6JfoRX3REWIzQ9S8uai+YphIWfXHltWANtJS7oYm0Qm/ze8y SUo9wjwufxF8KzCxjC15A24Z+66zuGiZ6C8yUxMCwf8rlN+3ZndlKhb1VLP6yJ3txF8c igMnMIAGhtbUHiaW8GLXxq+8A9BeFGpQw/8ws1a12gEvgZixDPRvaPhqHyLI/NxoglmG D4WQ== MIME-Version: 1.0 X-Received: by 10.140.96.229 with SMTP id k92mr25309169qge.38.1405842435763; Sun, 20 Jul 2014 00:47:15 -0700 (PDT) Received: by 10.140.48.37 with HTTP; Sun, 20 Jul 2014 00:47:15 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sun, 20 Jul 2014 00:47:15 -0700 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Neel Natu To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 07:47:17 -0000 Hi Adrian, On Sat, Jul 19, 2014 at 11:30 PM, Adrian Chadd wrote: > Hi! > > This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer > initialised before use /and/ it's part of a KASSERT() output. > Are you building with an external toolchain? best Neel > Thanks! > > > -a > > > On 19 July 2014 13:59, Neel Natu wrote: >> Author: neel >> Date: Sat Jul 19 20:59:08 2014 >> New Revision: 268889 >> URL: http://svnweb.freebsd.org/changeset/base/268889 >> >> Log: >> Handle nested exceptions in bhyve. >> >> A nested exception condition arises when a second exception is triggered while >> delivering the first exception. Most nested exceptions can be handled serially >> but some are converted into a double fault. If an exception is generated during >> delivery of a double fault then the virtual machine shuts down as a result of >> a triple fault. >> >> vm_exit_intinfo() is used to record that a VM-exit happened while an event was >> being delivered through the IDT. If an exception is triggered while handling >> the VM-exit it will be treated like a nested exception. >> >> vm_entry_intinfo() is used by processor-specific code to get the event to be >> injected into the guest on the next VM-entry. This function is responsible for >> deciding the disposition of nested exceptions. >> >> Modified: >> head/lib/libvmmapi/vmmapi.c >> head/lib/libvmmapi/vmmapi.h >> head/sys/amd64/include/vmm.h >> head/sys/amd64/include/vmm_dev.h >> head/sys/amd64/vmm/intel/vmx.c >> head/sys/amd64/vmm/vmm.c >> head/sys/amd64/vmm/vmm_dev.c >> head/usr.sbin/bhyve/bhyverun.c >> head/usr.sbin/bhyve/task_switch.c >> head/usr.sbin/bhyvectl/bhyvectl.c >> >> Modified: head/lib/libvmmapi/vmmapi.c >> ============================================================================== >> --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v >> error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); >> return (error); >> } >> + >> +int >> +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) >> +{ >> + struct vm_intinfo vmii; >> + int error; >> + >> + bzero(&vmii, sizeof(struct vm_intinfo)); >> + vmii.vcpuid = vcpu; >> + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); >> + if (error == 0) { >> + *info1 = vmii.info1; >> + *info2 = vmii.info2; >> + } >> + return (error); >> +} >> + >> +int >> +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) >> +{ >> + struct vm_intinfo vmii; >> + int error; >> + >> + bzero(&vmii, sizeof(struct vm_intinfo)); >> + vmii.vcpuid = vcpu; >> + vmii.info1 = info1; >> + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); >> + return (error); >> +} >> >> Modified: head/lib/libvmmapi/vmmapi.h >> ============================================================================== >> --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) >> @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c >> int func, int idx, uint64_t addr, uint64_t msg, >> uint32_t vector_control); >> >> +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); >> +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); >> + >> /* >> * Return a pointer to the statistics buffer. Note that this is not MT-safe. >> */ >> >> Modified: head/sys/amd64/include/vmm.h >> ============================================================================== >> --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) >> @@ -34,6 +34,7 @@ enum vm_suspend_how { >> VM_SUSPEND_RESET, >> VM_SUSPEND_POWEROFF, >> VM_SUSPEND_HALT, >> + VM_SUSPEND_TRIPLEFAULT, >> VM_SUSPEND_LAST >> }; >> >> @@ -88,6 +89,16 @@ enum x2apic_state { >> X2APIC_STATE_LAST >> }; >> >> +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) >> +#define VM_INTINFO_DEL_ERRCODE 0x800 >> +#define VM_INTINFO_RSVD 0x7ffff000 >> +#define VM_INTINFO_VALID 0x80000000 >> +#define VM_INTINFO_TYPE 0x700 >> +#define VM_INTINFO_HWINTR (0 << 8) >> +#define VM_INTINFO_NMI (2 << 8) >> +#define VM_INTINFO_HWEXCEPTION (3 << 8) >> +#define VM_INTINFO_SWINTR (4 << 8) >> + >> #ifdef _KERNEL >> >> #define VM_MAX_NAMELEN 32 >> @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); >> int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); >> >> /* >> - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an >> - * exception is pending and also updates 'vme'. The pending exception is >> - * cleared when this function returns. >> + * This function is called after a VM-exit that occurred during exception or >> + * interrupt delivery through the IDT. The format of 'intinfo' is described >> + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. >> * >> - * This function should only be called in the context of the thread that is >> - * executing this vcpu. >> + * If a VM-exit handler completes the event delivery successfully then it >> + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., >> + * if the task switch emulation is triggered via a task gate then it should >> + * call this function with 'intinfo=0' to indicate that the external event >> + * is not pending anymore. >> + * >> + * Return value is 0 on success and non-zero on failure. >> */ >> -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); >> +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); >> + >> +/* >> + * This function is called before every VM-entry to retrieve a pending >> + * event that should be injected into the guest. This function combines >> + * nested events into a double or triple fault. >> + * >> + * Returns 0 if there are no events that need to be injected into the guest >> + * and non-zero otherwise. >> + */ >> +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); >> + >> +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); >> >> void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ >> void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ >> >> Modified: head/sys/amd64/include/vmm_dev.h >> ============================================================================== >> --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) >> @@ -189,6 +189,12 @@ struct vm_cpuset { >> #define VM_ACTIVE_CPUS 0 >> #define VM_SUSPENDED_CPUS 1 >> >> +struct vm_intinfo { >> + int vcpuid; >> + uint64_t info1; >> + uint64_t info2; >> +}; >> + >> enum { >> /* general routines */ >> IOCNUM_ABIVERS = 0, >> @@ -211,6 +217,8 @@ enum { >> IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, >> >> /* interrupt injection */ >> + IOCNUM_GET_INTINFO = 28, >> + IOCNUM_SET_INTINFO = 29, >> IOCNUM_INJECT_EXCEPTION = 30, >> IOCNUM_LAPIC_IRQ = 31, >> IOCNUM_INJECT_NMI = 32, >> @@ -324,4 +332,8 @@ enum { >> _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) >> #define VM_GET_CPUS \ >> _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) >> +#define VM_SET_INTINFO \ >> + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) >> +#define VM_GET_INTINFO \ >> + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) >> #endif >> >> Modified: head/sys/amd64/vmm/intel/vmx.c >> ============================================================================== >> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >> { >> struct vm_exception exc; >> int vector, need_nmi_exiting, extint_pending; >> - uint64_t rflags; >> + uint64_t rflags, entryinfo; >> uint32_t gi, info; >> >> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >> - KASSERT(exc.vector >= 0 && exc.vector < 32, >> - ("%s: invalid exception vector %d", __func__, exc.vector)); >> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >> + "intinfo is not valid: %#lx", __func__, entryinfo)); >> >> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >> "pending exception %d: %#x", __func__, exc.vector, info)); >> >> - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; >> - if (exc.error_code_valid) { >> - info |= VMCS_INTR_DEL_ERRCODE; >> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); >> + info = entryinfo; >> + vector = info & 0xff; >> + if (vector == IDT_BP || vector == IDT_OF) { >> + /* >> + * VT-x requires #BP and #OF to be injected as software >> + * exceptions. >> + */ >> + info &= ~VMCS_INTR_T_MASK; >> + info |= VMCS_INTR_T_SWEXCEPTION; >> } >> + >> + if (info & VMCS_INTR_DEL_ERRCODE) >> + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); >> + >> vmcs_write(VMCS_ENTRY_INTR_INFO, info); >> } >> >> @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, >> vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); >> } >> >> +static void >> +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) >> +{ >> + uint32_t gi; >> + >> + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); >> + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, >> + ("NMI blocking is not in effect %#x", gi)); >> +} >> + >> static int >> vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) >> { >> @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc >> struct vm_task_switch *ts; >> uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; >> uint32_t intr_type, reason; >> - uint64_t qual, gpa; >> + uint64_t exitintinfo, qual, gpa; >> bool retu; >> >> CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); >> @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc >> * be handled specially by re-injecting the event if the IDT >> * vectoring information field's valid bit is set. >> * >> - * If the VM-exit is due to a task gate in the IDT then we don't >> - * reinject the event because emulating the task switch also >> - * completes the event delivery. >> - * >> * See "Information for VM Exits During Event Delivery" in Intel SDM >> * for details. >> */ >> - switch (reason) { >> - case EXIT_REASON_EPT_FAULT: >> - case EXIT_REASON_EPT_MISCONFIG: >> - case EXIT_REASON_APIC_ACCESS: >> - case EXIT_REASON_TASK_SWITCH: >> - case EXIT_REASON_EXCEPTION: >> - idtvec_info = vmcs_idt_vectoring_info(); >> - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", >> - exit_reason_to_str(reason), idtvec_info); >> - if ((idtvec_info & VMCS_IDT_VEC_VALID) && >> - (reason != EXIT_REASON_TASK_SWITCH)) { >> - idtvec_info &= ~(1 << 12); /* clear undefined bit */ >> - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); >> - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >> - idtvec_err = vmcs_idt_vectoring_err(); >> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, >> - idtvec_err); >> - } >> - /* >> - * If 'virtual NMIs' are being used and the VM-exit >> - * happened while injecting an NMI during the previous >> - * VM-entry, then clear "blocking by NMI" in the Guest >> - * Interruptibility-state. >> - */ >> - if ((idtvec_info & VMCS_INTR_T_MASK) == >> - VMCS_INTR_T_NMI) { >> - vmx_clear_nmi_blocking(vmx, vcpu); >> - } >> + idtvec_info = vmcs_idt_vectoring_info(); >> + if (idtvec_info & VMCS_IDT_VEC_VALID) { >> + idtvec_info &= ~(1 << 12); /* clear undefined bit */ >> + exitintinfo = idtvec_info; >> + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >> + idtvec_err = vmcs_idt_vectoring_err(); >> + exitintinfo |= (uint64_t)idtvec_err << 32; >> + } >> + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); >> + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", >> + __func__, error)); >> + >> + /* >> + * If 'virtual NMIs' are being used and the VM-exit >> + * happened while injecting an NMI during the previous >> + * VM-entry, then clear "blocking by NMI" in the >> + * Guest Interruptibility-State so the NMI can be >> + * reinjected on the subsequent VM-entry. >> + * >> + * However, if the NMI was being delivered through a task >> + * gate, then the new task must start execution with NMIs >> + * blocked so don't clear NMI blocking in this case. >> + */ >> + intr_type = idtvec_info & VMCS_INTR_T_MASK; >> + if (intr_type == VMCS_INTR_T_NMI) { >> + if (reason != EXIT_REASON_TASK_SWITCH) >> + vmx_clear_nmi_blocking(vmx, vcpu); >> + else >> + vmx_assert_nmi_blocking(vmx, vcpu); >> + } >> + >> + /* >> + * Update VM-entry instruction length if the event being >> + * delivered was a software interrupt or software exception. >> + */ >> + if (intr_type == VMCS_INTR_T_SWINTR || >> + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || >> + intr_type == VMCS_INTR_T_SWEXCEPTION) { >> vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); >> } >> - break; >> - default: >> - idtvec_info = 0; >> - break; >> } >> >> switch (reason) { >> @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc >> */ >> if (ts->reason == TSR_IDT_GATE) { >> KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, >> - ("invalid idtvec_info %x for IDT task switch", >> + ("invalid idtvec_info %#x for IDT task switch", >> idtvec_info)); >> intr_type = idtvec_info & VMCS_INTR_T_MASK; >> if (intr_type != VMCS_INTR_T_SWINTR && >> @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc >> * the guest. >> * >> * See "Resuming Guest Software after Handling an Exception". >> + * See "Information for VM Exits Due to Vectored Events". >> */ >> if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && >> (intr_info & 0xff) != IDT_DF && >> @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t >> * pmap_invalidate_ept(). >> */ >> disable_intr(); >> + vmx_inject_interrupts(vmx, vcpu, vlapic); >> + >> + /* >> + * Check for vcpu suspension after injecting events because >> + * vmx_inject_interrupts() can suspend the vcpu due to a >> + * triple fault. >> + */ >> if (vcpu_suspended(suspend_cookie)) { >> enable_intr(); >> vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); >> @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t >> break; >> } >> >> - vmx_inject_interrupts(vmx, vcpu, vlapic); >> vmx_run_trace(vmx, vcpu); >> rc = vmx_enter_guest(vmxctx, vmx, launched); >> >> >> Modified: head/sys/amd64/vmm/vmm.c >> ============================================================================== >> --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -97,6 +97,7 @@ struct vcpu { >> int hostcpu; /* (o) vcpu's host cpu */ >> struct vlapic *vlapic; /* (i) APIC device model */ >> enum x2apic_state x2apic_state; /* (i) APIC mode */ >> + uint64_t exitintinfo; /* (i) events pending at VM exit */ >> int nmi_pending; /* (i) NMI pending */ >> int extint_pending; /* (i) INTR pending */ >> struct vm_exception exception; /* (x) exception collateral */ >> @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo >> >> vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); >> vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); >> + vcpu->exitintinfo = 0; >> vcpu->nmi_pending = 0; >> vcpu->extint_pending = 0; >> vcpu->exception_pending = 0; >> @@ -1458,6 +1460,202 @@ restart: >> } >> >> int >> +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) >> +{ >> + struct vcpu *vcpu; >> + int type, vector; >> + >> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >> + return (EINVAL); >> + >> + vcpu = &vm->vcpu[vcpuid]; >> + >> + if (info & VM_INTINFO_VALID) { >> + type = info & VM_INTINFO_TYPE; >> + vector = info & 0xff; >> + if (type == VM_INTINFO_NMI && vector != IDT_NMI) >> + return (EINVAL); >> + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) >> + return (EINVAL); >> + if (info & VM_INTINFO_RSVD) >> + return (EINVAL); >> + } else { >> + info = 0; >> + } >> + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); >> + vcpu->exitintinfo = info; >> + return (0); >> +} >> + >> +enum exc_class { >> + EXC_BENIGN, >> + EXC_CONTRIBUTORY, >> + EXC_PAGEFAULT >> +}; >> + >> +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ >> + >> +static enum exc_class >> +exception_class(uint64_t info) >> +{ >> + int type, vector; >> + >> + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); >> + type = info & VM_INTINFO_TYPE; >> + vector = info & 0xff; >> + >> + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ >> + switch (type) { >> + case VM_INTINFO_HWINTR: >> + case VM_INTINFO_SWINTR: >> + case VM_INTINFO_NMI: >> + return (EXC_BENIGN); >> + default: >> + /* >> + * Hardware exception. >> + * >> + * SVM and VT-x use identical type values to represent NMI, >> + * hardware interrupt and software interrupt. >> + * >> + * SVM uses type '3' for all exceptions. VT-x uses type '3' >> + * for exceptions except #BP and #OF. #BP and #OF use a type >> + * value of '5' or '6'. Therefore we don't check for explicit >> + * values of 'type' to classify 'intinfo' into a hardware >> + * exception. >> + */ >> + break; >> + } >> + >> + switch (vector) { >> + case IDT_PF: >> + case IDT_VE: >> + return (EXC_PAGEFAULT); >> + case IDT_DE: >> + case IDT_TS: >> + case IDT_NP: >> + case IDT_SS: >> + case IDT_GP: >> + return (EXC_CONTRIBUTORY); >> + default: >> + return (EXC_BENIGN); >> + } >> +} >> + >> +static int >> +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, >> + uint64_t *retinfo) >> +{ >> + enum exc_class exc1, exc2; >> + int type1, vector1; >> + >> + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); >> + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); >> + >> + /* >> + * If an exception occurs while attempting to call the double-fault >> + * handler the processor enters shutdown mode (aka triple fault). >> + */ >> + type1 = info1 & VM_INTINFO_TYPE; >> + vector1 = info1 & 0xff; >> + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { >> + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", >> + info1, info2); >> + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); >> + *retinfo = 0; >> + return (0); >> + } >> + >> + /* >> + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 >> + */ >> + exc1 = exception_class(info1); >> + exc2 = exception_class(info2); >> + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || >> + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { >> + /* Convert nested fault into a double fault. */ >> + *retinfo = IDT_DF; >> + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >> + *retinfo |= VM_INTINFO_DEL_ERRCODE; >> + } else { >> + /* Handle exceptions serially */ >> + *retinfo = info2; >> + } >> + return (1); >> +} >> + >> +static uint64_t >> +vcpu_exception_intinfo(struct vcpu *vcpu) >> +{ >> + uint64_t info = 0; >> + >> + if (vcpu->exception_pending) { >> + info = vcpu->exception.vector & 0xff; >> + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >> + if (vcpu->exception.error_code_valid) { >> + info |= VM_INTINFO_DEL_ERRCODE; >> + info |= (uint64_t)vcpu->exception.error_code << 32; >> + } >> + } >> + return (info); >> +} >> + >> +int >> +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) >> +{ >> + struct vcpu *vcpu; >> + uint64_t info1, info2; >> + int valid; >> + >> + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >> + >> + vcpu = &vm->vcpu[vcpuid]; >> + >> + info1 = vcpu->exitintinfo; >> + vcpu->exitintinfo = 0; >> + >> + info2 = 0; >> + if (vcpu->exception_pending) { >> + info2 = vcpu_exception_intinfo(vcpu); >> + vcpu->exception_pending = 0; >> + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", >> + vcpu->exception.vector, info2); >> + } >> + >> + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { >> + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); >> + } else if (info1 & VM_INTINFO_VALID) { >> + *retinfo = info1; >> + valid = 1; >> + } else if (info2 & VM_INTINFO_VALID) { >> + *retinfo = info2; >> + valid = 1; >> + } else { >> + valid = 0; >> + } >> + >> + if (valid) { >> + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " >> + "retinfo(%#lx)", __func__, info1, info2, *retinfo); >> + } >> + >> + return (valid); >> +} >> + >> +int >> +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) >> +{ >> + struct vcpu *vcpu; >> + >> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >> + return (EINVAL); >> + >> + vcpu = &vm->vcpu[vcpuid]; >> + *info1 = vcpu->exitintinfo; >> + *info2 = vcpu_exception_intinfo(vcpu); >> + return (0); >> +} >> + >> +int >> vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) >> { >> struct vcpu *vcpu; >> @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v >> if (exception->vector < 0 || exception->vector >= 32) >> return (EINVAL); >> >> + /* >> + * A double fault exception should never be injected directly into >> + * the guest. It is a derived exception that results from specific >> + * combinations of nested faults. >> + */ >> + if (exception->vector == IDT_DF) >> + return (EINVAL); >> + >> vcpu = &vm->vcpu[vcpuid]; >> >> if (vcpu->exception_pending) { >> @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v >> return (0); >> } >> >> -int >> -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) >> -{ >> - struct vcpu *vcpu; >> - int pending; >> - >> - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >> - >> - vcpu = &vm->vcpu[vcpuid]; >> - pending = vcpu->exception_pending; >> - if (pending) { >> - vcpu->exception_pending = 0; >> - *exception = vcpu->exception; >> - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", >> - exception->vector); >> - } >> - return (pending); >> -} >> - >> static void >> vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) >> { >> >> Modified: head/sys/amd64/vmm/vmm_dev.c >> ============================================================================== >> --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >> struct vm_gla2gpa *gg; >> struct vm_activate_cpu *vac; >> struct vm_cpuset *vm_cpuset; >> + struct vm_intinfo *vmii; >> >> sc = vmmdev_lookup2(cdev); >> if (sc == NULL) >> @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >> case VM_SET_X2APIC_STATE: >> case VM_GLA2GPA: >> case VM_ACTIVATE_CPU: >> + case VM_SET_INTINFO: >> + case VM_GET_INTINFO: >> /* >> * XXX fragile, handle with care >> * Assumes that the first field of the ioctl data is the vcpu. >> @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >> error = copyout(cpuset, vm_cpuset->cpus, size); >> free(cpuset, M_TEMP); >> break; >> + case VM_SET_INTINFO: >> + vmii = (struct vm_intinfo *)data; >> + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); >> + break; >> + case VM_GET_INTINFO: >> + vmii = (struct vm_intinfo *)data; >> + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, >> + &vmii->info2); >> + break; >> default: >> error = ENOTTY; >> break; >> >> Modified: head/usr.sbin/bhyve/bhyverun.c >> ============================================================================== >> --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct >> exit(1); >> case VM_SUSPEND_HALT: >> exit(2); >> + case VM_SUSPEND_TRIPLEFAULT: >> + exit(3); >> default: >> fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); >> exit(100); >> >> Modified: head/usr.sbin/bhyve/task_switch.c >> ============================================================================== >> --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st >> */ >> >> /* >> - * XXX is the original task switch was triggered by a hardware >> - * exception then do we generate a double-fault if we encounter >> - * an exception during the task switch? >> + * If the task switch was triggered by an event delivered through >> + * the IDT then extinguish the pending event from the vcpu's >> + * exitintinfo. >> */ >> + if (task_switch->reason == TSR_IDT_GATE) { >> + error = vm_set_intinfo(ctx, vcpu, 0); >> + assert(error == 0); >> + } >> >> /* >> * XXX should inject debug exception if 'T' bit is 1 >> >> Modified: head/usr.sbin/bhyvectl/bhyvectl.c >> ============================================================================== >> --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -195,7 +195,8 @@ usage(void) >> " [--force-reset]\n" >> " [--force-poweroff]\n" >> " [--get-active-cpus]\n" >> - " [--get-suspended-cpus]\n", >> + " [--get-suspended-cpus]\n" >> + " [--get-intinfo]\n", >> progname); >> exit(1); >> } >> @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; >> static int force_reset, force_poweroff; >> static const char *capname; >> static int create, destroy, get_lowmem, get_highmem; >> +static int get_intinfo; >> static int get_active_cpus, get_suspended_cpus; >> static uint64_t memsize; >> static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; >> @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu >> printf("\n"); >> } >> >> +static void >> +print_intinfo(const char *banner, uint64_t info) >> +{ >> + int type; >> + >> + printf("%s:\t", banner); >> + if (info & VM_INTINFO_VALID) { >> + type = info & VM_INTINFO_TYPE; >> + switch (type) { >> + case VM_INTINFO_HWINTR: >> + printf("extint"); >> + break; >> + case VM_INTINFO_NMI: >> + printf("nmi"); >> + break; >> + case VM_INTINFO_SWINTR: >> + printf("swint"); >> + break; >> + default: >> + printf("exception"); >> + break; >> + } >> + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); >> + if (info & VM_INTINFO_DEL_ERRCODE) >> + printf(" errcode %#x", (u_int)(info >> 32)); >> + } else { >> + printf("n/a"); >> + } >> + printf("\n"); >> +} >> + >> int >> main(int argc, char *argv[]) >> { >> @@ -420,7 +453,7 @@ main(int argc, char *argv[]) >> vm_paddr_t gpa, gpa_pmap; >> size_t len; >> struct vm_exit vmexit; >> - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; >> + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; >> struct vmctx *ctx; >> int wired; >> cpuset_t cpus; >> @@ -595,6 +628,7 @@ main(int argc, char *argv[]) >> { "force-poweroff", NO_ARG, &force_poweroff, 1 }, >> { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, >> { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, >> + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, >> { NULL, 0, NULL, 0 } >> }; >> >> @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) >> print_cpus("suspended cpus", &cpus); >> } >> >> + if (!error && (get_intinfo || get_all)) { >> + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); >> + if (!error) { >> + print_intinfo("pending", info[0]); >> + print_intinfo("current", info[1]); >> + } >> + } >> + >> if (!error && run) { >> error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); >> assert(error == 0); >> From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:48:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F07FC370; Sun, 20 Jul 2014 07:48:42 +0000 (UTC) Received: from mail-qa0-x22e.google.com (mail-qa0-x22e.google.com [IPv6:2607:f8b0:400d:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 772D02BD9; Sun, 20 Jul 2014 07:48:42 +0000 (UTC) Received: by mail-qa0-f46.google.com with SMTP id v10so4295553qac.33 for ; Sun, 20 Jul 2014 00:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=VVTrLHvjBBw7OLyMfVZeZ2Vs1PgGhUDmm8fKcb4agjM=; b=TlA9RQhHlZq5ZcaDGMm0+C8RHu6CUn/wg78L6Un+doj5u6Gq4wdXt91eyV6HLYilnP n716YtAW4lZoVYWOSsRWH9FgD+LOYWA2rn8mnS9IEuQP9sR0DPQ9LknZZSimMFj/e7e2 ZG7Ou837RGf2rLKtD2pdWeM4LfzQpjRvVPi4HInVo8NHmtNTXunDknLzsj/uteX4oVn6 WXkMmnW1a+Z7E0jV0jSiwomMyO9sm9iyUHt43fUkzjE+jvdYvw7R+Jb7oBxK3wmfYkBi sywRhAPgxNOv5q9GhqTtY8+SGKvEEeP6xSNPSOlfYibnJLrJtXeGnr5LSqjVX2bfliQP 7L2w== MIME-Version: 1.0 X-Received: by 10.229.184.9 with SMTP id ci9mr26758398qcb.11.1405842521530; Sun, 20 Jul 2014 00:48:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sun, 20 Jul 2014 00:48:41 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sun, 20 Jul 2014 00:48:41 -0700 X-Google-Sender-Auth: Ngv77A7pobDJqrRPEvCZWd6U0M4 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Adrian Chadd To: Neel Natu Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 07:48:43 -0000 On 20 July 2014 00:47, Neel Natu wrote: > Hi Adrian, > > On Sat, Jul 19, 2014 at 11:30 PM, Adrian Chadd wrote: >> Hi! >> >> This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer >> initialised before use /and/ it's part of a KASSERT() output. >> > > Are you building with an external toolchain? Nope; just head with invariants disabled. -a > best > Neel > >> Thanks! >> >> >> -a >> >> >> On 19 July 2014 13:59, Neel Natu wrote: >>> Author: neel >>> Date: Sat Jul 19 20:59:08 2014 >>> New Revision: 268889 >>> URL: http://svnweb.freebsd.org/changeset/base/268889 >>> >>> Log: >>> Handle nested exceptions in bhyve. >>> >>> A nested exception condition arises when a second exception is triggered while >>> delivering the first exception. Most nested exceptions can be handled serially >>> but some are converted into a double fault. If an exception is generated during >>> delivery of a double fault then the virtual machine shuts down as a result of >>> a triple fault. >>> >>> vm_exit_intinfo() is used to record that a VM-exit happened while an event was >>> being delivered through the IDT. If an exception is triggered while handling >>> the VM-exit it will be treated like a nested exception. >>> >>> vm_entry_intinfo() is used by processor-specific code to get the event to be >>> injected into the guest on the next VM-entry. This function is responsible for >>> deciding the disposition of nested exceptions. >>> >>> Modified: >>> head/lib/libvmmapi/vmmapi.c >>> head/lib/libvmmapi/vmmapi.h >>> head/sys/amd64/include/vmm.h >>> head/sys/amd64/include/vmm_dev.h >>> head/sys/amd64/vmm/intel/vmx.c >>> head/sys/amd64/vmm/vmm.c >>> head/sys/amd64/vmm/vmm_dev.c >>> head/usr.sbin/bhyve/bhyverun.c >>> head/usr.sbin/bhyve/task_switch.c >>> head/usr.sbin/bhyvectl/bhyvectl.c >>> >>> Modified: head/lib/libvmmapi/vmmapi.c >>> ============================================================================== >>> --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v >>> error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); >>> return (error); >>> } >>> + >>> +int >>> +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) >>> +{ >>> + struct vm_intinfo vmii; >>> + int error; >>> + >>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>> + vmii.vcpuid = vcpu; >>> + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); >>> + if (error == 0) { >>> + *info1 = vmii.info1; >>> + *info2 = vmii.info2; >>> + } >>> + return (error); >>> +} >>> + >>> +int >>> +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) >>> +{ >>> + struct vm_intinfo vmii; >>> + int error; >>> + >>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>> + vmii.vcpuid = vcpu; >>> + vmii.info1 = info1; >>> + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); >>> + return (error); >>> +} >>> >>> Modified: head/lib/libvmmapi/vmmapi.h >>> ============================================================================== >>> --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c >>> int func, int idx, uint64_t addr, uint64_t msg, >>> uint32_t vector_control); >>> >>> +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); >>> +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); >>> + >>> /* >>> * Return a pointer to the statistics buffer. Note that this is not MT-safe. >>> */ >>> >>> Modified: head/sys/amd64/include/vmm.h >>> ============================================================================== >>> --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -34,6 +34,7 @@ enum vm_suspend_how { >>> VM_SUSPEND_RESET, >>> VM_SUSPEND_POWEROFF, >>> VM_SUSPEND_HALT, >>> + VM_SUSPEND_TRIPLEFAULT, >>> VM_SUSPEND_LAST >>> }; >>> >>> @@ -88,6 +89,16 @@ enum x2apic_state { >>> X2APIC_STATE_LAST >>> }; >>> >>> +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) >>> +#define VM_INTINFO_DEL_ERRCODE 0x800 >>> +#define VM_INTINFO_RSVD 0x7ffff000 >>> +#define VM_INTINFO_VALID 0x80000000 >>> +#define VM_INTINFO_TYPE 0x700 >>> +#define VM_INTINFO_HWINTR (0 << 8) >>> +#define VM_INTINFO_NMI (2 << 8) >>> +#define VM_INTINFO_HWEXCEPTION (3 << 8) >>> +#define VM_INTINFO_SWINTR (4 << 8) >>> + >>> #ifdef _KERNEL >>> >>> #define VM_MAX_NAMELEN 32 >>> @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); >>> int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); >>> >>> /* >>> - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an >>> - * exception is pending and also updates 'vme'. The pending exception is >>> - * cleared when this function returns. >>> + * This function is called after a VM-exit that occurred during exception or >>> + * interrupt delivery through the IDT. The format of 'intinfo' is described >>> + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. >>> * >>> - * This function should only be called in the context of the thread that is >>> - * executing this vcpu. >>> + * If a VM-exit handler completes the event delivery successfully then it >>> + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., >>> + * if the task switch emulation is triggered via a task gate then it should >>> + * call this function with 'intinfo=0' to indicate that the external event >>> + * is not pending anymore. >>> + * >>> + * Return value is 0 on success and non-zero on failure. >>> */ >>> -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); >>> +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); >>> + >>> +/* >>> + * This function is called before every VM-entry to retrieve a pending >>> + * event that should be injected into the guest. This function combines >>> + * nested events into a double or triple fault. >>> + * >>> + * Returns 0 if there are no events that need to be injected into the guest >>> + * and non-zero otherwise. >>> + */ >>> +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); >>> + >>> +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); >>> >>> void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ >>> void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ >>> >>> Modified: head/sys/amd64/include/vmm_dev.h >>> ============================================================================== >>> --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -189,6 +189,12 @@ struct vm_cpuset { >>> #define VM_ACTIVE_CPUS 0 >>> #define VM_SUSPENDED_CPUS 1 >>> >>> +struct vm_intinfo { >>> + int vcpuid; >>> + uint64_t info1; >>> + uint64_t info2; >>> +}; >>> + >>> enum { >>> /* general routines */ >>> IOCNUM_ABIVERS = 0, >>> @@ -211,6 +217,8 @@ enum { >>> IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, >>> >>> /* interrupt injection */ >>> + IOCNUM_GET_INTINFO = 28, >>> + IOCNUM_SET_INTINFO = 29, >>> IOCNUM_INJECT_EXCEPTION = 30, >>> IOCNUM_LAPIC_IRQ = 31, >>> IOCNUM_INJECT_NMI = 32, >>> @@ -324,4 +332,8 @@ enum { >>> _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) >>> #define VM_GET_CPUS \ >>> _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) >>> +#define VM_SET_INTINFO \ >>> + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) >>> +#define VM_GET_INTINFO \ >>> + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) >>> #endif >>> >>> Modified: head/sys/amd64/vmm/intel/vmx.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >>> { >>> struct vm_exception exc; >>> int vector, need_nmi_exiting, extint_pending; >>> - uint64_t rflags; >>> + uint64_t rflags, entryinfo; >>> uint32_t gi, info; >>> >>> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >>> - KASSERT(exc.vector >= 0 && exc.vector < 32, >>> - ("%s: invalid exception vector %d", __func__, exc.vector)); >>> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >>> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >>> + "intinfo is not valid: %#lx", __func__, entryinfo)); >>> >>> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >>> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >>> "pending exception %d: %#x", __func__, exc.vector, info)); >>> >>> - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; >>> - if (exc.error_code_valid) { >>> - info |= VMCS_INTR_DEL_ERRCODE; >>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); >>> + info = entryinfo; >>> + vector = info & 0xff; >>> + if (vector == IDT_BP || vector == IDT_OF) { >>> + /* >>> + * VT-x requires #BP and #OF to be injected as software >>> + * exceptions. >>> + */ >>> + info &= ~VMCS_INTR_T_MASK; >>> + info |= VMCS_INTR_T_SWEXCEPTION; >>> } >>> + >>> + if (info & VMCS_INTR_DEL_ERRCODE) >>> + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); >>> + >>> vmcs_write(VMCS_ENTRY_INTR_INFO, info); >>> } >>> >>> @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, >>> vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); >>> } >>> >>> +static void >>> +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) >>> +{ >>> + uint32_t gi; >>> + >>> + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); >>> + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, >>> + ("NMI blocking is not in effect %#x", gi)); >>> +} >>> + >>> static int >>> vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) >>> { >>> @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>> struct vm_task_switch *ts; >>> uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; >>> uint32_t intr_type, reason; >>> - uint64_t qual, gpa; >>> + uint64_t exitintinfo, qual, gpa; >>> bool retu; >>> >>> CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); >>> @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc >>> * be handled specially by re-injecting the event if the IDT >>> * vectoring information field's valid bit is set. >>> * >>> - * If the VM-exit is due to a task gate in the IDT then we don't >>> - * reinject the event because emulating the task switch also >>> - * completes the event delivery. >>> - * >>> * See "Information for VM Exits During Event Delivery" in Intel SDM >>> * for details. >>> */ >>> - switch (reason) { >>> - case EXIT_REASON_EPT_FAULT: >>> - case EXIT_REASON_EPT_MISCONFIG: >>> - case EXIT_REASON_APIC_ACCESS: >>> - case EXIT_REASON_TASK_SWITCH: >>> - case EXIT_REASON_EXCEPTION: >>> - idtvec_info = vmcs_idt_vectoring_info(); >>> - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", >>> - exit_reason_to_str(reason), idtvec_info); >>> - if ((idtvec_info & VMCS_IDT_VEC_VALID) && >>> - (reason != EXIT_REASON_TASK_SWITCH)) { >>> - idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>> - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); >>> - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>> - idtvec_err = vmcs_idt_vectoring_err(); >>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, >>> - idtvec_err); >>> - } >>> - /* >>> - * If 'virtual NMIs' are being used and the VM-exit >>> - * happened while injecting an NMI during the previous >>> - * VM-entry, then clear "blocking by NMI" in the Guest >>> - * Interruptibility-state. >>> - */ >>> - if ((idtvec_info & VMCS_INTR_T_MASK) == >>> - VMCS_INTR_T_NMI) { >>> - vmx_clear_nmi_blocking(vmx, vcpu); >>> - } >>> + idtvec_info = vmcs_idt_vectoring_info(); >>> + if (idtvec_info & VMCS_IDT_VEC_VALID) { >>> + idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>> + exitintinfo = idtvec_info; >>> + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>> + idtvec_err = vmcs_idt_vectoring_err(); >>> + exitintinfo |= (uint64_t)idtvec_err << 32; >>> + } >>> + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); >>> + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", >>> + __func__, error)); >>> + >>> + /* >>> + * If 'virtual NMIs' are being used and the VM-exit >>> + * happened while injecting an NMI during the previous >>> + * VM-entry, then clear "blocking by NMI" in the >>> + * Guest Interruptibility-State so the NMI can be >>> + * reinjected on the subsequent VM-entry. >>> + * >>> + * However, if the NMI was being delivered through a task >>> + * gate, then the new task must start execution with NMIs >>> + * blocked so don't clear NMI blocking in this case. >>> + */ >>> + intr_type = idtvec_info & VMCS_INTR_T_MASK; >>> + if (intr_type == VMCS_INTR_T_NMI) { >>> + if (reason != EXIT_REASON_TASK_SWITCH) >>> + vmx_clear_nmi_blocking(vmx, vcpu); >>> + else >>> + vmx_assert_nmi_blocking(vmx, vcpu); >>> + } >>> + >>> + /* >>> + * Update VM-entry instruction length if the event being >>> + * delivered was a software interrupt or software exception. >>> + */ >>> + if (intr_type == VMCS_INTR_T_SWINTR || >>> + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || >>> + intr_type == VMCS_INTR_T_SWEXCEPTION) { >>> vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); >>> } >>> - break; >>> - default: >>> - idtvec_info = 0; >>> - break; >>> } >>> >>> switch (reason) { >>> @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>> */ >>> if (ts->reason == TSR_IDT_GATE) { >>> KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, >>> - ("invalid idtvec_info %x for IDT task switch", >>> + ("invalid idtvec_info %#x for IDT task switch", >>> idtvec_info)); >>> intr_type = idtvec_info & VMCS_INTR_T_MASK; >>> if (intr_type != VMCS_INTR_T_SWINTR && >>> @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>> * the guest. >>> * >>> * See "Resuming Guest Software after Handling an Exception". >>> + * See "Information for VM Exits Due to Vectored Events". >>> */ >>> if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && >>> (intr_info & 0xff) != IDT_DF && >>> @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t >>> * pmap_invalidate_ept(). >>> */ >>> disable_intr(); >>> + vmx_inject_interrupts(vmx, vcpu, vlapic); >>> + >>> + /* >>> + * Check for vcpu suspension after injecting events because >>> + * vmx_inject_interrupts() can suspend the vcpu due to a >>> + * triple fault. >>> + */ >>> if (vcpu_suspended(suspend_cookie)) { >>> enable_intr(); >>> vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); >>> @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t >>> break; >>> } >>> >>> - vmx_inject_interrupts(vmx, vcpu, vlapic); >>> vmx_run_trace(vmx, vcpu); >>> rc = vmx_enter_guest(vmxctx, vmx, launched); >>> >>> >>> Modified: head/sys/amd64/vmm/vmm.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -97,6 +97,7 @@ struct vcpu { >>> int hostcpu; /* (o) vcpu's host cpu */ >>> struct vlapic *vlapic; /* (i) APIC device model */ >>> enum x2apic_state x2apic_state; /* (i) APIC mode */ >>> + uint64_t exitintinfo; /* (i) events pending at VM exit */ >>> int nmi_pending; /* (i) NMI pending */ >>> int extint_pending; /* (i) INTR pending */ >>> struct vm_exception exception; /* (x) exception collateral */ >>> @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo >>> >>> vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); >>> vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); >>> + vcpu->exitintinfo = 0; >>> vcpu->nmi_pending = 0; >>> vcpu->extint_pending = 0; >>> vcpu->exception_pending = 0; >>> @@ -1458,6 +1460,202 @@ restart: >>> } >>> >>> int >>> +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) >>> +{ >>> + struct vcpu *vcpu; >>> + int type, vector; >>> + >>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>> + return (EINVAL); >>> + >>> + vcpu = &vm->vcpu[vcpuid]; >>> + >>> + if (info & VM_INTINFO_VALID) { >>> + type = info & VM_INTINFO_TYPE; >>> + vector = info & 0xff; >>> + if (type == VM_INTINFO_NMI && vector != IDT_NMI) >>> + return (EINVAL); >>> + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) >>> + return (EINVAL); >>> + if (info & VM_INTINFO_RSVD) >>> + return (EINVAL); >>> + } else { >>> + info = 0; >>> + } >>> + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); >>> + vcpu->exitintinfo = info; >>> + return (0); >>> +} >>> + >>> +enum exc_class { >>> + EXC_BENIGN, >>> + EXC_CONTRIBUTORY, >>> + EXC_PAGEFAULT >>> +}; >>> + >>> +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ >>> + >>> +static enum exc_class >>> +exception_class(uint64_t info) >>> +{ >>> + int type, vector; >>> + >>> + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); >>> + type = info & VM_INTINFO_TYPE; >>> + vector = info & 0xff; >>> + >>> + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ >>> + switch (type) { >>> + case VM_INTINFO_HWINTR: >>> + case VM_INTINFO_SWINTR: >>> + case VM_INTINFO_NMI: >>> + return (EXC_BENIGN); >>> + default: >>> + /* >>> + * Hardware exception. >>> + * >>> + * SVM and VT-x use identical type values to represent NMI, >>> + * hardware interrupt and software interrupt. >>> + * >>> + * SVM uses type '3' for all exceptions. VT-x uses type '3' >>> + * for exceptions except #BP and #OF. #BP and #OF use a type >>> + * value of '5' or '6'. Therefore we don't check for explicit >>> + * values of 'type' to classify 'intinfo' into a hardware >>> + * exception. >>> + */ >>> + break; >>> + } >>> + >>> + switch (vector) { >>> + case IDT_PF: >>> + case IDT_VE: >>> + return (EXC_PAGEFAULT); >>> + case IDT_DE: >>> + case IDT_TS: >>> + case IDT_NP: >>> + case IDT_SS: >>> + case IDT_GP: >>> + return (EXC_CONTRIBUTORY); >>> + default: >>> + return (EXC_BENIGN); >>> + } >>> +} >>> + >>> +static int >>> +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, >>> + uint64_t *retinfo) >>> +{ >>> + enum exc_class exc1, exc2; >>> + int type1, vector1; >>> + >>> + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); >>> + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); >>> + >>> + /* >>> + * If an exception occurs while attempting to call the double-fault >>> + * handler the processor enters shutdown mode (aka triple fault). >>> + */ >>> + type1 = info1 & VM_INTINFO_TYPE; >>> + vector1 = info1 & 0xff; >>> + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { >>> + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", >>> + info1, info2); >>> + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); >>> + *retinfo = 0; >>> + return (0); >>> + } >>> + >>> + /* >>> + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 >>> + */ >>> + exc1 = exception_class(info1); >>> + exc2 = exception_class(info2); >>> + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || >>> + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { >>> + /* Convert nested fault into a double fault. */ >>> + *retinfo = IDT_DF; >>> + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>> + *retinfo |= VM_INTINFO_DEL_ERRCODE; >>> + } else { >>> + /* Handle exceptions serially */ >>> + *retinfo = info2; >>> + } >>> + return (1); >>> +} >>> + >>> +static uint64_t >>> +vcpu_exception_intinfo(struct vcpu *vcpu) >>> +{ >>> + uint64_t info = 0; >>> + >>> + if (vcpu->exception_pending) { >>> + info = vcpu->exception.vector & 0xff; >>> + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>> + if (vcpu->exception.error_code_valid) { >>> + info |= VM_INTINFO_DEL_ERRCODE; >>> + info |= (uint64_t)vcpu->exception.error_code << 32; >>> + } >>> + } >>> + return (info); >>> +} >>> + >>> +int >>> +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) >>> +{ >>> + struct vcpu *vcpu; >>> + uint64_t info1, info2; >>> + int valid; >>> + >>> + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>> + >>> + vcpu = &vm->vcpu[vcpuid]; >>> + >>> + info1 = vcpu->exitintinfo; >>> + vcpu->exitintinfo = 0; >>> + >>> + info2 = 0; >>> + if (vcpu->exception_pending) { >>> + info2 = vcpu_exception_intinfo(vcpu); >>> + vcpu->exception_pending = 0; >>> + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", >>> + vcpu->exception.vector, info2); >>> + } >>> + >>> + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { >>> + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); >>> + } else if (info1 & VM_INTINFO_VALID) { >>> + *retinfo = info1; >>> + valid = 1; >>> + } else if (info2 & VM_INTINFO_VALID) { >>> + *retinfo = info2; >>> + valid = 1; >>> + } else { >>> + valid = 0; >>> + } >>> + >>> + if (valid) { >>> + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " >>> + "retinfo(%#lx)", __func__, info1, info2, *retinfo); >>> + } >>> + >>> + return (valid); >>> +} >>> + >>> +int >>> +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) >>> +{ >>> + struct vcpu *vcpu; >>> + >>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>> + return (EINVAL); >>> + >>> + vcpu = &vm->vcpu[vcpuid]; >>> + *info1 = vcpu->exitintinfo; >>> + *info2 = vcpu_exception_intinfo(vcpu); >>> + return (0); >>> +} >>> + >>> +int >>> vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) >>> { >>> struct vcpu *vcpu; >>> @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v >>> if (exception->vector < 0 || exception->vector >= 32) >>> return (EINVAL); >>> >>> + /* >>> + * A double fault exception should never be injected directly into >>> + * the guest. It is a derived exception that results from specific >>> + * combinations of nested faults. >>> + */ >>> + if (exception->vector == IDT_DF) >>> + return (EINVAL); >>> + >>> vcpu = &vm->vcpu[vcpuid]; >>> >>> if (vcpu->exception_pending) { >>> @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v >>> return (0); >>> } >>> >>> -int >>> -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) >>> -{ >>> - struct vcpu *vcpu; >>> - int pending; >>> - >>> - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>> - >>> - vcpu = &vm->vcpu[vcpuid]; >>> - pending = vcpu->exception_pending; >>> - if (pending) { >>> - vcpu->exception_pending = 0; >>> - *exception = vcpu->exception; >>> - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", >>> - exception->vector); >>> - } >>> - return (pending); >>> -} >>> - >>> static void >>> vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) >>> { >>> >>> Modified: head/sys/amd64/vmm/vmm_dev.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>> struct vm_gla2gpa *gg; >>> struct vm_activate_cpu *vac; >>> struct vm_cpuset *vm_cpuset; >>> + struct vm_intinfo *vmii; >>> >>> sc = vmmdev_lookup2(cdev); >>> if (sc == NULL) >>> @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>> case VM_SET_X2APIC_STATE: >>> case VM_GLA2GPA: >>> case VM_ACTIVATE_CPU: >>> + case VM_SET_INTINFO: >>> + case VM_GET_INTINFO: >>> /* >>> * XXX fragile, handle with care >>> * Assumes that the first field of the ioctl data is the vcpu. >>> @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>> error = copyout(cpuset, vm_cpuset->cpus, size); >>> free(cpuset, M_TEMP); >>> break; >>> + case VM_SET_INTINFO: >>> + vmii = (struct vm_intinfo *)data; >>> + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); >>> + break; >>> + case VM_GET_INTINFO: >>> + vmii = (struct vm_intinfo *)data; >>> + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, >>> + &vmii->info2); >>> + break; >>> default: >>> error = ENOTTY; >>> break; >>> >>> Modified: head/usr.sbin/bhyve/bhyverun.c >>> ============================================================================== >>> --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct >>> exit(1); >>> case VM_SUSPEND_HALT: >>> exit(2); >>> + case VM_SUSPEND_TRIPLEFAULT: >>> + exit(3); >>> default: >>> fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); >>> exit(100); >>> >>> Modified: head/usr.sbin/bhyve/task_switch.c >>> ============================================================================== >>> --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st >>> */ >>> >>> /* >>> - * XXX is the original task switch was triggered by a hardware >>> - * exception then do we generate a double-fault if we encounter >>> - * an exception during the task switch? >>> + * If the task switch was triggered by an event delivered through >>> + * the IDT then extinguish the pending event from the vcpu's >>> + * exitintinfo. >>> */ >>> + if (task_switch->reason == TSR_IDT_GATE) { >>> + error = vm_set_intinfo(ctx, vcpu, 0); >>> + assert(error == 0); >>> + } >>> >>> /* >>> * XXX should inject debug exception if 'T' bit is 1 >>> >>> Modified: head/usr.sbin/bhyvectl/bhyvectl.c >>> ============================================================================== >>> --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -195,7 +195,8 @@ usage(void) >>> " [--force-reset]\n" >>> " [--force-poweroff]\n" >>> " [--get-active-cpus]\n" >>> - " [--get-suspended-cpus]\n", >>> + " [--get-suspended-cpus]\n" >>> + " [--get-intinfo]\n", >>> progname); >>> exit(1); >>> } >>> @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; >>> static int force_reset, force_poweroff; >>> static const char *capname; >>> static int create, destroy, get_lowmem, get_highmem; >>> +static int get_intinfo; >>> static int get_active_cpus, get_suspended_cpus; >>> static uint64_t memsize; >>> static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; >>> @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu >>> printf("\n"); >>> } >>> >>> +static void >>> +print_intinfo(const char *banner, uint64_t info) >>> +{ >>> + int type; >>> + >>> + printf("%s:\t", banner); >>> + if (info & VM_INTINFO_VALID) { >>> + type = info & VM_INTINFO_TYPE; >>> + switch (type) { >>> + case VM_INTINFO_HWINTR: >>> + printf("extint"); >>> + break; >>> + case VM_INTINFO_NMI: >>> + printf("nmi"); >>> + break; >>> + case VM_INTINFO_SWINTR: >>> + printf("swint"); >>> + break; >>> + default: >>> + printf("exception"); >>> + break; >>> + } >>> + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); >>> + if (info & VM_INTINFO_DEL_ERRCODE) >>> + printf(" errcode %#x", (u_int)(info >> 32)); >>> + } else { >>> + printf("n/a"); >>> + } >>> + printf("\n"); >>> +} >>> + >>> int >>> main(int argc, char *argv[]) >>> { >>> @@ -420,7 +453,7 @@ main(int argc, char *argv[]) >>> vm_paddr_t gpa, gpa_pmap; >>> size_t len; >>> struct vm_exit vmexit; >>> - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; >>> + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; >>> struct vmctx *ctx; >>> int wired; >>> cpuset_t cpus; >>> @@ -595,6 +628,7 @@ main(int argc, char *argv[]) >>> { "force-poweroff", NO_ARG, &force_poweroff, 1 }, >>> { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, >>> { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, >>> + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, >>> { NULL, 0, NULL, 0 } >>> }; >>> >>> @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) >>> print_cpus("suspended cpus", &cpus); >>> } >>> >>> + if (!error && (get_intinfo || get_all)) { >>> + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); >>> + if (!error) { >>> + print_intinfo("pending", info[0]); >>> + print_intinfo("current", info[1]); >>> + } >>> + } >>> + >>> if (!error && run) { >>> error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); >>> assert(error == 0); >>> From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 07:54:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B5A25F2; Sun, 20 Jul 2014 07:54:52 +0000 (UTC) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121A32C7B; Sun, 20 Jul 2014 07:54:52 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id j107so4364557qga.36 for ; Sun, 20 Jul 2014 00:54:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=2uKyvxrfl6v1BuNqOppUzPnxYUBWfVfqyiNtdx0SgFY=; b=06+QSH8xtd8VQp9prGSJhZp9sgsRWhLfx7Ey6/igXzF+orjTFraNxz5311QDuIeMcc WNXPh2u9VWZFasYKTIyZlI1joX1lJNxQglJN/EY0gFIoIAVGMOLV+zwRsm51XuGdrJ9x PEIuAUet5i3YDqY6JZIE0rrvv12mBahjzltp89XHUIXDNCUyOzuTv/B4+bUqGhljcYZr rsuX0W0IBMa0TFhhIPxXx+ZrdSto71HjfSyZfWUY241+dwf5mS0vLDuCeLa7AUY6yqfC 5Yytei1QLD4IOcMvofisAIEP/MeU9VS6r7PVPgaYEvE759hq10geKry7C1olDOcTOR9v dqtg== MIME-Version: 1.0 X-Received: by 10.224.167.136 with SMTP id q8mr26510537qay.35.1405842891248; Sun, 20 Jul 2014 00:54:51 -0700 (PDT) Received: by 10.140.48.37 with HTTP; Sun, 20 Jul 2014 00:54:51 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> Date: Sun, 20 Jul 2014 00:54:51 -0700 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Neel Natu To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 07:54:52 -0000 Hi Adrian, On Sun, Jul 20, 2014 at 12:48 AM, Adrian Chadd wrote: > On 20 July 2014 00:47, Neel Natu wrote: >> Hi Adrian, >> >> On Sat, Jul 19, 2014 at 11:30 PM, Adrian Chadd wrote: >>> Hi! >>> >>> This broke -HEAD. 'exc' in vmx_inject_interrupts() is no longer >>> initialised before use /and/ it's part of a KASSERT() output. >>> >> >> Are you building with an external toolchain? > > Nope; just head with invariants disabled. > Ok, so it broke your custom kernel config as opposed to breaking HEAD. I'll fix it shortly. best Neel > > > -a > >> best >> Neel >> >>> Thanks! >>> >>> >>> -a >>> >>> >>> On 19 July 2014 13:59, Neel Natu wrote: >>>> Author: neel >>>> Date: Sat Jul 19 20:59:08 2014 >>>> New Revision: 268889 >>>> URL: http://svnweb.freebsd.org/changeset/base/268889 >>>> >>>> Log: >>>> Handle nested exceptions in bhyve. >>>> >>>> A nested exception condition arises when a second exception is triggered while >>>> delivering the first exception. Most nested exceptions can be handled serially >>>> but some are converted into a double fault. If an exception is generated during >>>> delivery of a double fault then the virtual machine shuts down as a result of >>>> a triple fault. >>>> >>>> vm_exit_intinfo() is used to record that a VM-exit happened while an event was >>>> being delivered through the IDT. If an exception is triggered while handling >>>> the VM-exit it will be treated like a nested exception. >>>> >>>> vm_entry_intinfo() is used by processor-specific code to get the event to be >>>> injected into the guest on the next VM-entry. This function is responsible for >>>> deciding the disposition of nested exceptions. >>>> >>>> Modified: >>>> head/lib/libvmmapi/vmmapi.c >>>> head/lib/libvmmapi/vmmapi.h >>>> head/sys/amd64/include/vmm.h >>>> head/sys/amd64/include/vmm_dev.h >>>> head/sys/amd64/vmm/intel/vmx.c >>>> head/sys/amd64/vmm/vmm.c >>>> head/sys/amd64/vmm/vmm_dev.c >>>> head/usr.sbin/bhyve/bhyverun.c >>>> head/usr.sbin/bhyve/task_switch.c >>>> head/usr.sbin/bhyvectl/bhyvectl.c >>>> >>>> Modified: head/lib/libvmmapi/vmmapi.c >>>> ============================================================================== >>>> --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v >>>> error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); >>>> return (error); >>>> } >>>> + >>>> +int >>>> +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) >>>> +{ >>>> + struct vm_intinfo vmii; >>>> + int error; >>>> + >>>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>>> + vmii.vcpuid = vcpu; >>>> + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); >>>> + if (error == 0) { >>>> + *info1 = vmii.info1; >>>> + *info2 = vmii.info2; >>>> + } >>>> + return (error); >>>> +} >>>> + >>>> +int >>>> +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) >>>> +{ >>>> + struct vm_intinfo vmii; >>>> + int error; >>>> + >>>> + bzero(&vmii, sizeof(struct vm_intinfo)); >>>> + vmii.vcpuid = vcpu; >>>> + vmii.info1 = info1; >>>> + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); >>>> + return (error); >>>> +} >>>> >>>> Modified: head/lib/libvmmapi/vmmapi.h >>>> ============================================================================== >>>> --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c >>>> int func, int idx, uint64_t addr, uint64_t msg, >>>> uint32_t vector_control); >>>> >>>> +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); >>>> +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); >>>> + >>>> /* >>>> * Return a pointer to the statistics buffer. Note that this is not MT-safe. >>>> */ >>>> >>>> Modified: head/sys/amd64/include/vmm.h >>>> ============================================================================== >>>> --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -34,6 +34,7 @@ enum vm_suspend_how { >>>> VM_SUSPEND_RESET, >>>> VM_SUSPEND_POWEROFF, >>>> VM_SUSPEND_HALT, >>>> + VM_SUSPEND_TRIPLEFAULT, >>>> VM_SUSPEND_LAST >>>> }; >>>> >>>> @@ -88,6 +89,16 @@ enum x2apic_state { >>>> X2APIC_STATE_LAST >>>> }; >>>> >>>> +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) >>>> +#define VM_INTINFO_DEL_ERRCODE 0x800 >>>> +#define VM_INTINFO_RSVD 0x7ffff000 >>>> +#define VM_INTINFO_VALID 0x80000000 >>>> +#define VM_INTINFO_TYPE 0x700 >>>> +#define VM_INTINFO_HWINTR (0 << 8) >>>> +#define VM_INTINFO_NMI (2 << 8) >>>> +#define VM_INTINFO_HWEXCEPTION (3 << 8) >>>> +#define VM_INTINFO_SWINTR (4 << 8) >>>> + >>>> #ifdef _KERNEL >>>> >>>> #define VM_MAX_NAMELEN 32 >>>> @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); >>>> int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); >>>> >>>> /* >>>> - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an >>>> - * exception is pending and also updates 'vme'. The pending exception is >>>> - * cleared when this function returns. >>>> + * This function is called after a VM-exit that occurred during exception or >>>> + * interrupt delivery through the IDT. The format of 'intinfo' is described >>>> + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. >>>> * >>>> - * This function should only be called in the context of the thread that is >>>> - * executing this vcpu. >>>> + * If a VM-exit handler completes the event delivery successfully then it >>>> + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., >>>> + * if the task switch emulation is triggered via a task gate then it should >>>> + * call this function with 'intinfo=0' to indicate that the external event >>>> + * is not pending anymore. >>>> + * >>>> + * Return value is 0 on success and non-zero on failure. >>>> */ >>>> -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); >>>> +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); >>>> + >>>> +/* >>>> + * This function is called before every VM-entry to retrieve a pending >>>> + * event that should be injected into the guest. This function combines >>>> + * nested events into a double or triple fault. >>>> + * >>>> + * Returns 0 if there are no events that need to be injected into the guest >>>> + * and non-zero otherwise. >>>> + */ >>>> +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); >>>> + >>>> +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); >>>> >>>> void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ >>>> void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ >>>> >>>> Modified: head/sys/amd64/include/vmm_dev.h >>>> ============================================================================== >>>> --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -189,6 +189,12 @@ struct vm_cpuset { >>>> #define VM_ACTIVE_CPUS 0 >>>> #define VM_SUSPENDED_CPUS 1 >>>> >>>> +struct vm_intinfo { >>>> + int vcpuid; >>>> + uint64_t info1; >>>> + uint64_t info2; >>>> +}; >>>> + >>>> enum { >>>> /* general routines */ >>>> IOCNUM_ABIVERS = 0, >>>> @@ -211,6 +217,8 @@ enum { >>>> IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, >>>> >>>> /* interrupt injection */ >>>> + IOCNUM_GET_INTINFO = 28, >>>> + IOCNUM_SET_INTINFO = 29, >>>> IOCNUM_INJECT_EXCEPTION = 30, >>>> IOCNUM_LAPIC_IRQ = 31, >>>> IOCNUM_INJECT_NMI = 32, >>>> @@ -324,4 +332,8 @@ enum { >>>> _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) >>>> #define VM_GET_CPUS \ >>>> _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) >>>> +#define VM_SET_INTINFO \ >>>> + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) >>>> +#define VM_GET_INTINFO \ >>>> + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) >>>> #endif >>>> >>>> Modified: head/sys/amd64/vmm/intel/vmx.c >>>> ============================================================================== >>>> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >>>> { >>>> struct vm_exception exc; >>>> int vector, need_nmi_exiting, extint_pending; >>>> - uint64_t rflags; >>>> + uint64_t rflags, entryinfo; >>>> uint32_t gi, info; >>>> >>>> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >>>> - KASSERT(exc.vector >= 0 && exc.vector < 32, >>>> - ("%s: invalid exception vector %d", __func__, exc.vector)); >>>> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >>>> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >>>> + "intinfo is not valid: %#lx", __func__, entryinfo)); >>>> >>>> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >>>> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >>>> "pending exception %d: %#x", __func__, exc.vector, info)); >>>> >>>> - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; >>>> - if (exc.error_code_valid) { >>>> - info |= VMCS_INTR_DEL_ERRCODE; >>>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); >>>> + info = entryinfo; >>>> + vector = info & 0xff; >>>> + if (vector == IDT_BP || vector == IDT_OF) { >>>> + /* >>>> + * VT-x requires #BP and #OF to be injected as software >>>> + * exceptions. >>>> + */ >>>> + info &= ~VMCS_INTR_T_MASK; >>>> + info |= VMCS_INTR_T_SWEXCEPTION; >>>> } >>>> + >>>> + if (info & VMCS_INTR_DEL_ERRCODE) >>>> + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); >>>> + >>>> vmcs_write(VMCS_ENTRY_INTR_INFO, info); >>>> } >>>> >>>> @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, >>>> vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); >>>> } >>>> >>>> +static void >>>> +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) >>>> +{ >>>> + uint32_t gi; >>>> + >>>> + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); >>>> + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, >>>> + ("NMI blocking is not in effect %#x", gi)); >>>> +} >>>> + >>>> static int >>>> vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) >>>> { >>>> @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> struct vm_task_switch *ts; >>>> uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; >>>> uint32_t intr_type, reason; >>>> - uint64_t qual, gpa; >>>> + uint64_t exitintinfo, qual, gpa; >>>> bool retu; >>>> >>>> CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); >>>> @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> * be handled specially by re-injecting the event if the IDT >>>> * vectoring information field's valid bit is set. >>>> * >>>> - * If the VM-exit is due to a task gate in the IDT then we don't >>>> - * reinject the event because emulating the task switch also >>>> - * completes the event delivery. >>>> - * >>>> * See "Information for VM Exits During Event Delivery" in Intel SDM >>>> * for details. >>>> */ >>>> - switch (reason) { >>>> - case EXIT_REASON_EPT_FAULT: >>>> - case EXIT_REASON_EPT_MISCONFIG: >>>> - case EXIT_REASON_APIC_ACCESS: >>>> - case EXIT_REASON_TASK_SWITCH: >>>> - case EXIT_REASON_EXCEPTION: >>>> - idtvec_info = vmcs_idt_vectoring_info(); >>>> - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", >>>> - exit_reason_to_str(reason), idtvec_info); >>>> - if ((idtvec_info & VMCS_IDT_VEC_VALID) && >>>> - (reason != EXIT_REASON_TASK_SWITCH)) { >>>> - idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>>> - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); >>>> - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>>> - idtvec_err = vmcs_idt_vectoring_err(); >>>> - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, >>>> - idtvec_err); >>>> - } >>>> - /* >>>> - * If 'virtual NMIs' are being used and the VM-exit >>>> - * happened while injecting an NMI during the previous >>>> - * VM-entry, then clear "blocking by NMI" in the Guest >>>> - * Interruptibility-state. >>>> - */ >>>> - if ((idtvec_info & VMCS_INTR_T_MASK) == >>>> - VMCS_INTR_T_NMI) { >>>> - vmx_clear_nmi_blocking(vmx, vcpu); >>>> - } >>>> + idtvec_info = vmcs_idt_vectoring_info(); >>>> + if (idtvec_info & VMCS_IDT_VEC_VALID) { >>>> + idtvec_info &= ~(1 << 12); /* clear undefined bit */ >>>> + exitintinfo = idtvec_info; >>>> + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { >>>> + idtvec_err = vmcs_idt_vectoring_err(); >>>> + exitintinfo |= (uint64_t)idtvec_err << 32; >>>> + } >>>> + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); >>>> + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", >>>> + __func__, error)); >>>> + >>>> + /* >>>> + * If 'virtual NMIs' are being used and the VM-exit >>>> + * happened while injecting an NMI during the previous >>>> + * VM-entry, then clear "blocking by NMI" in the >>>> + * Guest Interruptibility-State so the NMI can be >>>> + * reinjected on the subsequent VM-entry. >>>> + * >>>> + * However, if the NMI was being delivered through a task >>>> + * gate, then the new task must start execution with NMIs >>>> + * blocked so don't clear NMI blocking in this case. >>>> + */ >>>> + intr_type = idtvec_info & VMCS_INTR_T_MASK; >>>> + if (intr_type == VMCS_INTR_T_NMI) { >>>> + if (reason != EXIT_REASON_TASK_SWITCH) >>>> + vmx_clear_nmi_blocking(vmx, vcpu); >>>> + else >>>> + vmx_assert_nmi_blocking(vmx, vcpu); >>>> + } >>>> + >>>> + /* >>>> + * Update VM-entry instruction length if the event being >>>> + * delivered was a software interrupt or software exception. >>>> + */ >>>> + if (intr_type == VMCS_INTR_T_SWINTR || >>>> + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || >>>> + intr_type == VMCS_INTR_T_SWEXCEPTION) { >>>> vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); >>>> } >>>> - break; >>>> - default: >>>> - idtvec_info = 0; >>>> - break; >>>> } >>>> >>>> switch (reason) { >>>> @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> */ >>>> if (ts->reason == TSR_IDT_GATE) { >>>> KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, >>>> - ("invalid idtvec_info %x for IDT task switch", >>>> + ("invalid idtvec_info %#x for IDT task switch", >>>> idtvec_info)); >>>> intr_type = idtvec_info & VMCS_INTR_T_MASK; >>>> if (intr_type != VMCS_INTR_T_SWINTR && >>>> @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc >>>> * the guest. >>>> * >>>> * See "Resuming Guest Software after Handling an Exception". >>>> + * See "Information for VM Exits Due to Vectored Events". >>>> */ >>>> if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && >>>> (intr_info & 0xff) != IDT_DF && >>>> @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t >>>> * pmap_invalidate_ept(). >>>> */ >>>> disable_intr(); >>>> + vmx_inject_interrupts(vmx, vcpu, vlapic); >>>> + >>>> + /* >>>> + * Check for vcpu suspension after injecting events because >>>> + * vmx_inject_interrupts() can suspend the vcpu due to a >>>> + * triple fault. >>>> + */ >>>> if (vcpu_suspended(suspend_cookie)) { >>>> enable_intr(); >>>> vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); >>>> @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t >>>> break; >>>> } >>>> >>>> - vmx_inject_interrupts(vmx, vcpu, vlapic); >>>> vmx_run_trace(vmx, vcpu); >>>> rc = vmx_enter_guest(vmxctx, vmx, launched); >>>> >>>> >>>> Modified: head/sys/amd64/vmm/vmm.c >>>> ============================================================================== >>>> --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -97,6 +97,7 @@ struct vcpu { >>>> int hostcpu; /* (o) vcpu's host cpu */ >>>> struct vlapic *vlapic; /* (i) APIC device model */ >>>> enum x2apic_state x2apic_state; /* (i) APIC mode */ >>>> + uint64_t exitintinfo; /* (i) events pending at VM exit */ >>>> int nmi_pending; /* (i) NMI pending */ >>>> int extint_pending; /* (i) INTR pending */ >>>> struct vm_exception exception; /* (x) exception collateral */ >>>> @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo >>>> >>>> vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); >>>> vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); >>>> + vcpu->exitintinfo = 0; >>>> vcpu->nmi_pending = 0; >>>> vcpu->extint_pending = 0; >>>> vcpu->exception_pending = 0; >>>> @@ -1458,6 +1460,202 @@ restart: >>>> } >>>> >>>> int >>>> +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) >>>> +{ >>>> + struct vcpu *vcpu; >>>> + int type, vector; >>>> + >>>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>>> + return (EINVAL); >>>> + >>>> + vcpu = &vm->vcpu[vcpuid]; >>>> + >>>> + if (info & VM_INTINFO_VALID) { >>>> + type = info & VM_INTINFO_TYPE; >>>> + vector = info & 0xff; >>>> + if (type == VM_INTINFO_NMI && vector != IDT_NMI) >>>> + return (EINVAL); >>>> + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) >>>> + return (EINVAL); >>>> + if (info & VM_INTINFO_RSVD) >>>> + return (EINVAL); >>>> + } else { >>>> + info = 0; >>>> + } >>>> + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); >>>> + vcpu->exitintinfo = info; >>>> + return (0); >>>> +} >>>> + >>>> +enum exc_class { >>>> + EXC_BENIGN, >>>> + EXC_CONTRIBUTORY, >>>> + EXC_PAGEFAULT >>>> +}; >>>> + >>>> +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ >>>> + >>>> +static enum exc_class >>>> +exception_class(uint64_t info) >>>> +{ >>>> + int type, vector; >>>> + >>>> + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); >>>> + type = info & VM_INTINFO_TYPE; >>>> + vector = info & 0xff; >>>> + >>>> + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ >>>> + switch (type) { >>>> + case VM_INTINFO_HWINTR: >>>> + case VM_INTINFO_SWINTR: >>>> + case VM_INTINFO_NMI: >>>> + return (EXC_BENIGN); >>>> + default: >>>> + /* >>>> + * Hardware exception. >>>> + * >>>> + * SVM and VT-x use identical type values to represent NMI, >>>> + * hardware interrupt and software interrupt. >>>> + * >>>> + * SVM uses type '3' for all exceptions. VT-x uses type '3' >>>> + * for exceptions except #BP and #OF. #BP and #OF use a type >>>> + * value of '5' or '6'. Therefore we don't check for explicit >>>> + * values of 'type' to classify 'intinfo' into a hardware >>>> + * exception. >>>> + */ >>>> + break; >>>> + } >>>> + >>>> + switch (vector) { >>>> + case IDT_PF: >>>> + case IDT_VE: >>>> + return (EXC_PAGEFAULT); >>>> + case IDT_DE: >>>> + case IDT_TS: >>>> + case IDT_NP: >>>> + case IDT_SS: >>>> + case IDT_GP: >>>> + return (EXC_CONTRIBUTORY); >>>> + default: >>>> + return (EXC_BENIGN); >>>> + } >>>> +} >>>> + >>>> +static int >>>> +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, >>>> + uint64_t *retinfo) >>>> +{ >>>> + enum exc_class exc1, exc2; >>>> + int type1, vector1; >>>> + >>>> + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); >>>> + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); >>>> + >>>> + /* >>>> + * If an exception occurs while attempting to call the double-fault >>>> + * handler the processor enters shutdown mode (aka triple fault). >>>> + */ >>>> + type1 = info1 & VM_INTINFO_TYPE; >>>> + vector1 = info1 & 0xff; >>>> + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { >>>> + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", >>>> + info1, info2); >>>> + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); >>>> + *retinfo = 0; >>>> + return (0); >>>> + } >>>> + >>>> + /* >>>> + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 >>>> + */ >>>> + exc1 = exception_class(info1); >>>> + exc2 = exception_class(info2); >>>> + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || >>>> + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { >>>> + /* Convert nested fault into a double fault. */ >>>> + *retinfo = IDT_DF; >>>> + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>>> + *retinfo |= VM_INTINFO_DEL_ERRCODE; >>>> + } else { >>>> + /* Handle exceptions serially */ >>>> + *retinfo = info2; >>>> + } >>>> + return (1); >>>> +} >>>> + >>>> +static uint64_t >>>> +vcpu_exception_intinfo(struct vcpu *vcpu) >>>> +{ >>>> + uint64_t info = 0; >>>> + >>>> + if (vcpu->exception_pending) { >>>> + info = vcpu->exception.vector & 0xff; >>>> + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; >>>> + if (vcpu->exception.error_code_valid) { >>>> + info |= VM_INTINFO_DEL_ERRCODE; >>>> + info |= (uint64_t)vcpu->exception.error_code << 32; >>>> + } >>>> + } >>>> + return (info); >>>> +} >>>> + >>>> +int >>>> +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) >>>> +{ >>>> + struct vcpu *vcpu; >>>> + uint64_t info1, info2; >>>> + int valid; >>>> + >>>> + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>>> + >>>> + vcpu = &vm->vcpu[vcpuid]; >>>> + >>>> + info1 = vcpu->exitintinfo; >>>> + vcpu->exitintinfo = 0; >>>> + >>>> + info2 = 0; >>>> + if (vcpu->exception_pending) { >>>> + info2 = vcpu_exception_intinfo(vcpu); >>>> + vcpu->exception_pending = 0; >>>> + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", >>>> + vcpu->exception.vector, info2); >>>> + } >>>> + >>>> + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { >>>> + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); >>>> + } else if (info1 & VM_INTINFO_VALID) { >>>> + *retinfo = info1; >>>> + valid = 1; >>>> + } else if (info2 & VM_INTINFO_VALID) { >>>> + *retinfo = info2; >>>> + valid = 1; >>>> + } else { >>>> + valid = 0; >>>> + } >>>> + >>>> + if (valid) { >>>> + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " >>>> + "retinfo(%#lx)", __func__, info1, info2, *retinfo); >>>> + } >>>> + >>>> + return (valid); >>>> +} >>>> + >>>> +int >>>> +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) >>>> +{ >>>> + struct vcpu *vcpu; >>>> + >>>> + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) >>>> + return (EINVAL); >>>> + >>>> + vcpu = &vm->vcpu[vcpuid]; >>>> + *info1 = vcpu->exitintinfo; >>>> + *info2 = vcpu_exception_intinfo(vcpu); >>>> + return (0); >>>> +} >>>> + >>>> +int >>>> vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) >>>> { >>>> struct vcpu *vcpu; >>>> @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v >>>> if (exception->vector < 0 || exception->vector >= 32) >>>> return (EINVAL); >>>> >>>> + /* >>>> + * A double fault exception should never be injected directly into >>>> + * the guest. It is a derived exception that results from specific >>>> + * combinations of nested faults. >>>> + */ >>>> + if (exception->vector == IDT_DF) >>>> + return (EINVAL); >>>> + >>>> vcpu = &vm->vcpu[vcpuid]; >>>> >>>> if (vcpu->exception_pending) { >>>> @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v >>>> return (0); >>>> } >>>> >>>> -int >>>> -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) >>>> -{ >>>> - struct vcpu *vcpu; >>>> - int pending; >>>> - >>>> - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); >>>> - >>>> - vcpu = &vm->vcpu[vcpuid]; >>>> - pending = vcpu->exception_pending; >>>> - if (pending) { >>>> - vcpu->exception_pending = 0; >>>> - *exception = vcpu->exception; >>>> - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", >>>> - exception->vector); >>>> - } >>>> - return (pending); >>>> -} >>>> - >>>> static void >>>> vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) >>>> { >>>> >>>> Modified: head/sys/amd64/vmm/vmm_dev.c >>>> ============================================================================== >>>> --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>>> struct vm_gla2gpa *gg; >>>> struct vm_activate_cpu *vac; >>>> struct vm_cpuset *vm_cpuset; >>>> + struct vm_intinfo *vmii; >>>> >>>> sc = vmmdev_lookup2(cdev); >>>> if (sc == NULL) >>>> @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>>> case VM_SET_X2APIC_STATE: >>>> case VM_GLA2GPA: >>>> case VM_ACTIVATE_CPU: >>>> + case VM_SET_INTINFO: >>>> + case VM_GET_INTINFO: >>>> /* >>>> * XXX fragile, handle with care >>>> * Assumes that the first field of the ioctl data is the vcpu. >>>> @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c >>>> error = copyout(cpuset, vm_cpuset->cpus, size); >>>> free(cpuset, M_TEMP); >>>> break; >>>> + case VM_SET_INTINFO: >>>> + vmii = (struct vm_intinfo *)data; >>>> + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); >>>> + break; >>>> + case VM_GET_INTINFO: >>>> + vmii = (struct vm_intinfo *)data; >>>> + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, >>>> + &vmii->info2); >>>> + break; >>>> default: >>>> error = ENOTTY; >>>> break; >>>> >>>> Modified: head/usr.sbin/bhyve/bhyverun.c >>>> ============================================================================== >>>> --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct >>>> exit(1); >>>> case VM_SUSPEND_HALT: >>>> exit(2); >>>> + case VM_SUSPEND_TRIPLEFAULT: >>>> + exit(3); >>>> default: >>>> fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); >>>> exit(100); >>>> >>>> Modified: head/usr.sbin/bhyve/task_switch.c >>>> ============================================================================== >>>> --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st >>>> */ >>>> >>>> /* >>>> - * XXX is the original task switch was triggered by a hardware >>>> - * exception then do we generate a double-fault if we encounter >>>> - * an exception during the task switch? >>>> + * If the task switch was triggered by an event delivered through >>>> + * the IDT then extinguish the pending event from the vcpu's >>>> + * exitintinfo. >>>> */ >>>> + if (task_switch->reason == TSR_IDT_GATE) { >>>> + error = vm_set_intinfo(ctx, vcpu, 0); >>>> + assert(error == 0); >>>> + } >>>> >>>> /* >>>> * XXX should inject debug exception if 'T' bit is 1 >>>> >>>> Modified: head/usr.sbin/bhyvectl/bhyvectl.c >>>> ============================================================================== >>>> --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) >>>> +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) >>>> @@ -195,7 +195,8 @@ usage(void) >>>> " [--force-reset]\n" >>>> " [--force-poweroff]\n" >>>> " [--get-active-cpus]\n" >>>> - " [--get-suspended-cpus]\n", >>>> + " [--get-suspended-cpus]\n" >>>> + " [--get-intinfo]\n", >>>> progname); >>>> exit(1); >>>> } >>>> @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; >>>> static int force_reset, force_poweroff; >>>> static const char *capname; >>>> static int create, destroy, get_lowmem, get_highmem; >>>> +static int get_intinfo; >>>> static int get_active_cpus, get_suspended_cpus; >>>> static uint64_t memsize; >>>> static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; >>>> @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu >>>> printf("\n"); >>>> } >>>> >>>> +static void >>>> +print_intinfo(const char *banner, uint64_t info) >>>> +{ >>>> + int type; >>>> + >>>> + printf("%s:\t", banner); >>>> + if (info & VM_INTINFO_VALID) { >>>> + type = info & VM_INTINFO_TYPE; >>>> + switch (type) { >>>> + case VM_INTINFO_HWINTR: >>>> + printf("extint"); >>>> + break; >>>> + case VM_INTINFO_NMI: >>>> + printf("nmi"); >>>> + break; >>>> + case VM_INTINFO_SWINTR: >>>> + printf("swint"); >>>> + break; >>>> + default: >>>> + printf("exception"); >>>> + break; >>>> + } >>>> + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); >>>> + if (info & VM_INTINFO_DEL_ERRCODE) >>>> + printf(" errcode %#x", (u_int)(info >> 32)); >>>> + } else { >>>> + printf("n/a"); >>>> + } >>>> + printf("\n"); >>>> +} >>>> + >>>> int >>>> main(int argc, char *argv[]) >>>> { >>>> @@ -420,7 +453,7 @@ main(int argc, char *argv[]) >>>> vm_paddr_t gpa, gpa_pmap; >>>> size_t len; >>>> struct vm_exit vmexit; >>>> - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; >>>> + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; >>>> struct vmctx *ctx; >>>> int wired; >>>> cpuset_t cpus; >>>> @@ -595,6 +628,7 @@ main(int argc, char *argv[]) >>>> { "force-poweroff", NO_ARG, &force_poweroff, 1 }, >>>> { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, >>>> { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, >>>> + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, >>>> { NULL, 0, NULL, 0 } >>>> }; >>>> >>>> @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) >>>> print_cpus("suspended cpus", &cpus); >>>> } >>>> >>>> + if (!error && (get_intinfo || get_all)) { >>>> + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); >>>> + if (!error) { >>>> + print_intinfo("pending", info[0]); >>>> + print_intinfo("current", info[1]); >>>> + } >>>> + } >>>> + >>>> if (!error && run) { >>>> error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); >>>> assert(error == 0); >>>> From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 08:43:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38B78F89; Sun, 20 Jul 2014 08:43:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 259C12FE0; Sun, 20 Jul 2014 08:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6K8hsji017328; Sun, 20 Jul 2014 08:43:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6K8hsAW017327; Sun, 20 Jul 2014 08:43:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407200843.s6K8hsAW017327@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Jul 2014 08:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268917 - head/sys/dev/ixgbe 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.18 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, 20 Jul 2014 08:43:54 -0000 Author: adrian Date: Sun Jul 20 08:43:53 2014 New Revision: 268917 URL: http://svnweb.freebsd.org/changeset/base/268917 Log: Add the UDP hash -> RSS mbuf hash type for the ixgbe(4) driver. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 07:45:48 2014 (r268916) +++ head/sys/dev/ixgbe/ixgbe.c Sun Jul 20 08:43:53 2014 (r268917) @@ -4745,12 +4745,15 @@ ixgbe_rxeof(struct ix_queue *que) case IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX: M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV6_EX); break; - /* XXX no UDP support in RSS just yet */ -#ifdef notyet - case IGXBE_RXDADV_RSSTYPE_IPV4_UDP: - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP: - case IGXBE_RXDADV_RSSTYPE_IPV6_UDP_EX: -#endif /* notyet */ + case IXGBE_RXDADV_RSSTYPE_IPV4_UDP: + M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV4); + break; + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP: + M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6); + break; + case IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX: + M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_UDP_IPV6_EX); + break; default: /* XXX fallthrough */ M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE); From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 08:53:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6AA01FF; Sun, 20 Jul 2014 08:53:08 +0000 (UTC) Received: from smtp2.wemm.org (smtp2.wemm.org [192.203.228.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp2.wemm.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8755820AD; Sun, 20 Jul 2014 08:53:08 +0000 (UTC) Received: from overcee.wemm.org (canning.wemm.org [192.203.228.65]) by smtp2.wemm.org (Postfix) with ESMTP id 2C76B917; Sun, 20 Jul 2014 01:53:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=m20140428; t=1405846388; bh=AzuITOY834ZmwOGO9zGTAHeMS6PUagj92jKPNcpeVrM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BBZoeP+E9KhDfee7E3mDhrvfiZS+Rk5vy8nFtMD8mSQ+1ID88IZ8evSTcaYgxWY48 IvLg26g4z5fMP8IQo3yO7ty9VUp2SPNibMiifPDWDThZd74VBN15QiCojWUsbNLlYz Vu5ADYWz/cZ7lmh1MhH2FzXZ5OtipqoEh69adv0g= From: Peter Wemm To: Benjamin Kaduk Subject: Re: svn commit: r268827 - head/usr.sbin/ndp Date: Sun, 20 Jul 2014 01:53:03 -0700 Message-ID: <3782322.IFK7GnHDGh@overcee.wemm.org> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: References: <201407180648.s6I6m2U7075749@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1766375.Jl0GEnxtpW"; micalg="pgp-sha1"; protocol="application/pgp-signature" Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Peter Wemm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 08:53:08 -0000 --nextPart1766375.Jl0GEnxtpW Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" On Friday 18 July 2014 10:35:33 Benjamin Kaduk wrote: > On Fri, Jul 18, 2014 at 2:48 AM, Peter Wemm wrote= : > > Author: peter > > Date: Fri Jul 18 06:48:02 2014 > > New Revision: 268827 > > URL: http://svnweb.freebsd.org/changeset/base/268827 > >=20 > > Log: > > Fix "ndp -d hostname". >=20 > MFC? >=20 > -Ben It is not broken in 10.x or earlier, so no. =2D-=20 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI= 6FJV UTF-8: for when a ' or ... just won\342\200\231t do\342\200\246 --nextPart1766375.Jl0GEnxtpW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABAgAGBQJTy4NzAAoJEDXWlwnsgJ4EXewIALe75+z00TH7BXmP6ex7HiOu 5lgbSj/tvMBxsZ6f11GPx8Zo9BcnWZVtokCCyNu13p90fMiTs8Mg6VRgl46qJ5r2 XCC9UZbHWIiSPVLXhKV9CwM5A2AaChfVnG/E/VTdw6pK/o0JM4tYNJpUpikBwa/i 3x5H5ZeVV38+WVffbyk3mHcFbeZJm5cEDqjZ92CTACy8GLCPGwuLn1N49NqchDUM 0gxkGLaoDor/xp7JgVPGNA86051ZK4/jHmBDcJ5PYX9Sv8YXvjnLFvf3pOaMPKqf IkvVzoGXdv0LOn+/uJjjMzlN6HddruGHFPJaYKw146BoPKtobtS5ywpWYQ3qN2s= =tPWa -----END PGP SIGNATURE----- --nextPart1766375.Jl0GEnxtpW-- From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 12:06:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 55E58A92; Sun, 20 Jul 2014 12:06:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAAB2E01; Sun, 20 Jul 2014 12:06:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KC6rtf013339; Sun, 20 Jul 2014 12:06:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KC6q37013335; Sun, 20 Jul 2014 12:06:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201407201206.s6KC6q37013335@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Jul 2014 12:06:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268920 - head/bin/sh 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.18 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, 20 Jul 2014 12:06:53 -0000 Author: jilles Date: Sun Jul 20 12:06:52 2014 New Revision: 268920 URL: http://svnweb.freebsd.org/changeset/base/268920 Log: sh: Remove prefix() function. Use strncmp() instead. Modified: head/bin/sh/exec.c head/bin/sh/jobs.c head/bin/sh/mystring.c head/bin/sh/mystring.h Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/exec.c Sun Jul 20 12:06:52 2014 (r268920) @@ -365,7 +365,7 @@ find_command(const char *name, struct cm for (;(fullname = padvance(&path, name)) != NULL; stunalloc(fullname)) { idx++; if (pathopt) { - if (prefix("func", pathopt)) { + if (strncmp(pathopt, "func", 4) == 0) { /* handled below */ } else { continue; /* ignore unimplemented options */ Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/jobs.c Sun Jul 20 12:06:52 2014 (r268920) @@ -562,6 +562,7 @@ getjob_nonotfound(const char *name) { int jobno; struct job *found, *jp; + size_t namelen; pid_t pid; int i; @@ -603,10 +604,12 @@ currentjob: if ((jp = getcurjob(NULL)) = if (found != NULL) return (found); } else { + namelen = strlen(name); found = NULL; for (jp = jobtab, i = njobs ; --i >= 0 ; jp++) { if (jp->used && jp->nprocs > 0 - && prefix(name + 1, jp->ps[0].cmd)) { + && strncmp(jp->ps[0].cmd, name + 1, + namelen - 1) == 0) { if (found) error("%s: ambiguous", name); found = jp; Modified: head/bin/sh/mystring.c ============================================================================== --- head/bin/sh/mystring.c Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/mystring.c Sun Jul 20 12:06:52 2014 (r268920) @@ -61,21 +61,6 @@ char nullstr[1]; /* zero length string /* - * prefix -- see if pfx is a prefix of string. - */ - -int -prefix(const char *pfx, const char *string) -{ - while (*pfx) { - if (*pfx++ != *string++) - return 0; - } - return 1; -} - - -/* * Convert a string of digits to an integer, printing an error message on * failure. */ Modified: head/bin/sh/mystring.h ============================================================================== --- head/bin/sh/mystring.h Sun Jul 20 11:00:51 2014 (r268919) +++ head/bin/sh/mystring.h Sun Jul 20 12:06:52 2014 (r268920) @@ -35,7 +35,6 @@ #include -int prefix(const char *, const char *); int number(const char *); int is_number(const char *); From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 14:24:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 704B92E5; Sun, 20 Jul 2014 14:24:04 +0000 (UTC) Received: from fep12.mx.upcmail.net (fep12.mx.upcmail.net [62.179.121.32]) by mx1.freebsd.org (Postfix) with ESMTP id 4902C2824; Sun, 20 Jul 2014 14:24:02 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep12-int.chello.at (InterMail vM.8.01.05.13 201-2260-151-135-20130320) with ESMTP id <20140720142355.YCGR63670.viefep12-int.chello.at@edge04.upcmail.net>; Sun, 20 Jul 2014 16:23:55 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge04.upcmail.net with edge id UePu1o00p2xdvHc03ePuB6; Sun, 20 Jul 2014 16:23:55 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 77AF36D40D; Sun, 20 Jul 2014 16:23:54 +0200 (CEST) Date: Sun, 20 Jul 2014 16:23:54 +0200 From: Stefan Farfeleder To: Neel Natu Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl Message-ID: <20140720142354.GA1205@mole.fafoe.narf.at> References: <201407192059.s6JKx8un072543@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407192059.s6JKx8un072543@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 14:24:04 -0000 Hi, On Sat, Jul 19, 2014 at 08:59:08PM +0000, Neel Natu wrote: > Author: neel > Date: Sat Jul 19 20:59:08 2014 > New Revision: 268889 > URL: http://svnweb.freebsd.org/changeset/base/268889 > Modified: head/sys/amd64/vmm/intel/vmx.c > ============================================================================== > --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) > +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) > @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i > { > struct vm_exception exc; > int vector, need_nmi_exiting, extint_pending; > - uint64_t rflags; > + uint64_t rflags, entryinfo; > uint32_t gi, info; > > - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { > - KASSERT(exc.vector >= 0 && exc.vector < 32, > - ("%s: invalid exception vector %d", __func__, exc.vector)); > + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { > + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " > + "intinfo is not valid: %#lx", __func__, entryinfo)); > > info = vmcs_read(VMCS_ENTRY_INTR_INFO); > KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " > "pending exception %d: %#x", __func__, exc.vector, info)); > /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] struct vm_exception exc; ^ 1 error generated. Printing the uninitialised object in the KASSERT is most probably wrong. BR, Stefan From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 14:31:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 705DC741; Sun, 20 Jul 2014 14:31:15 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49180290C; Sun, 20 Jul 2014 14:31:15 +0000 (UTC) Received: from pippin.baldwin.cx (75-48-77-17.lightspeed.cncrca.sbcglobal.net [75.48.77.17]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 31193B968; Sun, 20 Jul 2014 10:31:14 -0400 (EDT) From: John Baldwin To: Don Lewis Subject: Re: svn commit: r268780 - in head: share/man/man9 sys/kern sys/sys Date: Sat, 19 Jul 2014 12:37:22 -0400 Message-ID: <3826918.4Hm7dJqFvt@pippin.baldwin.cx> User-Agent: KMail/4.12.5 (FreeBSD/11.0-CURRENT; KDE/4.12.5; amd64; ; ) In-Reply-To: <201407162218.s6GMIJYR043517@svn.freebsd.org> References: <201407162218.s6GMIJYR043517@svn.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.2.7 (bigwig.baldwin.cx); Sun, 20 Jul 2014 10:31:14 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 14:31:15 -0000 On Wednesday 16 July 2014 22:18:19 Don Lewis wrote: > Author: truckman > Date: Wed Jul 16 22:18:19 2014 > New Revision: 268780 > URL: http://svnweb.freebsd.org/changeset/base/268780 > > Log: > Nuke the never-used RF_TIMESHARE feature, reducing the complexity of the > code. The consensus on arch@ is that this feature might have been useful > in the distant past, but is now just unnecessary bloat. > > The int_rman_activate_resource() and int_rman_deactivate_resource() > functions become trivial, so manually inline them. > > The special deferred handling of RF_ACTIVE is no longer needed in > reserve_resource_bound(), so eliminate the associated code at the > end of the function. > > These changes reduce the object file size by more than 500 bytes on i386. > > Update the rman.9 man page to reflect the removal of the RF_TIMESHARE > feature. > > MFC after: 2 weeks Thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 14:32:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DF5CA83; Sun, 20 Jul 2014 14:32:36 +0000 (UTC) Received: from fep22.mx.upcmail.net (fep22.mx.upcmail.net [62.179.121.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3A40D294D; Sun, 20 Jul 2014 14:32:34 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep22-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140720143219.SAKX10910.viefep22-int.chello.at@edge04.upcmail.net>; Sun, 20 Jul 2014 16:32:19 +0200 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge04.upcmail.net with edge id UeYK1o00d2xdvHc03eYKuJ; Sun, 20 Jul 2014 16:32:19 +0200 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 26B426D40D; Sun, 20 Jul 2014 16:32:19 +0200 (CEST) Date: Sun, 20 Jul 2014 16:32:19 +0200 From: Stefan Farfeleder To: Mark Johnston Subject: Re: svn commit: r268869 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/fbt Message-ID: <20140720143218.GB1205@mole.fafoe.narf.at> References: <201407190227.s6J2RWvL042340@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407190227.s6J2RWvL042340@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 14:32:36 -0000 Hi, On Sat, Jul 19, 2014 at 02:27:32AM +0000, Mark Johnston wrote: > Author: markj > Date: Sat Jul 19 02:27:31 2014 > New Revision: 268869 > URL: http://svnweb.freebsd.org/changeset/base/268869 > Modified: head/sys/amd64/amd64/trap.c > ============================================================================== > --- head/sys/amd64/amd64/trap.c Sat Jul 19 02:15:28 2014 (r268868) > +++ head/sys/amd64/amd64/trap.c Sat Jul 19 02:27:31 2014 (r268869) > @@ -97,7 +97,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); > #include > #endif > > -extern void trap(struct trapframe *frame); > +extern void __noinline trap(struct trapframe *frame); > +extern void trap_check(struct trapframe *frame); > extern void syscall(struct trapframe *frame); > void dblfault_handler(struct trapframe *frame); > > @@ -604,6 +605,19 @@ out: > return; > } > > +/* > + * Ensure that we ignore any DTrace-induced faults. This function cannot > + * be instrumented, so it cannot generate such faults itself. > + */ > +void > +trap_check(struct trapframe *frame) > +{ > + > + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) > + return; > + trap(frame); > +} > + > static int /usr/src/sys/amd64/amd64/trap.c:616:6: error: use of undeclared identifier 'dtrace_trap_func' if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) ^ This is without KDTRACE_HOOKS. BR, Stefan From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 14:47:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 932D4FCD; Sun, 20 Jul 2014 14:47:46 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 55F032A74; Sun, 20 Jul 2014 14:47:46 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id DFDAA75F1; Sun, 20 Jul 2014 14:47:38 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 5CC44570; Sun, 20 Jul 2014 16:47:19 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Ian Lepore Subject: Re: svn commit: r268877 - head/share/mk References: <201407191426.s6JEQ4en083862@svn.freebsd.org> <1405805007.85788.24.camel@revolution.hippie.lan> Date: Sun, 20 Jul 2014 16:47:19 +0200 In-Reply-To: <1405805007.85788.24.camel@revolution.hippie.lan> (Ian Lepore's message of "Sat, 19 Jul 2014 15:23:27 -0600") Message-ID: <8661isrsso.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 14:47:46 -0000 Ian Lepore writes: > This change breaks the ability to bootstrap from versions prior to 10.0 > because the older lex requires "-ofilename" rather than "-o filename". Right, I didn't test that: des@nine ~head/lib/libunbound% make -m ~head/share/mk obj depend /usr/obj/home/des/freebsd/base/head/lib/libunbound created for /home/des/fr= eebsd/base/head/lib/libunbound cp -p /home/des/freebsd/base/head/lib/libunbound/../../contrib/unbound/util= /configlexer.lex configlexer.l lex -Pub_c_ -o configlexer.c configlexer.l lex: can't open configlexer.c *** [configlexer.c] Error code 1 Stop in /home/des/freebsd/base/head/lib/libunbound. > It seems like the path of least resistance would be to remove the space > between -o and ${TARGET}, which I'll leave for you if you agree, so that > you can MFC them together when the time comes. Seems like a trivial enough fix. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 14:49:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F1E72C9; Sun, 20 Jul 2014 14:49:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0C52A8C; Sun, 20 Jul 2014 14:49:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KEnOf5089121; Sun, 20 Jul 2014 14:49:24 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KEnOXw089120; Sun, 20 Jul 2014 14:49:24 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407201449.s6KEnOXw089120@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 20 Jul 2014 14:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268921 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 14:49:24 -0000 Author: des Date: Sun Jul 20 14:49:24 2014 New Revision: 268921 URL: http://svnweb.freebsd.org/changeset/base/268921 Log: Older versions of flex (like the one used in FreeBSD <= 9) expect the output file name to follow the -o flag immediately, with no intervening whitespace. Reported by: ian@ MFC after: 1 week Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sun Jul 20 12:06:52 2014 (r268920) +++ head/share/mk/bsd.dep.mk Sun Jul 20 14:49:24 2014 (r268921) @@ -82,7 +82,7 @@ ${_S:R}.o: ${_S} .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} - ${LEX} ${LFLAGS} -o ${.TARGET} ${.ALLSRC} + ${LEX} ${LFLAGS} -o${.TARGET} ${.ALLSRC} .if !exists(${.OBJDIR}/${DEPENDFILE}) ${_LC:R}.o: ${_LC} .endif From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 16:34:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4949D81; Sun, 20 Jul 2014 16:34:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 927D42413; Sun, 20 Jul 2014 16:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KGYZ99041398; Sun, 20 Jul 2014 16:34:35 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KGYZCD041397; Sun, 20 Jul 2014 16:34:35 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407201634.s6KGYZCD041397@svn.freebsd.org> From: Neel Natu Date: Sun, 20 Jul 2014 16:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268922 - head/sys/amd64/vmm/intel 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.18 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, 20 Jul 2014 16:34:35 -0000 Author: neel Date: Sun Jul 20 16:34:35 2014 New Revision: 268922 URL: http://svnweb.freebsd.org/changeset/base/268922 Log: Fix build without INVARIANTS defined by getting rid of unused variable 'exc'. Reported by: adrian, stefanf Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sun Jul 20 14:49:24 2014 (r268921) +++ head/sys/amd64/vmm/intel/vmx.c Sun Jul 20 16:34:35 2014 (r268922) @@ -1211,7 +1211,6 @@ vmx_inject_nmi(struct vmx *vmx, int vcpu static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { - struct vm_exception exc; int vector, need_nmi_exiting, extint_pending; uint64_t rflags, entryinfo; uint32_t gi, info; @@ -1222,7 +1221,7 @@ vmx_inject_interrupts(struct vmx *vmx, i info = vmcs_read(VMCS_ENTRY_INTR_INFO); KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " - "pending exception %d: %#x", __func__, exc.vector, info)); + "pending exception: %#lx/%#x", __func__, entryinfo, info)); info = entryinfo; vector = info & 0xff; From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 16:37:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ED57F47; Sun, 20 Jul 2014 16:37:47 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E19562442; Sun, 20 Jul 2014 16:37:46 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id m5so4408098qaj.21 for ; Sun, 20 Jul 2014 09:37:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=41sUlijyg8JhWpmVDKKU7lBviJ0pTw+t6HgaW+lB2FQ=; b=F7xGYHNk8CUxTPLZNpacZ9e3Ymu7dVMv8BKyo3vESC3ozfspSB6Syi9Kls2X5Y8jUq tXPwY+I2L9FRe5kfRRcZDPsOKBL0NZ70DDipYPkFH3FeIcE7xlJQZCiFMZ7SbN206QVi 6SmG7QZNv6c34Lr8vuQmXOeo0OOkjA40nJH0zrNNJXoKOdtSoTwNmS4KhtG+A+qlvTse TMk99DAXldbHQ1dE7mE8Z+5RUA5L6i15V+BngyP805MqPeo/Fc0udCQZgvKlh5oZ4yKM YDLAYV+5j7yWQJ1/1Nz6QzZ0YYtuPmm9SOVENBNCPPMv0pYeewLdPWJWFOHti+Bp6c6W TLMQ== MIME-Version: 1.0 X-Received: by 10.140.40.165 with SMTP id x34mr29875881qgx.23.1405874265953; Sun, 20 Jul 2014 09:37:45 -0700 (PDT) Received: by 10.140.48.37 with HTTP; Sun, 20 Jul 2014 09:37:45 -0700 (PDT) In-Reply-To: <20140720142354.GA1205@mole.fafoe.narf.at> References: <201407192059.s6JKx8un072543@svn.freebsd.org> <20140720142354.GA1205@mole.fafoe.narf.at> Date: Sun, 20 Jul 2014 09:37:45 -0700 Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Neel Natu To: Stefan Farfeleder Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 16:37:47 -0000 Hi, On Sun, Jul 20, 2014 at 7:23 AM, Stefan Farfeleder wrote: > Hi, > > On Sat, Jul 19, 2014 at 08:59:08PM +0000, Neel Natu wrote: >> Author: neel >> Date: Sat Jul 19 20:59:08 2014 >> New Revision: 268889 >> URL: http://svnweb.freebsd.org/changeset/base/268889 > > > >> Modified: head/sys/amd64/vmm/intel/vmx.c >> ============================================================================== >> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >> { >> struct vm_exception exc; >> int vector, need_nmi_exiting, extint_pending; >> - uint64_t rflags; >> + uint64_t rflags, entryinfo; >> uint32_t gi, info; >> >> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >> - KASSERT(exc.vector >= 0 && exc.vector < 32, >> - ("%s: invalid exception vector %d", __func__, exc.vector)); >> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >> + "intinfo is not valid: %#lx", __func__, entryinfo)); >> >> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >> "pending exception %d: %#x", __func__, exc.vector, info)); >> > > /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] > struct vm_exception exc; > ^ > 1 error generated. > > Printing the uninitialised object in the KASSERT is most probably wrong. > Fixed in r268922. best Neel > BR, > Stefan From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 16:47:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04836243; Sun, 20 Jul 2014 16:47:32 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74A2F2506; Sun, 20 Jul 2014 16:47:31 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id o8so4863635qcw.5 for ; Sun, 20 Jul 2014 09:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=o8KZ19Yxma7ZDFT8Lude7HPKySSlVLd96sfsxKxhh+A=; b=iUecXC0ziioCcYKx5Ep/SNCT+z/EVJp1VhaEfVv1hay1FpXMUu8oCL8NiOV2EjBMFF owSbiXIIm+ZjpT6wzA0iD/1WZ+P5QFs+BVvd1Mf8J2GZeAQ/fMCAyTmtJBhEr4DcqJoa PPvEsEx6wtsuqMssXgMf3FA69AlvBc+yolvGBaEa1qIeT6AlX+BIjsEyHV8aRbC+LmFc yoqAvGgUb8FpeR+DVOifCtwckzO9nO2tbXQNXMdLPDWFm6kyNARzCR0GmZPMMcHI46Rn qMUBvUeA8D9cVQiQi9mvaLvUnhCp/gK+mQvnstWbFGjCK0sXKaqqNNBrtszYskr0dED3 S4uA== MIME-Version: 1.0 X-Received: by 10.140.38.169 with SMTP id t38mr29607511qgt.3.1405874849085; Sun, 20 Jul 2014 09:47:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sun, 20 Jul 2014 09:47:29 -0700 (PDT) In-Reply-To: References: <201407192059.s6JKx8un072543@svn.freebsd.org> <20140720142354.GA1205@mole.fafoe.narf.at> Date: Sun, 20 Jul 2014 09:47:29 -0700 X-Google-Sender-Auth: zM6dkwRJn_BTyphrsDZ3-9dLaxk Message-ID: Subject: Re: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl From: Adrian Chadd To: Neel Natu Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Stefan Farfeleder , "src-committers@freebsd.org" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 16:47:32 -0000 Thanks! -a On 20 July 2014 09:37, Neel Natu wrote: > Hi, > > On Sun, Jul 20, 2014 at 7:23 AM, Stefan Farfeleder wrote: >> Hi, >> >> On Sat, Jul 19, 2014 at 08:59:08PM +0000, Neel Natu wrote: >>> Author: neel >>> Date: Sat Jul 19 20:59:08 2014 >>> New Revision: 268889 >>> URL: http://svnweb.freebsd.org/changeset/base/268889 >> >> >> >>> Modified: head/sys/amd64/vmm/intel/vmx.c >>> ============================================================================== >>> --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) >>> +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) >>> @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i >>> { >>> struct vm_exception exc; >>> int vector, need_nmi_exiting, extint_pending; >>> - uint64_t rflags; >>> + uint64_t rflags, entryinfo; >>> uint32_t gi, info; >>> >>> - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { >>> - KASSERT(exc.vector >= 0 && exc.vector < 32, >>> - ("%s: invalid exception vector %d", __func__, exc.vector)); >>> + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { >>> + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " >>> + "intinfo is not valid: %#lx", __func__, entryinfo)); >>> >>> info = vmcs_read(VMCS_ENTRY_INTR_INFO); >>> KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " >>> "pending exception %d: %#x", __func__, exc.vector, info)); >>> >> >> /usr/src/sys/modules/vmm/../../amd64/vmm/intel/vmx.c:1214:22: error: unused variable 'exc' [-Werror,-Wunused-variable] >> struct vm_exception exc; >> ^ >> 1 error generated. >> >> Printing the uninitialised object in the KASSERT is most probably wrong. >> > > Fixed in r268922. > > best > Neel > >> BR, >> Stefan > From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 18:44:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CF4EB97; Sun, 20 Jul 2014 18:44:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A52F2FAF; Sun, 20 Jul 2014 18:44:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KIivfG004207; Sun, 20 Jul 2014 18:44:57 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KIiv31004206; Sun, 20 Jul 2014 18:44:57 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407201844.s6KIiv31004206@svn.freebsd.org> From: Mark Johnston Date: Sun, 20 Jul 2014 18:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268923 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 18:44:57 -0000 Author: markj Date: Sun Jul 20 18:44:56 2014 New Revision: 268923 URL: http://svnweb.freebsd.org/changeset/base/268923 Log: Fix the build when DTrace isn't enabled. Reported by: stefanf X-MFC-With: r268600 Modified: head/sys/amd64/amd64/trap.c Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sun Jul 20 16:34:35 2014 (r268922) +++ head/sys/amd64/amd64/trap.c Sun Jul 20 18:44:56 2014 (r268923) @@ -613,8 +613,10 @@ void trap_check(struct trapframe *frame) { +#ifdef KDTRACE_HOOKS if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) return; +#endif trap(frame); } From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 18:46:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64106CE6; Sun, 20 Jul 2014 18:46:49 +0000 (UTC) Received: from mail-ie0-x231.google.com (mail-ie0-x231.google.com [IPv6:2607:f8b0:4001:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1358F2FC0; Sun, 20 Jul 2014 18:46:49 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id at20so6093142iec.22 for ; Sun, 20 Jul 2014 11:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=xXtPBjLuXEAs+jGiwQlVwO2cKhzeb2NO9Gz3SaLBUgE=; b=kgXl0nfxL3yNF+PEG8n+Aymgha1ONHThFsWZHWuQLJexTxeD/VV1OrQyU6n+VwsHXn 1iVkO32gr9u+AkPcXVU7M7pX1XLNmq6leeQM34Suoe/cjxbzrYUsDuHKBGUGm6QzeGGi ltsVBXujmdcRCkTswTpJisDD7QMVKjEhGf25WgAjD/euMT89Nlk5xYExHy09OOGZ9V0L dbNN4JzPPVPzJifxvDkoYH01DyQD6nRwEeCe8ozEHbwN5vA6kqzYjBEEtWYv53wJgVNj 4GbUnYzh6v7o8KJbgr1hLpyORVPd4gxaDaIu2yPUJ0+Kp/aDCFi+rtnqEzI9Ey6ilYJk eugw== X-Received: by 10.50.66.179 with SMTP id g19mr34511651igt.29.1405882008070; Sun, 20 Jul 2014 11:46:48 -0700 (PDT) Received: from charmander.home ([65.92.195.187]) by mx.google.com with ESMTPSA id ro10sm30614110igb.18.2014.07.20.11.46.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jul 2014 11:46:47 -0700 (PDT) Sender: Mark Johnston Date: Sun, 20 Jul 2014 14:46:11 -0400 From: Mark Johnston To: Stefan Farfeleder Subject: Re: svn commit: r268869 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/fbt Message-ID: <20140720184610.GA1321@charmander.home> References: <201407190227.s6J2RWvL042340@svn.freebsd.org> <20140720143218.GB1205@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140720143218.GB1205@mole.fafoe.narf.at> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 20 Jul 2014 18:46:49 -0000 On Sun, Jul 20, 2014 at 04:32:19PM +0200, Stefan Farfeleder wrote: > Hi, > > On Sat, Jul 19, 2014 at 02:27:32AM +0000, Mark Johnston wrote: > > Author: markj > > Date: Sat Jul 19 02:27:31 2014 > > New Revision: 268869 > > URL: http://svnweb.freebsd.org/changeset/base/268869 > > > > > Modified: head/sys/amd64/amd64/trap.c > > ============================================================================== > > --- head/sys/amd64/amd64/trap.c Sat Jul 19 02:15:28 2014 (r268868) > > +++ head/sys/amd64/amd64/trap.c Sat Jul 19 02:27:31 2014 (r268869) > > @@ -97,7 +97,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); > > #include > > #endif > > > > -extern void trap(struct trapframe *frame); > > +extern void __noinline trap(struct trapframe *frame); > > +extern void trap_check(struct trapframe *frame); > > extern void syscall(struct trapframe *frame); > > void dblfault_handler(struct trapframe *frame); > > > > @@ -604,6 +605,19 @@ out: > > return; > > } > > > > +/* > > + * Ensure that we ignore any DTrace-induced faults. This function cannot > > + * be instrumented, so it cannot generate such faults itself. > > + */ > > +void > > +trap_check(struct trapframe *frame) > > +{ > > + > > + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) > > + return; > > + trap(frame); > > +} > > + > > static int > > /usr/src/sys/amd64/amd64/trap.c:616:6: error: use of undeclared identifier 'dtrace_trap_func' > if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) > ^ > > This is without KDTRACE_HOOKS. Sorry about that. This is fixed in r268923. -Mark From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 20:05:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B49AA72A; Sun, 20 Jul 2014 20:05:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8806126A5; Sun, 20 Jul 2014 20:05:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KK5dno044644; Sun, 20 Jul 2014 20:05:39 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KK5dgT044643; Sun, 20 Jul 2014 20:05:39 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202005.s6KK5dgT044643@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 20:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268924 - head/lib/libc/stdio 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.18 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, 20 Jul 2014 20:05:39 -0000 Author: pfg Date: Sun Jul 20 20:05:39 2014 New Revision: 268924 URL: http://svnweb.freebsd.org/changeset/base/268924 Log: Update fflush(3) to return success on a read-only stream. This has small changes to what Apple uses for compliance with SUSv3. The changes cause no secondary effects in the gnulib tests (we pass them). Obtained from: Apple Inc. (Libc 997.90.3 with changes) Reviewed by: bde Phabric: D440 Modified: head/lib/libc/stdio/fflush.c Modified: head/lib/libc/stdio/fflush.c ============================================================================== --- head/lib/libc/stdio/fflush.c Sun Jul 20 18:44:56 2014 (r268923) +++ head/lib/libc/stdio/fflush.c Sun Jul 20 20:05:39 2014 (r268924) @@ -60,7 +60,7 @@ fflush(FILE *fp) /* * There is disagreement about the correct behaviour of fflush() - * when passed a file which is not open for reading. According to + * when passed a file which is not open for writing. According to * the ISO C standard, the behaviour is undefined. * Under linux, such an fflush returns success and has no effect; * under Windows, such an fflush is documented as behaving instead @@ -68,11 +68,13 @@ fflush(FILE *fp) * Given that applications may be written with the expectation of * either of these two behaviours, the only safe (non-astonishing) * option is to return EBADF and ask that applications be fixed. + * SUSv3 now requires that fflush() returns success on a read-only + * stream. + * */ - if ((fp->_flags & (__SWR | __SRW)) == 0) { - errno = EBADF; - retval = EOF; - } else + if ((fp->_flags & (__SWR | __SRW)) == 0) + retval = 0; + else retval = __sflush(fp); FUNLOCKFILE(fp); return (retval); @@ -89,10 +91,9 @@ __fflush(FILE *fp) if (fp == NULL) return (_fwalk(sflush_locked)); - if ((fp->_flags & (__SWR | __SRW)) == 0) { - errno = EBADF; - retval = EOF; - } else + if ((fp->_flags & (__SWR | __SRW)) == 0) + retval = 0; + else retval = __sflush(fp); return (retval); } @@ -122,6 +123,12 @@ __sflush(FILE *fp) for (; n > 0; n -= t, p += t) { t = _swrite(fp, (char *)p, n); if (t <= 0) { + /* Reset _p and _w. */ + if (p > fp->_p) /* Some was written. */ + memmove(fp->_p, p, n); + fp->_p += n; + if ((fp->_flags & (__SLBF | __SNBF)) == 0) + fp->_w -= n; fp->_flags |= __SERR; return (EOF); } From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 20:11:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D094A8DD; Sun, 20 Jul 2014 20:11:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDB1926E5; Sun, 20 Jul 2014 20:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKBZ06048352; Sun, 20 Jul 2014 20:11:35 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKBZHe048349; Sun, 20 Jul 2014 20:11:35 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201407202011.s6KKBZHe048349@svn.freebsd.org> From: Robert Watson Date: Sun, 20 Jul 2014 20:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268925 - head/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.18 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, 20 Jul 2014 20:11:35 -0000 Author: rwatson Date: Sun Jul 20 20:11:34 2014 New Revision: 268925 URL: http://svnweb.freebsd.org/changeset/base/268925 Log: In "procstat -v" (VM), spell out 'FL' to 'FLAG' since there are two extra columns available anyway. Also left align as we tend to do for flags fields, although you can't see that currently as the string fully fills that available columns. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat_vm.c Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sun Jul 20 20:05:39 2014 (r268924) +++ head/usr.bin/procstat/procstat.1 Sun Jul 20 20:11:34 2014 (r268925) @@ -445,7 +445,7 @@ private resident pages reference count .It SHD shadow page count -.It FL +.It FLAG mapping flags .It TP VM object type Modified: head/usr.bin/procstat/procstat_vm.c ============================================================================== --- head/usr.bin/procstat/procstat_vm.c Sun Jul 20 20:05:39 2014 (r268924) +++ head/usr.bin/procstat/procstat_vm.c Sun Jul 20 20:11:34 2014 (r268925) @@ -50,9 +50,9 @@ procstat_vm(struct procstat *procstat, s ptrwidth = 2*sizeof(void *) + 2; if (!hflag) - printf("%5s %*s %*s %3s %4s %4s %3s %3s %4s %-2s %-s\n", + printf("%5s %*s %*s %3s %4s %4s %3s %3s %-4s %-2s %-s\n", "PID", ptrwidth, "START", ptrwidth, "END", "PRT", "RES", - "PRES", "REF", "SHD", "FL", "TP", "PATH"); + "PRES", "REF", "SHD", "FLAG", "TP", "PATH"); freep = procstat_getvmmap(procstat, kipp, &cnt); if (freep == NULL) From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 20:14:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 350E0A3B; Sun, 20 Jul 2014 20:14:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22ECF2761; Sun, 20 Jul 2014 20:14:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKEGkT049485; Sun, 20 Jul 2014 20:14:16 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKEFpB049484; Sun, 20 Jul 2014 20:14:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202014.s6KKEFpB049484@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 20:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268926 - head/lib/libc/stdio 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.18 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, 20 Jul 2014 20:14:16 -0000 Author: pfg Date: Sun Jul 20 20:14:15 2014 New Revision: 268926 URL: http://svnweb.freebsd.org/changeset/base/268926 Log: Use a correct errno in freopen. Use EBADF instead of EINVAL when working around incorrect O_ACCMODE. Phabric: D442 Obtained from: Apple Inc. (Libc 997.90.3) Reviewed by: jilles MFC after: 1 week Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Sun Jul 20 20:11:34 2014 (r268925) +++ head/lib/libc/stdio/freopen.c Sun Jul 20 20:14:15 2014 (r268926) @@ -97,7 +97,7 @@ freopen(const char * __restrict file, co (dflags & (O_ACCMODE | O_EXEC)) != (oflags & O_ACCMODE)) { fclose(fp); FUNLOCKFILE(fp); - errno = EINVAL; + errno = EBADF; return (NULL); } if (fp->_flags & __SWR) From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 20:29:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31360E5; Sun, 20 Jul 2014 20:29:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC7F2896; Sun, 20 Jul 2014 20:29:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKTA0e055033; Sun, 20 Jul 2014 20:29:10 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKTA2N055030; Sun, 20 Jul 2014 20:29:10 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201407202029.s6KKTA2N055030@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 20 Jul 2014 20:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268927 - in head/bin/sh: . tests/builtins 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.18 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, 20 Jul 2014 20:29:11 -0000 Author: jilles Date: Sun Jul 20 20:29:09 2014 New Revision: 268927 URL: http://svnweb.freebsd.org/changeset/base/268927 Log: sh: Allow arbitrarily large numbers in break and continue. The argument is capped to loopnest, so strtol()'s [ERANGE] can be ignored. Added: head/bin/sh/tests/builtins/break6.0 (contents, props changed) Modified: head/bin/sh/eval.c head/bin/sh/tests/builtins/Makefile Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jul 20 20:14:15 2014 (r268926) +++ head/bin/sh/eval.c Sun Jul 20 20:29:09 2014 (r268927) @@ -1250,8 +1250,16 @@ bltincmd(int argc, char **argv) int breakcmd(int argc, char **argv) { - int n = argc > 1 ? number(argv[1]) : 1; + long n; + char *end; + if (argc > 1) { + /* Allow arbitrarily large numbers. */ + n = strtol(argv[1], &end, 10); + if (!is_digit(argv[1][0]) || *end != '\0') + error("Illegal number: %s", argv[1]); + } else + n = 1; if (n > loopnest) n = loopnest; if (n > 0) { Modified: head/bin/sh/tests/builtins/Makefile ============================================================================== --- head/bin/sh/tests/builtins/Makefile Sun Jul 20 20:14:15 2014 (r268926) +++ head/bin/sh/tests/builtins/Makefile Sun Jul 20 20:29:09 2014 (r268927) @@ -14,6 +14,7 @@ FILES+= break2.0 break2.0.stdout FILES+= break3.0 FILES+= break4.4 FILES+= break5.4 +FILES+= break6.0 FILES+= builtin1.0 FILES+= case1.0 FILES+= case2.0 Added: head/bin/sh/tests/builtins/break6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/builtins/break6.0 Sun Jul 20 20:29:09 2014 (r268927) @@ -0,0 +1,8 @@ +# $FreeBSD$ +# Per POSIX, this need only work if LONG_MAX > 4294967295. + +while :; do + break 4294967296 + echo bad + exit 3 +done From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 20:29:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3A5C7220; Sun, 20 Jul 2014 20:29:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27E6F289A; Sun, 20 Jul 2014 20:29:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KKTTAB055123; Sun, 20 Jul 2014 20:29:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KKTTtk055122; Sun, 20 Jul 2014 20:29:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202029.s6KKTTtk055122@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 20:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268928 - head/lib/libc/stdio 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.18 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, 20 Jul 2014 20:29:29 -0000 Author: pfg Date: Sun Jul 20 20:29:28 2014 New Revision: 268928 URL: http://svnweb.freebsd.org/changeset/base/268928 Log: Const-ify a character string. Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days Modified: head/lib/libc/stdio/gets.c Modified: head/lib/libc/stdio/gets.c ============================================================================== --- head/lib/libc/stdio/gets.c Sun Jul 20 20:29:09 2014 (r268927) +++ head/lib/libc/stdio/gets.c Sun Jul 20 20:29:28 2014 (r268928) @@ -52,7 +52,7 @@ gets(char *buf) int c; char *s; static int warned; - static char w[] = + static const char w[] = "warning: this program uses gets(), which is unsafe.\n"; FLOCKFILE(stdin); From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 21:02:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 52285D57; Sun, 20 Jul 2014 21:02:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F9462B9D; Sun, 20 Jul 2014 21:02:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KL2a6B073204; Sun, 20 Jul 2014 21:02:36 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KL2Z1W073202; Sun, 20 Jul 2014 21:02:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407202102.s6KL2Z1W073202@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 20 Jul 2014 21:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268929 - in head/sys/dev/usb: . serial 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.18 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, 20 Jul 2014 21:02:36 -0000 Author: hselasky Date: Sun Jul 20 21:02:35 2014 New Revision: 268929 URL: http://svnweb.freebsd.org/changeset/base/268929 Log: Add new device ID. MFC after: 1 week PR: 191959 Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Sun Jul 20 20:29:28 2014 (r268928) +++ head/sys/dev/usb/serial/u3g.c Sun Jul 20 21:02:35 2014 (r268929) @@ -343,6 +343,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(NOVATEL, EU870D, 0), U3G_DEV(NOVATEL, MC760, 0), U3G_DEV(NOVATEL, MC547, 0), + U3G_DEV(NOVATEL, MC679, 0), U3G_DEV(NOVATEL, MC950D, 0), U3G_DEV(NOVATEL, MIFI2200, U3GINIT_SCSIEJECT), U3G_DEV(NOVATEL, MIFI2200V, U3GINIT_SCSIEJECT), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Sun Jul 20 20:29:28 2014 (r268928) +++ head/sys/dev/usb/usbdevs Sun Jul 20 21:02:35 2014 (r268929) @@ -3239,6 +3239,7 @@ product NOVATEL U727_2 0x5100 Merlin U7 product NOVATEL U760 0x6000 Novatel U760 product NOVATEL MC760 0x6002 Novatel MC760 product NOVATEL MC547 0x7042 Novatel MC547 +product NOVATEL MC679 0x7031 Novatel MC679 product NOVATEL2 FLEXPACKGPS 0x0100 NovAtel FlexPack GPS receiver /* Merlin products */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 21:24:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5705669E; Sun, 20 Jul 2014 21:24:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A2FF2D62; Sun, 20 Jul 2014 21:24:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KLOUC4083882; Sun, 20 Jul 2014 21:24:30 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KLOTKk083874; Sun, 20 Jul 2014 21:24:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407202124.s6KLOTKk083874@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 20 Jul 2014 21:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268930 - head/lib/libc/stdio 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.18 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, 20 Jul 2014 21:24:30 -0000 Author: pfg Date: Sun Jul 20 21:24:29 2014 New Revision: 268930 URL: http://svnweb.freebsd.org/changeset/base/268930 Log: Adjust errno on failed prepwrite. Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 1 week Modified: head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfwprintf.c head/lib/libc/stdio/wbuf.c Modified: head/lib/libc/stdio/vfprintf.c ============================================================================== --- head/lib/libc/stdio/vfprintf.c Sun Jul 20 21:02:35 2014 (r268929) +++ head/lib/libc/stdio/vfprintf.c Sun Jul 20 21:24:29 2014 (r268930) @@ -455,8 +455,10 @@ __vfprintf(FILE *fp, locale_t locale, co return (__xvprintf(fp, fmt0, ap)); /* sorry, fprintf(read_only_file, "") returns EOF, not 0 */ - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } convbuf = NULL; fmt = (char *)fmt0; Modified: head/lib/libc/stdio/vfwprintf.c ============================================================================== --- head/lib/libc/stdio/vfwprintf.c Sun Jul 20 21:02:35 2014 (r268929) +++ head/lib/libc/stdio/vfwprintf.c Sun Jul 20 21:24:29 2014 (r268930) @@ -531,8 +531,10 @@ __vfwprintf(FILE *fp, locale_t locale, c /* sorry, fwprintf(read_only_file, L"") returns WEOF, not 0 */ - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } convbuf = NULL; fmt = (wchar_t *)fmt0; Modified: head/lib/libc/stdio/wbuf.c ============================================================================== --- head/lib/libc/stdio/wbuf.c Sun Jul 20 21:02:35 2014 (r268929) +++ head/lib/libc/stdio/wbuf.c Sun Jul 20 21:24:29 2014 (r268930) @@ -36,6 +36,7 @@ static char sccsid[] = "@(#)wbuf.c 8.1 ( #include __FBSDID("$FreeBSD$"); +#include #include #include "local.h" @@ -59,8 +60,10 @@ __swbuf(int c, FILE *fp) * calls might wrap _w from negative to positive. */ fp->_w = fp->_lbfsize; - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } c = (unsigned char)c; ORIENT(fp, -1); From owner-svn-src-head@FreeBSD.ORG Sun Jul 20 22:13:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFF7EE94; Sun, 20 Jul 2014 22:13:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC7472224; Sun, 20 Jul 2014 22:13:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6KMDpoO008277; Sun, 20 Jul 2014 22:13:51 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6KMDpVU008275; Sun, 20 Jul 2014 22:13:51 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407202213.s6KMDpVU008275@svn.freebsd.org> From: Warren Block Date: Sun, 20 Jul 2014 22:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268931 - 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.18 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, 20 Jul 2014 22:13:51 -0000 Author: wblock (doc committer) Date: Sun Jul 20 22:13:51 2014 New Revision: 268931 URL: http://svnweb.freebsd.org/changeset/base/268931 Log: Correct spelling errors in ctld.8. While here, correct similar errors in ctl.conf.5 and fix a couple of contractions. PR: 191984 Submitted by: olgeni MFC after: 1 week Modified: head/usr.sbin/ctld/ctl.conf.5 head/usr.sbin/ctld/ctld.8 Modified: head/usr.sbin/ctld/ctl.conf.5 ============================================================================== --- head/usr.sbin/ctld/ctl.conf.5 Sun Jul 20 21:24:29 2014 (r268930) +++ head/usr.sbin/ctld/ctl.conf.5 Sun Jul 20 22:13:51 2014 (r268931) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2014 +.Dd July 20, 2014 .Dt CTL.CONF 5 .Os .Sh NAME @@ -104,14 +104,14 @@ The following statements are available a .It Ic auth-type Ao Ar type Ac Specifies authentication type. Type can be either "none", "deny", "chap", or "chap-mutual". -In most cases it is not neccessary to set the type using this clause; +In most cases it is not necessary to set the type using this clause; it is usually used to disable authentication for a given auth-group. .It Ic chap Ao Ar user Ac Aq Ar secret Specifies CHAP authentication credentials. .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret Specifies mutual CHAP authentication credentials. Note that for any auth-group, configuration may contain either chap, -or chap-mutual entries; it's an error to mix them. +or chap-mutual entries; it is an error to mix them. .It Ic initiator-name Ao Ar initiator-name Ac Specifies iSCSI initiator name. If not defined, there will be no restrictions based on initiator @@ -158,18 +158,18 @@ without authentication. .It Ic auth-type Ao Ar type Ac Specifies authentication type. Type can be either "none", "deny", "chap", or "chap-mutual". -In most cases it is not neccessary to set the type using this clause; +In most cases it is not necessary to set the type using this clause; it is usually used to disable authentication for a given target. This clause is mutually exclusive with auth-group; one cannot use both in a single target. .It Ic chap Ao Ar user Ac Aq Ar secret Specifies CHAP authentication credentials. Note that targets must use either auth-group, or chap, -or chap-mutual clauses; it's a configuration error to mix them in one target. +or chap-mutual clauses; it is a configuration error to mix them in one target. .It Ic chap-mutual Ao Ar user Ac Ao Ar secret Ac Ao Ar mutualuser Ac Aq Ar mutualsecret Specifies mutual CHAP authentication credentials. Note that targets must use either auth-group, chap, or -chap-mutual clauses; it's a configuration error to mix them in one target. +chap-mutual clauses; it is a configuration error to mix them in one target. .It Ic initiator-name Ao Ar initiator-name Ac Specifies iSCSI initiator name. If not defined, there will be no restrictions based on initiator Modified: head/usr.sbin/ctld/ctld.8 ============================================================================== --- head/usr.sbin/ctld/ctld.8 Sun Jul 20 21:24:29 2014 (r268930) +++ head/usr.sbin/ctld/ctld.8 Sun Jul 20 22:13:51 2014 (r268931) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2012 +.Dd July 20, 2014 .Dt CTLD 8 .Os .Sh NAME @@ -51,7 +51,7 @@ Then it compares the configuration with by previously running .Nm instances, removes LUNs no longer existing in the configuration file, -and creates new LUNs as neccessary. +and creates new LUNs as necessary. After that it listens for the incoming iSCSI connections, performs authentication, and, if successful, passes the connections to the kernel part of CTL iSCSI target, which handles it from that point. @@ -59,13 +59,13 @@ of CTL iSCSI target, which handles it fr When it receives a SIGHUP signal, the .Nm reloads its configuration and applies the changes to the kernel. -Changes are applied in a way that avoids unneccessary disruptions; +Changes are applied in a way that avoids unnecessary disruptions; for example removing one LUN does not affect other LUNs. .Pp When exiting gracefully, the .Nm daemon removes LUNs it managed and forcibly disconnects all the clients. -Otherwise - e.g. when killed with SIGKILL - LUNs stay configured +Otherwise - for example, when killed with SIGKILL - LUNs stay configured and clients remain connected. .Pp To perform administrative actions that apply to already connected From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 01:28:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49CA414D; Mon, 21 Jul 2014 01:28:12 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B0621C6; Mon, 21 Jul 2014 01:28:11 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id 3C8A11B1E2C; Sun, 20 Jul 2014 21:22:34 -0400 (EDT) Received: from app.lifanov.com (chat.lifanov.com [206.125.175.13]) by mail.lifanov.com (Postfix) with ESMTPA id 8FA651B1E2A; Sun, 20 Jul 2014 21:22:33 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 20 Jul 2014 21:22:33 -0400 From: Nikolai Lifanov To: Xin LI Subject: Re: svn commit: r268855 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys In-Reply-To: <201407182041.s6IKffMR077972@svn.freebsd.org> References: <201407182041.s6IKffMR077972@svn.freebsd.org> Message-ID: <5d0810f5950150ef60044acf239adb4a@mail.lifanov.com> X-Sender: lifanov@mail.lifanov.com User-Agent: Roundcube Webmail/1.0.1 Cc: svn-src-head@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 01:28:12 -0000 On 2014-07-18 16:41, Xin LI wrote: > Author: delphij > Date: Fri Jul 18 20:41:40 2014 > New Revision: 268855 > URL: http://svnweb.freebsd.org/changeset/base/268855 > > Log: > MFV r268848: > > Instead of asserting all zio's be properly aligned, only assert > on the logical ones. > > Cap uberblocks at 8k, otherwise with ashift=17, there would be > only one uberblock. > > This fixes a problem that zdb would trip assert on pools with > ashift >= 0xe (8k). > > While there, also change the code so it only attempt to condense > space map unless the uncondensed size consumes greater than > zfs_metaslab_condense_block_threshold blocks. > > Illumos issue: > 4958 zdb trips assert on pools with ashift >= 0xe > > MFC after: 2 weeks > This specific commit makes boot hang just before mounting the root dataset for me when vfs.zfs.vdev.cache.size tunable is set. Unsetting this tunable or reverting this commit (currently running r268933 minus r268855) fixes the boot for me. Please let me know if I can provide any more information. - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 02:56:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0D63A60F; Mon, 21 Jul 2014 02:56:08 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id C46342932; Mon, 21 Jul 2014 02:56:07 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id C560320E7088C; Mon, 21 Jul 2014 02:56:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 6ECE220E7088A; Mon, 21 Jul 2014 02:56:02 +0000 (UTC) Message-ID: <09AF6051EC3848B6B691A5570B5B065E@multiplay.co.uk> From: "Steven Hartland" To: "Nikolai Lifanov" , "Xin LI" References: <201407182041.s6IKffMR077972@svn.freebsd.org> <5d0810f5950150ef60044acf239adb4a@mail.lifanov.com> Subject: Re: svn commit: r268855 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys Date: Mon, 21 Jul 2014 03:56:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: svn-src-head@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 02:56:08 -0000 ----- Original Message ----- From: "Nikolai Lifanov" To: "Xin LI" Cc: ; Sent: Monday, July 21, 2014 2:22 AM Subject: Re: svn commit: r268855 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys > On 2014-07-18 16:41, Xin LI wrote: >> Author: delphij >> Date: Fri Jul 18 20:41:40 2014 >> New Revision: 268855 >> URL: http://svnweb.freebsd.org/changeset/base/268855 >> >> Log: >> MFV r268848: >> >> Instead of asserting all zio's be properly aligned, only assert >> on the logical ones. >> >> Cap uberblocks at 8k, otherwise with ashift=17, there would be >> only one uberblock. >> >> This fixes a problem that zdb would trip assert on pools with >> ashift >= 0xe (8k). >> >> While there, also change the code so it only attempt to condense >> space map unless the uncondensed size consumes greater than >> zfs_metaslab_condense_block_threshold blocks. >> >> Illumos issue: >> 4958 zdb trips assert on pools with ashift >= 0xe >> >> MFC after: 2 weeks >> > > This specific commit makes boot hang just before mounting the root dataset for me when vfs.zfs.vdev.cache.size tunable is set. > Unsetting this tunable or reverting this commit (currently running r268933 minus r268855) fixes the boot for me. > > Please let me know if I can provide any more information. Interesting, is there a reason you enabled vdev caching as its been disabled by default for quite some time with the comment: * TODO: Note that with the current ZFS code, it turns out that the * vdev cache is not helpful, and in some cases actually harmful. It * is better if we disable this. Once some time has passed, we should * actually remove this to simplify the code. For now we just disable * it by setting the zfs_vdev_cache_size to zero. Note that Solaris 11 * has made these same changes. Regards Steve From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 03:49:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE766327; Mon, 21 Jul 2014 03:49:57 +0000 (UTC) Received: from mail.lifanov.com (mail.lifanov.com [206.125.175.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C46582E57; Mon, 21 Jul 2014 03:49:57 +0000 (UTC) Received: by mail.lifanov.com (Postfix, from userid 58) id BA5D11B1E37; Sun, 20 Jul 2014 23:49:56 -0400 (EDT) Received: from app.lifanov.com (chat.lifanov.com [206.125.175.13]) by mail.lifanov.com (Postfix) with ESMTPA id 99CA41B1E35; Sun, 20 Jul 2014 23:49:55 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 20 Jul 2014 23:49:55 -0400 From: Nikolai Lifanov To: Steven Hartland Subject: Re: svn commit: r268855 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys In-Reply-To: <09AF6051EC3848B6B691A5570B5B065E@multiplay.co.uk> References: <201407182041.s6IKffMR077972@svn.freebsd.org> <5d0810f5950150ef60044acf239adb4a@mail.lifanov.com> <09AF6051EC3848B6B691A5570B5B065E@multiplay.co.uk> Message-ID: <1048c8cc25685b1216b0f1714c4494f1@mail.lifanov.com> X-Sender: lifanov@mail.lifanov.com User-Agent: Roundcube Webmail/1.0.1 Cc: svn-src-head@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 03:49:58 -0000 On 2014-07-20 22:56, Steven Hartland wrote: > ----- Original Message ----- From: "Nikolai Lifanov" > > To: "Xin LI" > Cc: ; > Sent: Monday, July 21, 2014 2:22 AM > Subject: Re: svn commit: r268855 - in head: > cddl/contrib/opensolaris/cmd/ztest > sys/cddl/contrib/opensolaris/uts/common/fs/zfs > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys > > >> On 2014-07-18 16:41, Xin LI wrote: >>> Author: delphij >>> Date: Fri Jul 18 20:41:40 2014 >>> New Revision: 268855 >>> URL: http://svnweb.freebsd.org/changeset/base/268855 >>> >>> Log: >>> MFV r268848: >>> >>> Instead of asserting all zio's be properly aligned, only assert >>> on the logical ones. >>> >>> Cap uberblocks at 8k, otherwise with ashift=17, there would be >>> only one uberblock. >>> >>> This fixes a problem that zdb would trip assert on pools with >>> ashift >= 0xe (8k). >>> >>> While there, also change the code so it only attempt to condense >>> space map unless the uncondensed size consumes greater than >>> zfs_metaslab_condense_block_threshold blocks. >>> >>> Illumos issue: >>> 4958 zdb trips assert on pools with ashift >= 0xe >>> >>> MFC after: 2 weeks >>> >> >> This specific commit makes boot hang just before mounting the root >> dataset for me when vfs.zfs.vdev.cache.size tunable is set. Unsetting >> this tunable or reverting this commit (currently running r268933 minus >> r268855) fixes the boot for me. >> >> Please let me know if I can provide any more information. > > Interesting, is there a reason you enabled vdev caching as its been > disabled by default for quite some time with the comment: > > * TODO: Note that with the current ZFS code, it turns out that the > * vdev cache is not helpful, and in some cases actually harmful. It > * is better if we disable this. Once some time has passed, we should > * actually remove this to simplify the code. For now we just disable > * it by setting the zfs_vdev_cache_size to zero. Note that Solaris 11 > * has made these same changes. > > Regards > Steve > > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" I noticed that it was disabled on default and I'm not seeing any ill effect now that I have it disabled. I don't find vdev cache beneficial, but I had it in my loader.conf for some time, and I had to remove it to get the system to boot. If it's going to be broken going forward, perhaps it's worthwhile to just remove the tunable? - Nikolai Lifanov From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 04:48:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C6329A2C; Mon, 21 Jul 2014 04:48:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1DC42292; Mon, 21 Jul 2014 04:48:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L4m3WX095786; Mon, 21 Jul 2014 04:48:03 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L4m3te095783; Mon, 21 Jul 2014 04:48:03 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407210448.s6L4m3te095783@svn.freebsd.org> From: Adrian Chadd Date: Mon, 21 Jul 2014 04:48:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268936 - 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.18 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, 21 Jul 2014 04:48:03 -0000 Author: adrian Date: Mon Jul 21 04:48:02 2014 New Revision: 268936 URL: http://svnweb.freebsd.org/changeset/base/268936 Log: Add the PCBGROUPS manpage. Thanks to wblock for helping me with this manpage. Added: head/share/man/man9/PCBGROUPS.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Jul 21 02:39:17 2014 (r268935) +++ head/share/man/man9/Makefile Mon Jul 21 04:48:02 2014 (r268936) @@ -188,6 +188,7 @@ MAN= accept_filter.9 \ osd.9 \ panic.9 \ pbuf.9 \ + PCBGROUPS.9 \ p_candebug.9 \ p_cansee.9 \ pci.9 \ Added: head/share/man/man9/PCBGROUPS.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 04:48:02 2014 (r268936) @@ -0,0 +1,228 @@ +.\" Copyright (c) 2014 Adrian Chadd +.\" 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. The name of the author may not be used to endorse or promote products +.\" derived from this software without specific prior written permission. +.\" +.\" 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 July 18, 2014 +.Dt PCBGROUPS 9 +.Os +.Sh NAME +.Nm PCBGROUPS +.Nd Distributed Protocol Control Block Groups +.Sh SYNOPSIS +.Ft void +.Fn in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields, int hash_nelements); +.Ft void +.Fn in_pcbgroup_destroy(struct inpcbinfo *pcbinfo); +.Ft struct inpcbgroup * +.Fn in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Ft struct inpcbgroup * +.Fn in_pcbgroup_byinpcb(struct inpcb *inp); +.Ft void +.Fn in_pcbgroup_update(struct inpcb *inp); +.Ft void +.Fn in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m); +.Ft void +.Fn in_pcbgroup_remove(struct inpcb *inp); +.Ft int +.Fn in_pcbgroup_enabled(struct inpcbinfo *pcbinfo); +.Ft struct inpcbgroup * +.Fn in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Pp +.Cd "options PCBGROUPS" +.Sh DESCRIPTION +PCBGROUPS, or "connection groups", are based on Willman, Rixner, and Cox's +2006 USENIX paper, +.Qo +An Evaluation of Network Stack Parallelization Strategies in Modern +Operating Systems +.Qc . +.Pp +The PCBGROUPS paper describes two main kind of connection groups. +The first, called ConnP-T, uses a pool of worker threads which +implement the network stack. +Serialization occurs when queuing work into and completing work from +the network stack. +No locking is required inside each worker thread. +.Pp +The second type of connection group, called ConnP-L, uses an array +of PCB groups rather than a single list. +Each PCB group is protected by its own lock. +.Pp +This implementation differs significantly from that described in the +paper, in that it attempts to introduce not just notions of affinity +for connections and distribute work so as to reduce lock contention, +but also align those notions with hardware work distribution strategies +such as RSS. +In this construction, connection groups supplement, rather than replace, +existing reservation tables for protocol 4-tuples, offering CPU-affine +lookup tables with minimal cache line migration and lock contention +during steady state operation. +.Pp +Internet protocols like UDP and TCP register to use connection groups +by providing an ipi_hashfields value other than IPI_HASHFIELDS_NONE. +This indicates to the connection group code whether a 2-tuple or +4-tuple is used as an argument to hashes that assign a connection to +a particular group. +This must be aligned with any hardware-offloaded distribution model, +such as RSS or similar approaches taken in embedded network boards. +Wildcard sockets require special handling, as in Willman 2006, and +are shared between connection groups while being protected by +group-local locks. +Connection establishment and teardown can be signficantly more +expensive than without connection groups, but that steady-state +processing can be significantly faster. +.Pp +Enabling PCBGROUPS in the kernel only provides the infrastructure +required to create and manage multiple PCB groups. +An implementation needs to fill in a few functions to provide PCB +group hash information in order for PCBs to be placed in a PCB group. +.Ss Operation +By default, each PCB info block (struct pcbinfo) has a single hash for +all PCB entries for the given protocol with a single lock protecting it. +This can be a significant source of lock contention on SMP hardware. +When a PCBGROUP is created, an array of separate hash tables are +created, each with its own lock. +A separate table for wildcard PCBs is provided. +By default, a PCBGROUP table is created for each available CPU. +The PCBGROUP code attempts to calculate a hash value from the given +PCB or mbuf when looking up a PCBGROUP. +While processing a received frame, +.Fn in_pcbgroup_byhash() +can be used in conjunction with either a hardware-provided hash +value +.Po +eg the +.Xr RSS 9 +calculated hash value provided by some NICs +.Pc +or a software-provided hash value in order to choose a PCBGROUP +table to query. +A single table lock is held while performing a wildcard match. +However, all of the table locks are acquired before modifying the +wildcard table. +The PCBGROUP tables operate in conjunction with the normal single PCB list +in a PCB info block. +Thus, inserting and removing a PCB will still incur the same costs +as without PCBGROUPS. +A protocol which uses PCBGROUPS should fall back to the normal PCB list +lookup if a call to the PCBGROUPS layer does not yield a lookup hit. +.Ss Usage +Initialize a PCBGROUP in a PCB info block +.Pq Vt "struct pcbinfo" +by calling +.Fn in_pcbgroup_init . +.Pp +Add a connection to a PCBGROUP with +.Fn in_pcbgroup_update . +Connections are removed by with +.Fn in_pcbgroup_remove . +These in turn will determine which PCBGROUP bucket the given PCB +is placed into and calculate the hash value appropriately. +.Pp +Wildcard PCBs are hashed differently and placed in a single wildcard +PCB list. +If +.Xr RSS 9 +is enabled and in use, RSS-aware wildcard PCBs are placed in a single +PCBGROUP based on RSS information. +Protocols may look up the PCB entry in a PCBGROUP by using the lookup +functions +.Fn in_pcbgroup_byhash +and +.Fn in_pcbgroup_byinpcb . +.Sh IMPLEMENTATION NOTES +The PCB code in +.Pa sys/netinet +and +.Pa sys/netinet6 +is aware of PCBGROUPS and will call into the PCBGROUPS code to do +PCBGROUP assignment and lookup, preferring a PCBGROUP lookup to the +default global PCB info table. +.Pp +An implementor wishing to experiment or modify the PCBGROUP assignment +should modify this set of functions: +.Bl -tag -width "12345678" -offset indent +.It Fn in_pcbgroup_getbucket No and Fn in6_pcbgroup_getbucket +Map a given 32 bit hash value to a PCBGROUP. +By default this is hash % number_of_pcbgroups. +However, this distribution may not align with NIC receive queues or +the +.Xr netisr 9 +configuration. +.It Fn in_pcbgroup_byhash No and Fn in6_pcbgroup_byhash +Map a 32 bit hash value and a hash type identifier to a PCBGROUP. +By default, this simply returns NULL. +This function is used by the +.Xr mbuf 9 +receive path in +.Pa sys/netinet/in_pcb.c +to map an mbuf to a PCBGROUP. +.It Fn in_pcbgroup_bytuple No and Fn in6_pcbgroup_bytuple +Map the source and destination address and port details to a PCBGROUP. +By default, this does a very simple XOR hash. +This function is used by both the PCB lookup code and as a fallback in +the +.Xr mbuf 9 +receive path in +.Pa sys/netinet/in_pcb.c . +.El +.Sh SEE ALSO +.Xr mbuf 9 , +.Xr RSS 9 , +.Xr netisr 9 +.Sh HISTORY +PCBGROUPS first appeared in FreeBSD 9.0. +.Pp +The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's +2006 USENIX paper, +.Qo +An Evaluation of Network Stack Parallelization Strategies in Modern +Operating Systems +.Qc : +.Li http://www.ece.rice.edu/~willmann/pubs/paranet_usenix.pdf +.Sh AUTHORS +.An -nosplit +The PCBGROUPS implementation was written by +.An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org +under contract to Juniper Networks, Inc. +.Pp +This manual page written by +.An Adrian Chadd Aq Mt adrian@FreeBSD.org . +.Sh NOTES +The +.Xr RSS 9 +implementation currently uses +.Ic #ifdef +blocks to tie into PCBGROUPS. +This is a sign that a more abstract programming API is needed. +.Pp +There is currently no support for re-balancing the PCBGROUPS assignment, +nor is there any support for overriding which PCBGROUP a socket/PCB +should be in. +.Pp +No statistics are kept to indicate how often PCBGROUPS lookups +succeed or fail. From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 07:07:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDE5F7DE; Mon, 21 Jul 2014 07:07:36 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EFC22D38; Mon, 21 Jul 2014 07:07:36 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id w7so5175498qcr.26 for ; Mon, 21 Jul 2014 00:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=7n+f+/bYcFPtnH7lrIMhrhTe/lV8Ztn1lWg+1rfitLE=; b=rlw5gMXRBY/+qUweaifNXiLY5vM1g4GvlY5i3US1HR2wVK09FQ0W2cQCDPVeSVAN1u M9RFYa83qbXbciLQPrCT4iTLsVhyVWWKCeQ/MepQ6lbRj5RhFGYPfmgXbNrIZOHf5J+u zUWmPCrmSe+6O3F9phNyt4L/8F5leUYgdY0/+5AvV8ho5WMAONb1aDvs4K0NkzD+r2Ad Lt11OmMMywSMHnj0vO4QBnc8aggnxdocN6dCxzwULsUUqg6g0STdj0S6qkfmNRkk2ys7 zJuGYjv6JRgJTtWcRHonWB3JuzNQ5Nd9k9tJX2kz9hyZfilKn3uE2qL6apkldQwVCS5P xmtg== MIME-Version: 1.0 X-Received: by 10.224.36.130 with SMTP id t2mr7402849qad.45.1405926455296; Mon, 21 Jul 2014 00:07:35 -0700 (PDT) Sender: hiren.panchasara@gmail.com Received: by 10.96.73.39 with HTTP; Mon, 21 Jul 2014 00:07:35 -0700 (PDT) In-Reply-To: <201407210448.s6L4m3te095783@svn.freebsd.org> References: <201407210448.s6L4m3te095783@svn.freebsd.org> Date: Mon, 21 Jul 2014 00:07:35 -0700 X-Google-Sender-Auth: 21CA9Q-lRAzkEJiJOWxXzAWZl5s Message-ID: Subject: Re: svn commit: r268936 - head/share/man/man9 From: hiren panchasara To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 07:07:36 -0000 On Sun, Jul 20, 2014 at 9:48 PM, Adrian Chadd wrote: > Author: adrian > Date: Mon Jul 21 04:48:02 2014 > New Revision: 268936 > URL: http://svnweb.freebsd.org/changeset/base/268936 > > Log: > Add the PCBGROUPS manpage. > > Thanks to wblock for helping me with this manpage. Thanks a lot. Any plans to mfc this? cheers, Hiren From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 07:20:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F33B1A68; Mon, 21 Jul 2014 07:20:16 +0000 (UTC) Received: from mail-qc0-x22f.google.com (mail-qc0-x22f.google.com [IPv6:2607:f8b0:400d:c01::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82C412E4A; Mon, 21 Jul 2014 07:20:16 +0000 (UTC) Received: by mail-qc0-f175.google.com with SMTP id w7so5211062qcr.20 for ; Mon, 21 Jul 2014 00:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=MCkGvAdH+e1RtecMpt/iqKto0q+VdCLz5100OKofNYY=; b=cAzenh3XuRuipQ3v8Vgwco9/MMIe448s5k29mDs5FjhlQL2i7u5IOis2xK74dspMZo X/hjkG4w7WoDPeL+BrZA14BTnNQhHAY5zkrRfc5CSxqttLWwC2305zKVvGugCg4GJUj4 yCnBCyYCPi422yjB0RTZ3OZC5r+GHV9lwwy36KdOjZyKsjhhS07UwEcmbtIheQrbD/1D cmeL7NEgr34jy3NrvR7lqJxV8PZ0VQG4wE/8eHpWBDJE8+Fndv8QH7VkTIwGDzDZNpUi 1XppxeEVESDjTd7uS9SBVSVM+pN7i1nvL7yQmfldI/E0ReFdaJ2dkRtY20uVMvtSSAK8 MYJA== MIME-Version: 1.0 X-Received: by 10.229.171.196 with SMTP id i4mr38044922qcz.15.1405927215667; Mon, 21 Jul 2014 00:20:15 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Mon, 21 Jul 2014 00:20:15 -0700 (PDT) In-Reply-To: References: <201407210448.s6L4m3te095783@svn.freebsd.org> Date: Mon, 21 Jul 2014 00:20:15 -0700 X-Google-Sender-Auth: U6j_prB14pl03WEiJcXAHwFEMas Message-ID: Subject: Re: svn commit: r268936 - head/share/man/man9 From: Adrian Chadd To: hiren panchasara Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head , svn-src-all , src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 07:20:17 -0000 I don't have any plans to MFC it but if someone wants to vet it for correctness on -10 then please do MFC it as appropriate. Thanks! -a On 21 July 2014 00:07, hiren panchasara wrote: > On Sun, Jul 20, 2014 at 9:48 PM, Adrian Chadd wrote: >> Author: adrian >> Date: Mon Jul 21 04:48:02 2014 >> New Revision: 268936 >> URL: http://svnweb.freebsd.org/changeset/base/268936 >> >> Log: >> Add the PCBGROUPS manpage. >> >> Thanks to wblock for helping me with this manpage. > > Thanks a lot. Any plans to mfc this? > > cheers, > Hiren From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 08:42:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34756BC7; Mon, 21 Jul 2014 08:42:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07BD228C1; Mon, 21 Jul 2014 08:42:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L8gZDw007213; Mon, 21 Jul 2014 08:42:35 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L8gZeo007212; Mon, 21 Jul 2014 08:42:35 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407210842.s6L8gZeo007212@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Jul 2014 08:42:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268938 - 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.18 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, 21 Jul 2014 08:42:36 -0000 Author: pluknet Date: Mon Jul 21 08:42:35 2014 New Revision: 268938 URL: http://svnweb.freebsd.org/changeset/base/268938 Log: [mdoc] cleanup Modified: head/share/man/man9/PCBGROUPS.9 Modified: head/share/man/man9/PCBGROUPS.9 ============================================================================== --- head/share/man/man9/PCBGROUPS.9 Mon Jul 21 06:45:19 2014 (r268937) +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:42:35 2014 (r268938) @@ -34,23 +34,29 @@ .Nd Distributed Protocol Control Block Groups .Sh SYNOPSIS .Ft void -.Fn in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields, int hash_nelements); +.Fo in_pcbgroup_init +.Fa "struct inpcbinfo *pcbinfo" "u_int hashfields" "int hash_nelements" +.Fc .Ft void -.Fn in_pcbgroup_destroy(struct inpcbinfo *pcbinfo); +.Fn in_pcbgroup_destroy "struct inpcbinfo *pcbinfo" .Ft struct inpcbgroup * -.Fn in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Fo in_pcbgroup_byhash +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" +.Fc .Ft struct inpcbgroup * -.Fn in_pcbgroup_byinpcb(struct inpcb *inp); +.Fn in_pcbgroup_byinpcb "struct inpcb *inp" .Ft void -.Fn in_pcbgroup_update(struct inpcb *inp); +.Fn in_pcbgroup_update "struct inpcb *inp" .Ft void -.Fn in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m); +.Fn in_pcbgroup_update_mbuf "struct inpcb *inp" "struct mbuf *m" .Ft void -.Fn in_pcbgroup_remove(struct inpcb *inp); +.Fn in_pcbgroup_remove "struct inpcb *inp" .Ft int -.Fn in_pcbgroup_enabled(struct inpcbinfo *pcbinfo); +.Fn in_pcbgroup_enabled "struct inpcbinfo *pcbinfo" .Ft struct inpcbgroup * -.Fn in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); +.Fo in6_pcbgroup_byhash +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" +.Fc .Pp .Cd "options PCBGROUPS" .Sh DESCRIPTION @@ -111,7 +117,7 @@ By default, a PCBGROUP table is created The PCBGROUP code attempts to calculate a hash value from the given PCB or mbuf when looking up a PCBGROUP. While processing a received frame, -.Fn in_pcbgroup_byhash() +.Fn in_pcbgroup_byhash can be used in conjunction with either a hardware-provided hash value .Po @@ -192,10 +198,11 @@ receive path in .El .Sh SEE ALSO .Xr mbuf 9 , -.Xr RSS 9 , -.Xr netisr 9 +.Xr netisr 9 , +.Xr RSS 9 .Sh HISTORY -PCBGROUPS first appeared in FreeBSD 9.0. +PCBGROUPS first appeared in +.Fx 9.0. .Pp The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's 2006 USENIX paper, From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 08:47:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EC839DD5; Mon, 21 Jul 2014 08:47:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9AA228F2; Mon, 21 Jul 2014 08:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6L8lsCm007876; Mon, 21 Jul 2014 08:47:54 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6L8lsX9007875; Mon, 21 Jul 2014 08:47:54 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407210847.s6L8lsX9007875@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 21 Jul 2014 08:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268939 - 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.18 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, 21 Jul 2014 08:47:55 -0000 Author: pluknet Date: Mon Jul 21 08:47:54 2014 New Revision: 268939 URL: http://svnweb.freebsd.org/changeset/base/268939 Log: Fixed fallout from previous change. Modified: head/share/man/man9/PCBGROUPS.9 Modified: head/share/man/man9/PCBGROUPS.9 ============================================================================== --- head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:42:35 2014 (r268938) +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:47:54 2014 (r268939) @@ -202,7 +202,7 @@ receive path in .Xr RSS 9 .Sh HISTORY PCBGROUPS first appeared in -.Fx 9.0. +.Fx 9.0 . .Pp The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's 2006 USENIX paper, From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 09:07:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from ptrcrt.ch (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFDA359E; Mon, 21 Jul 2014 09:07:22 +0000 (UTC) Date: Mon, 21 Jul 2014 11:07:18 +0200 From: Pietro Cerutti To: Bryan Drewery Subject: Re: svn commit: r268494 - in head: lib/libsbuf sys/kern sys/sys Message-ID: <20140721090718.GC51328@ptrcrt.ch> Reply-To: gahr@FreeBSD.org References: <201407101308.s6AD8pbR080041@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LyciRD1jyfeSSjG0" Content-Disposition: inline In-Reply-To: X-PGP-Key: fp="DA6D E106 A5B8 54B8 5DD8 6D49 ADD0 D38E A192 089E"; id="0xA192089E"; get=; get=; User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 09:07:24 -0000 --LyciRD1jyfeSSjG0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2014-Jul-18, 18:47, Bryan Drewery wrote: > On 2014-07-10 08:08, Pietro Cerutti wrote: > > Author: gahr (ports committer) > > Date: Thu Jul 10 13:08:51 2014 > > New Revision: 268494 > > URL: http://svnweb.freebsd.org/changeset/base/268494 > >=20 > > Log: > > Implement Short/Small String Optimization in SBUF(9) and change=20 > > lengths and > > positions in the API from ssize_t and int to size_t. > >=20 > > CR: D388 > > Approved by: des, bapt > >=20 > > Modified: > > head/lib/libsbuf/Makefile > > head/sys/kern/subr_sbuf.c > > head/sys/sys/sbuf.h > >=20 > > Modified: head/lib/libsbuf/Makefile > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/lib/libsbuf/Makefile Thu Jul 10 13:04:52 2014 (r268493) > > +++ head/lib/libsbuf/Makefile Thu Jul 10 13:08:51 2014 (r268494) > > @@ -4,7 +4,7 @@ LIB=3D sbuf > > SHLIBDIR?=3D /lib > > SRCS=3D subr_sbuf.c > >=20 > > -SHLIB_MAJOR =3D 6 > > +SHLIB_MAJOR =3D 7 > >=20 > > SYMBOL_MAPS=3D ${.CURDIR}/Symbol.map > > VERSION_DEF=3D ${.CURDIR}/Version.def > >=20 >=20 > We have symbol versioning in libsbuf. Shouldn't need to bump the=20 > version. Just need to add a compat function for everything. It would be= =20 > a lot of work, but bumping for ssize_t->size_t seems gratuitous to me. The bump was due mainly to the addition of the s_static_buf field to the sbuf struct. --=20 Pietro Cerutti The FreeBSD Project gahr@FreeBSD.org PGP Public Key: http://gahr.ch/pgp --LyciRD1jyfeSSjG0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQJ8BAEBCgBmBQJTzNhGXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQTZERTEwNkE1Qjg1NEI4NUREODZENDlB REQwRDM4RUExOTIwODlFAAoJEK3Q046hkgie0L8P/1ZDdbBcqq5R2LZB2aN5RWxU 77tpZeTzV576p1pkvzvkt+OUlVvBpxrjOA7o+PEmw0w1BzIIS4Mz2OUqNuci/M3K EU/ar1yyQghEknXiS8MW4KfpPJqSbInfnnXv+/i6YTjSVN4SH7ZVMZoucmfub9zI iZSn29ZGhXMgUBvEDyH09uGsyAvOcVcGX0UuZKHXV3VNiYOwz1WvWYhbls9Zky3b 2nG0CM5v+JURJfC3xE13EHkq6gkDSWFbd3SK0psdQOKfRVhTs6n7cKIRdaghIKFo KK+CuVQJKI16FRDex3bh4zZgpAu/iTvRpxBQsx/IL9WUEIL7rChDgvFQ+ok9aDCB 9iteikJqK40NQyM/LgfYdPgFENYKgti3+sxbwBOvRvu183FQrTdPhC/1uiE07zrp AUAG/vUAWCR/5l4qYjrjIfgz+LkCap7d2WdddLQEiY39LwqVHipe1S5afhg3kFoh cDmC4KYX9GGvzuPpqb4jroyDD0zoeFLfcspkTXfr03kRN27E82IQrLFbVq/6IOHj 3qzasU0B0c4kHHJtrTEJYCSmIlb/GcK0QRsPQ/VIJhe6ttGnov9KLrnmdeunvfM6 v4aaKFOUhxYGuzn5C5RPcGuXXAHa7NL/hg619HGKWMk4W1P7Wf0AhBJyp9KWtAgm xb6WQspUNRbkn6NcmZ2Y =DXz8 -----END PGP SIGNATURE----- --LyciRD1jyfeSSjG0-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 15:18:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C56FEB8F; Mon, 21 Jul 2014 15:18:07 +0000 (UTC) Received: from mail-qa0-x231.google.com (mail-qa0-x231.google.com [IPv6:2607:f8b0:400d:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5482D20EC; Mon, 21 Jul 2014 15:18:07 +0000 (UTC) Received: by mail-qa0-f49.google.com with SMTP id dc16so5194125qab.22 for ; Mon, 21 Jul 2014 08:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=kddszopaxVhHqUYcb46L+rz8dittSNuW3FfPm/Zrj2U=; b=pVATJ7cAxJ0oVE/S0UtsmEb964V5rKwpdHM5y0kxhWP5gmyvigTA+ow0TAzqm+bC1F fh3w7AMd8XEhah62lMGvXWNYjAQnYawiwhaIpgNzs064mdZI9qqWZQtIfWFOVn+V3U2I FL4dkpFyRFkpBN6BRBoCFiBnhxci//fP0EPE4DnYqeGYjl876JGAy4XCBhKUvjvz8iSY dU0NfI9fioGc/EMOaGqQCbrjmVlf8Um9oKNwwLyO/zBD2vXD3fANWXKDkm5zeZIduSL9 QQnZ5yCMroTuupBAlYx3xnMOnykk1QPZUpI0ZHRP89cY/xPKj7X1FYhwiVV+VjsyhhVg EupA== MIME-Version: 1.0 X-Received: by 10.224.223.135 with SMTP id ik7mr44773282qab.26.1405955886457; Mon, 21 Jul 2014 08:18:06 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Mon, 21 Jul 2014 08:18:06 -0700 (PDT) In-Reply-To: <201407210842.s6L8gZeo007212@svn.freebsd.org> References: <201407210842.s6L8gZeo007212@svn.freebsd.org> Date: Mon, 21 Jul 2014 08:18:06 -0700 X-Google-Sender-Auth: BYap5o9qXZSX_37BJMSNR7s_hOQ Message-ID: Subject: Re: svn commit: r268938 - head/share/man/man9 From: Adrian Chadd To: Sergey Kandaurov Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 15:18:08 -0000 thanks! -a On 21 July 2014 01:42, Sergey Kandaurov wrote: > Author: pluknet > Date: Mon Jul 21 08:42:35 2014 > New Revision: 268938 > URL: http://svnweb.freebsd.org/changeset/base/268938 > > Log: > [mdoc] cleanup > > Modified: > head/share/man/man9/PCBGROUPS.9 > > Modified: head/share/man/man9/PCBGROUPS.9 > ============================================================================== > --- head/share/man/man9/PCBGROUPS.9 Mon Jul 21 06:45:19 2014 (r268937) > +++ head/share/man/man9/PCBGROUPS.9 Mon Jul 21 08:42:35 2014 (r268938) > @@ -34,23 +34,29 @@ > .Nd Distributed Protocol Control Block Groups > .Sh SYNOPSIS > .Ft void > -.Fn in_pcbgroup_init(struct inpcbinfo *pcbinfo, u_int hashfields, int hash_nelements); > +.Fo in_pcbgroup_init > +.Fa "struct inpcbinfo *pcbinfo" "u_int hashfields" "int hash_nelements" > +.Fc > .Ft void > -.Fn in_pcbgroup_destroy(struct inpcbinfo *pcbinfo); > +.Fn in_pcbgroup_destroy "struct inpcbinfo *pcbinfo" > .Ft struct inpcbgroup * > -.Fn in_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); > +.Fo in_pcbgroup_byhash > +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" > +.Fc > .Ft struct inpcbgroup * > -.Fn in_pcbgroup_byinpcb(struct inpcb *inp); > +.Fn in_pcbgroup_byinpcb "struct inpcb *inp" > .Ft void > -.Fn in_pcbgroup_update(struct inpcb *inp); > +.Fn in_pcbgroup_update "struct inpcb *inp" > .Ft void > -.Fn in_pcbgroup_update_mbuf(struct inpcb *inp, struct mbuf *m); > +.Fn in_pcbgroup_update_mbuf "struct inpcb *inp" "struct mbuf *m" > .Ft void > -.Fn in_pcbgroup_remove(struct inpcb *inp); > +.Fn in_pcbgroup_remove "struct inpcb *inp" > .Ft int > -.Fn in_pcbgroup_enabled(struct inpcbinfo *pcbinfo); > +.Fn in_pcbgroup_enabled "struct inpcbinfo *pcbinfo" > .Ft struct inpcbgroup * > -.Fn in6_pcbgroup_byhash(struct inpcbinfo *pcbinfo, u_int hashtype, uint32_t hash); > +.Fo in6_pcbgroup_byhash > +.Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" > +.Fc > .Pp > .Cd "options PCBGROUPS" > .Sh DESCRIPTION > @@ -111,7 +117,7 @@ By default, a PCBGROUP table is created > The PCBGROUP code attempts to calculate a hash value from the given > PCB or mbuf when looking up a PCBGROUP. > While processing a received frame, > -.Fn in_pcbgroup_byhash() > +.Fn in_pcbgroup_byhash > can be used in conjunction with either a hardware-provided hash > value > .Po > @@ -192,10 +198,11 @@ receive path in > .El > .Sh SEE ALSO > .Xr mbuf 9 , > -.Xr RSS 9 , > -.Xr netisr 9 > +.Xr netisr 9 , > +.Xr RSS 9 > .Sh HISTORY > -PCBGROUPS first appeared in FreeBSD 9.0. > +PCBGROUPS first appeared in > +.Fx 9.0. > .Pp > The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's > 2006 USENIX paper, > From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 15:22:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3F7A3123; Mon, 21 Jul 2014 15:22:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AFF921B2; Mon, 21 Jul 2014 15:22:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFMoo5084641; Mon, 21 Jul 2014 15:22:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFMnQo084633; Mon, 21 Jul 2014 15:22:49 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211522.s6LFMnQo084633@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268943 - in head: include lib/libc/stdlib 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.18 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, 21 Jul 2014 15:22:50 -0000 Author: pfg Date: Mon Jul 21 15:22:48 2014 New Revision: 268943 URL: http://svnweb.freebsd.org/changeset/base/268943 Log: Add re-entrant versions of the hash functions based on the GNU api. While testing this I found a conformance issue in hdestroy() that will be fixed in a subsequent commit. Obtained from: NetBSD (hcreate.c, CVS Rev. 1.7) Modified: head/include/search.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/hcreate.3 head/lib/libc/stdlib/hcreate.c Modified: head/include/search.h ============================================================================== --- head/include/search.h Mon Jul 21 14:36:35 2014 (r268942) +++ head/include/search.h Mon Jul 21 15:22:48 2014 (r268943) @@ -1,8 +1,8 @@ /*- - * Written by J.T. Conklin + * Written by J.T. Conklin * Public domain. * - * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ + * $NetBSD: search.h,v 1.16 2005/02/03 04:39:32 perry Exp $ * $FreeBSD$ */ @@ -45,6 +45,15 @@ struct que_elem { }; #endif +#if __BSD_VISIBLE +struct _ENTRY; +struct hsearch_data { + struct _ENTRY *table; + size_t size; + size_t filled; +}; +#endif + __BEGIN_DECLS int hcreate(size_t); void hdestroy(void); @@ -61,6 +70,13 @@ void *tfind(const void *, void * const * int (*)(const void *, const void *)); void *tsearch(const void *, void **, int (*)(const void *, const void *)); void twalk(const void *, void (*)(const void *, VISIT, int)); + +#if __BSD_VISIBLE +int hcreate_r(size_t, struct hsearch_data *); +void hdestroy_r(struct hsearch_data *); +int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *); +#endif + __END_DECLS #endif /* !_SEARCH_H_ */ Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/Makefile.inc Mon Jul 21 15:22:48 2014 (r268943) @@ -35,6 +35,7 @@ MLINKS+=exit.3 _Exit.3 MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3 MLINKS+=getopt_long.3 getopt_long_only.3 MLINKS+=hcreate.3 hdestroy.3 hcreate.3 hsearch.3 +MLINKS+=hcreate.3 hcreate_r.3 hcreate.3 hdestroy_r.3 hcreate.3 hsearch_r.3 MLINKS+=insque.3 remque.3 MLINKS+=lsearch.3 lfind.3 MLINKS+=ptsname.3 grantpt.3 ptsname.3 unlockpt.3 Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/Symbol.map Mon Jul 21 15:22:48 2014 (r268943) @@ -109,6 +109,9 @@ FBSD_1.4 { heapsort_b; mergesort_b; qsort_b; + hcreate_r; + hdestroy_r; + hsearch_r; }; FBSDprivate_1.0 { Modified: head/lib/libc/stdlib/hcreate.3 ============================================================================== --- head/lib/libc/stdlib/hcreate.3 Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/hcreate.3 Mon Jul 21 15:22:48 2014 (r268943) @@ -28,11 +28,16 @@ .\" .\" $FreeBSD$ .\" -.Dd July 6, 2008 +.Dd July 21, 2014 .Dt HCREATE 3 .Os .Sh NAME -.Nm hcreate , hdestroy , hsearch +.Nm hcreate , +.Nm hcreate_r , +.Nm hdestroy , +.Nm hdestroy_r , +.Nm hsearch , +.Nm hsearch_r .Nd manage hash search table .Sh LIBRARY .Lb libc @@ -40,16 +45,25 @@ .In search.h .Ft int .Fn hcreate "size_t nel" +.Ft int +.Fn hcreate_r "size_t nel" "struct hsearch_data *table" +.Ft void +.Fn hdestroy "void" .Ft void -.Fn hdestroy void +.Fn hdestroy_r "struct hsearch_data *table" .Ft ENTRY * .Fn hsearch "ENTRY item" "ACTION action" +.Ft int +.Fn hsearch_r "ENTRY item" "ACTION action" "ENTRY ** itemp" "struct hsearch_data *table" .Sh DESCRIPTION The .Fn hcreate , +.Fn hcreate_r , .Fn hdestroy , +.Fn hdestroy_r +.Fn hsearch , and -.Fn hsearch +.Fn hsearch_r functions manage hash search tables. .Pp The @@ -90,7 +104,7 @@ argument is a structure of type .Vt ENTRY (defined in the .In search.h -header) containing two pointers: +header) that contains two pointers: .Fa item.key points to the comparison key (a .Vt "char *" ) , @@ -136,21 +150,50 @@ is and .Fn hdestroy is called. +.Pp +The +.Fn hcreate_r , +.Fn hdestroy_r , +and +.Fn hsearch_r +functions are re-entrant versions of the above functions that can +operate on a table supplied by the user. +The +.Fn hsearch_r +function returns +.Dv 0 +if the action is +.Dv ENTER +and the element cannot be created, +.Dv 1 +otherwise. +If the element exists or can be created, it will be placed in +.Fa itemp , +otherwise +.Fa itemp +will be set to +.Dv NULL . .Sh RETURN VALUES The .Fn hcreate -function returns 0 if the table creation failed and the global variable +and +.Fn hcreate_r +functions return 0 if the table creation failed and the global variable .Va errno is set to indicate the error; otherwise, a non-zero value is returned. .Pp The .Fn hdestroy -function does not return a value. +and +.Fn hdestroy_r +functions return no value. .Pp The .Fn hsearch -function returns a +and +.Fn hsearch_r +functions return a .Dv NULL pointer if either the .Fa action @@ -223,15 +266,31 @@ main(void) .Sh ERRORS The .Fn hcreate -and +.Fn hcreate_r , .Fn hsearch -functions may fail if: +and +.Fn hsearch_r +functions will fail if: .Bl -tag -width Er .It Bq Er ENOMEM -Insufficient storage space is available. +Insufficient memory is available. .It Bq Er EINVAL A table already exists. .El +.Pp +The +.Fn hsearch +and +.Fn hsearch_r +functions will also fail if the action is +.Dv SEARCH +and the element is not found: +.Bl -tag -width Er +.It Bq Er ESRCH +The +.Fa item +given is not found. +.El .Sh SEE ALSO .Xr bsearch 3 , .Xr lsearch 3 , @@ -254,5 +313,15 @@ and .Fn hsearch functions first appeared in .At V . +The +.Fn hcreate_r , +.Fn hdestroy_r +and +.Fn hsearch_r +functions are +.Tn GNU +extensions. .Sh BUGS -The interface permits the use of only one hash table at a time. +The original, +.Pf non- Tn GNU +interface permits the use of only one hash table at a time. Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 14:36:35 2014 (r268942) +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:22:48 2014 (r268943) @@ -1,4 +1,4 @@ -/* $NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $ */ +/* $NetBSD: hcreate.c,v 1.7 2011/09/14 23:33:51 christos Exp $ */ /* * Copyright (c) 2001 Christopher G. Demetriou @@ -49,7 +49,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: hcreate.c,v 1.6 2008/07/21 12:05:43 lukem Exp $"); +__RCSID("$NetBSD: hcreate.c,v 1.7 2011/09/14 23:33:51 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); @@ -84,20 +84,27 @@ SLIST_HEAD(internal_head, internal_entry /* Default hash function, from db/hash/hash_func.c */ extern u_int32_t (*__default_hash)(const void *, size_t); -static struct internal_head *htable; -static size_t htablesize; +static struct hsearch_data htable; int hcreate(size_t nel) { - size_t idx; - unsigned int p2; /* Make sure this is not called when a table already exists. */ - if (htable != NULL) { + if (htable.table != NULL) { errno = EINVAL; return 0; } + return hcreate_r(nel, &htable); +} + +int +hcreate_r(size_t nel, struct hsearch_data *head) +{ + struct internal_head *table; + size_t idx; + unsigned int p2; + void *p; /* If nel is too small, make it min sized. */ if (nel < MIN_BUCKETS) @@ -115,16 +122,19 @@ hcreate(size_t nel) } /* Allocate the table. */ - htablesize = nel; - htable = malloc(htablesize * sizeof htable[0]); - if (htable == NULL) { + head->size = nel; + head->filled = 0; + p = malloc(nel * sizeof table[0]); + if (p == NULL) { errno = ENOMEM; return 0; } + head->table = p; + table = p; /* Initialize it. */ - for (idx = 0; idx < htablesize; idx++) - SLIST_INIT(&htable[idx]); + for (idx = 0; idx < nel; idx++) + SLIST_INIT(&table[idx]); return 1; } @@ -132,54 +142,83 @@ hcreate(size_t nel) void hdestroy(void) { + hdestroy_r(&htable); +} + +void +hdestroy_r(struct hsearch_data *head) +{ struct internal_entry *ie; size_t idx; + void *p; + struct internal_head *table; - if (htable == NULL) + if (head == NULL) return; - for (idx = 0; idx < htablesize; idx++) { - while (!SLIST_EMPTY(&htable[idx])) { - ie = SLIST_FIRST(&htable[idx]); - SLIST_REMOVE_HEAD(&htable[idx], link); + p = head->table; + head->table = NULL; + table = p; + + for (idx = 0; idx < head->size; idx++) { + while (!SLIST_EMPTY(&table[idx])) { + ie = SLIST_FIRST(&table[idx]); + SLIST_REMOVE_HEAD(&table[idx], link); free(ie->ent.key); free(ie); } } - free(htable); - htable = NULL; + free(table); } ENTRY * hsearch(ENTRY item, ACTION action) { - struct internal_head *head; + ENTRY *ep; + (void)hsearch_r(item, action, &ep, &htable); + return ep; +} + +int +hsearch_r(ENTRY item, ACTION action, ENTRY **itemp, struct hsearch_data *head) +{ + struct internal_head *table, *chain; struct internal_entry *ie; uint32_t hashval; size_t len; + void *p; + + p = head->table; + table = p; len = strlen(item.key); hashval = (*__default_hash)(item.key, len); - head = &htable[hashval & (htablesize - 1)]; - ie = SLIST_FIRST(head); + chain = &table[hashval & (head->size - 1)]; + ie = SLIST_FIRST(chain); while (ie != NULL) { if (strcmp(ie->ent.key, item.key) == 0) break; ie = SLIST_NEXT(ie, link); } - if (ie != NULL) - return &ie->ent; - else if (action == FIND) - return NULL; + if (ie != NULL) { + *itemp = &ie->ent; + return 1; + } else if (action == FIND) { + *itemp = NULL; + errno = ESRCH; + return 1; + } ie = malloc(sizeof *ie); if (ie == NULL) - return NULL; + return 0; ie->ent.key = item.key; ie->ent.data = item.data; - SLIST_INSERT_HEAD(head, ie, link); - return &ie->ent; + SLIST_INSERT_HEAD(chain, ie, link); + *itemp = &ie->ent; + head->filled++; + return 1; } From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 15:26:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 156AE2DE; Mon, 21 Jul 2014 15:26:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01E5D21F0; Mon, 21 Jul 2014 15:26:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFQqAU085127; Mon, 21 Jul 2014 15:26:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFQq5L085126; Mon, 21 Jul 2014 15:26:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211526.s6LFQq5L085126@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268944 - head/lib/libc/stdlib 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.18 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, 21 Jul 2014 15:26:53 -0000 Author: pfg Date: Mon Jul 21 15:26:52 2014 New Revision: 268944 URL: http://svnweb.freebsd.org/changeset/base/268944 Log: Update license. NetBSD has removed the advertisement clause from this file. Obtained from: NetBSD (CVS rev. 1,8) Modified: head/lib/libc/stdlib/hcreate.c Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:22:48 2014 (r268943) +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 (r268944) @@ -12,12 +12,7 @@ * 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 for the - * NetBSD Project. See http://www.NetBSD.org/ for - * information about NetBSD. - * 4. The name of the author may not be used to endorse or promote products + * 3. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR @@ -49,7 +44,7 @@ #include #if 0 #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: hcreate.c,v 1.7 2011/09/14 23:33:51 christos Exp $"); +__RCSID("$NetBSD: hcreate.c,v 1.8 2011/09/17 16:54:39 christos Exp $"); #endif /* LIBC_SCCS and not lint */ #endif __FBSDID("$FreeBSD$"); From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 15:44:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE434786; Mon, 21 Jul 2014 15:44:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB32B23E0; Mon, 21 Jul 2014 15:44:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LFixDw093411; Mon, 21 Jul 2014 15:44:59 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LFixKa093406; Mon, 21 Jul 2014 15:44:59 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407211544.s6LFixKa093406@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 21 Jul 2014 15:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268945 - in head: lib/libc/stdlib 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.18 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, 21 Jul 2014 15:45:00 -0000 Author: pfg Date: Mon Jul 21 15:44:59 2014 New Revision: 268945 URL: http://svnweb.freebsd.org/changeset/base/268945 Log: Fix hdestroy() compliance issue. The hcreate(3) implementation and related functions we inherited from NetBSD used to free() the key value, something that is not supported by the standard implementation. This would cause a segmentation fault when attempting to run the examples from the opengroup and linux manpages. NetBSD has added non-standard calls to provide the previous behaviour but hdestroy is not very commonly used so at this time it seems excessive to bring those to FreeBSD. Bump the __FreeBSD_version as this is an ABI change. Reference: http://bugs.dragonflybsd.org/issues/1398 MFC after: 2 weeks Modified: head/lib/libc/stdlib/hcreate.c head/sys/sys/param.h Modified: head/lib/libc/stdlib/hcreate.c ============================================================================== --- head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 (r268944) +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:44:59 2014 (r268945) @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) while (!SLIST_EMPTY(&table[idx])) { ie = SLIST_FIRST(&table[idx]); SLIST_REMOVE_HEAD(&table[idx], link); - free(ie->ent.key); free(ie); } } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Jul 21 15:26:52 2014 (r268944) +++ head/sys/sys/param.h Mon Jul 21 15:44:59 2014 (r268945) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100027 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100028 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 16:38:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0C46A46; Mon, 21 Jul 2014 16:38:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 944312930; Mon, 21 Jul 2014 16:38:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LGc6bw016505; Mon, 21 Jul 2014 16:38:06 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LGc6Zn016503; Mon, 21 Jul 2014 16:38:06 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211638.s6LGc6Zn016503@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 16:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268947 - in head/sys/dev: drm2/i915 vt 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.18 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, 21 Jul 2014 16:38:06 -0000 Author: emaste Date: Mon Jul 21 16:38:05 2014 New Revision: 268947 URL: http://svnweb.freebsd.org/changeset/base/268947 Log: Hide syscons-specific workaround under DEV_SC This change is a bit ugly, but so is the coupling between the i915 driver and syscons. It isn't worth developing a more elegant solution only to support the legacy syscons console. Modified: head/sys/dev/drm2/i915/intel_fb.c head/sys/dev/vt/vt_core.c Modified: head/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- head/sys/dev/drm2/i915/intel_fb.c Mon Jul 21 16:21:17 2014 (r268946) +++ head/sys/dev/drm2/i915/intel_fb.c Mon Jul 21 16:38:05 2014 (r268947) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_syscons.h" #include #include #include @@ -216,7 +217,9 @@ static void intel_fbdev_destroy(struct d } } +#ifdef DEV_SC extern int sc_txtmouse_no_retrace_wait; +#endif int intel_fbdev_init(struct drm_device *dev) { @@ -240,7 +243,9 @@ int intel_fbdev_init(struct drm_device * drm_fb_helper_single_add_all_connectors(&ifbdev->helper); drm_fb_helper_initial_config(&ifbdev->helper, 32); +#ifdef DEV_SC sc_txtmouse_no_retrace_wait = 1; +#endif return 0; } Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Jul 21 16:21:17 2014 (r268946) +++ head/sys/dev/vt/vt_core.c Mon Jul 21 16:38:05 2014 (r268947) @@ -111,9 +111,6 @@ const struct terminal_class vt_termclass #define VT_UNIT(vw) ((vw)->vw_device->vd_unit * VT_MAXWINDOWS + \ (vw)->vw_number) -/* XXX while syscons is here. */ -int sc_txtmouse_no_retrace_wait; - static SYSCTL_NODE(_kern, OID_AUTO, vt, CTLFLAG_RD, 0, "vt(9) parameters"); VT_SYSCTL_INT(enable_altgr, 1, "Enable AltGr key (Do not assume R.Alt as Alt)"); VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 16:53:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF5A81FD; Mon, 21 Jul 2014 16:53:11 +0000 (UTC) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0042B91; Mon, 21 Jul 2014 16:53:11 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 52983225C4; Mon, 21 Jul 2014 12:42:57 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 21 Jul 2014 12:42:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= message-id:date:from:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=LDNj88XuCFsstpTo86XuhRuOmGw=; b=Yug1uWvsmNq0jW/U8X7T5JTpBsot JwKExLmiqtXCJ2NxEnkbXgOMIQibjggKiCo+nDQWe1i98KNikAWtiQRl9rH/H59I MD/yo2v8ha/yCEC668VcHoP4O2YuyW9jJz7kBToZ7KTuM+kNKPuUk3p/a+Ds4Uqs 1C89rykHIpD8sIw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:date:from:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=LDNj88XuCFsstpTo86XuhR uOmGw=; b=Q1veG5wUV6KruKSnvKMasFC+Mh4os6a9I7D4C5lfRLsF9qfcgjba3y rjaIyBVZWf7jqAHZTqfvw/Sr9szrQORanlanoeNGtySVuyptf/0tHdJTVVoOVHrU JgYmxttaElJ2YToTMJX7T+u68XKhOq+rZ4oxgx+qUOzXSQkcQEJ/E= X-Sasl-enc: hoy3SajW87lFjjlr7R/LFFqHZ6PtEJjV+wuj7uKd5ymL 1405960977 Received: from [192.168.1.66] (unknown [81.152.17.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 84AB7680177; Mon, 21 Jul 2014 12:42:56 -0400 (EDT) Message-ID: <53CD430F.5040604@fastmail.net> Date: Mon, 21 Jul 2014 17:42:55 +0100 From: Bruce Simpson User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib References: <201407211522.s6LFMnQo084633@svn.freebsd.org> In-Reply-To: <201407211522.s6LFMnQo084633@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 16:53:11 -0000 On 21/07/2014 16:22, Pedro F. Giffuni wrote: > ] > Log: > Add re-entrant versions of the hash functions based on the GNU api. > What, if anything, can be done about qsort_r() API incompatibility? From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 17:18:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4F22C67; Mon, 21 Jul 2014 17:18:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2A8B2E4E; Mon, 21 Jul 2014 17:18:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LHI0es035171; Mon, 21 Jul 2014 17:18:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LHI0FF035170; Mon, 21 Jul 2014 17:18:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211718.s6LHI0FF035170@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 17:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268948 - head/usr.bin/vtfontcvt 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.18 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, 21 Jul 2014 17:18:00 -0000 Author: emaste Date: Mon Jul 21 17:18:00 2014 New Revision: 268948 URL: http://svnweb.freebsd.org/changeset/base/268948 Log: Use the standard way of printing the usage string Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 16:38:05 2014 (r268947) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 17:18:00 2014 (r268948) @@ -91,7 +91,7 @@ static void usage(void) { - errx(1, + (void)fprintf(stderr, "usage: vtfontcvt [-w width] [-h height] [-v] normal.bdf [bold.bdf] out.fnt\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 17:43:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D613EE; Mon, 21 Jul 2014 17:43:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C997A20EF; Mon, 21 Jul 2014 17:43:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LHhbFj047590; Mon, 21 Jul 2014 17:43:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LHhbJd047589; Mon, 21 Jul 2014 17:43:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407211743.s6LHhbJd047589@svn.freebsd.org> From: Ed Maste Date: Mon, 21 Jul 2014 17:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268949 - head/usr.bin/vtfontcvt 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.18 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, 21 Jul 2014 17:43:38 -0000 Author: emaste Date: Mon Jul 21 17:43:37 2014 New Revision: 268949 URL: http://svnweb.freebsd.org/changeset/base/268949 Log: Remove redundant return statement after errx MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 17:18:00 2014 (r268948) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Mon Jul 21 17:43:37 2014 (r268949) @@ -111,10 +111,8 @@ add_mapping(struct glyph *gl, unsigned i ml = &maps[map_idx]; if (TAILQ_LAST(ml, mapping_list) != NULL && - TAILQ_LAST(ml, mapping_list)->m_char >= c) { + TAILQ_LAST(ml, mapping_list)->m_char >= c) errx(1, "Bad ordering at character %u\n", c); - return (1); - } TAILQ_INSERT_TAIL(ml, mp, m_list); map_count[map_idx]++; @@ -134,11 +132,9 @@ dedup_mapping(unsigned int map_idx) TAILQ_FOREACH_SAFE(mp_bold, &maps[map_idx], m_list, mp_temp) { while (mp_normal->m_char < mp_bold->m_char) mp_normal = TAILQ_NEXT(mp_normal, m_list); - if (mp_bold->m_char != mp_normal->m_char) { + if (mp_bold->m_char != mp_normal->m_char) errx(1, "Character %u not in normal font!\n", mp_bold->m_char); - return (1); - } if (mp_bold->m_glyph != mp_normal->m_glyph) continue; @@ -211,11 +207,8 @@ parse_bitmap_line(uint8_t *left, uint8_t uint8_t *p; unsigned int i, subline; - if (dwidth != width && dwidth != width * 2) { - errx(1, - "Bitmap with unsupported width %u!\n", dwidth); - return (1); - } + if (dwidth != width && dwidth != width * 2) + errx(1, "Bitmap with unsupported width %u!\n", dwidth); /* Move pixel data right to simplify splitting double characters. */ line >>= (howmany(dwidth, 8) * 8) - dwidth; @@ -232,9 +225,7 @@ parse_bitmap_line(uint8_t *left, uint8_t *p++ = subline >> 8; *p = subline; } else { - errx(1, - "Unsupported wbytes %u!\n", wbytes); - return (1); + errx(1, "Unsupported wbytes %u!\n", wbytes); } line >>= width; @@ -265,10 +256,8 @@ parse_bdf(FILE *fp, unsigned int map_idx if (strncmp(ln, "BITMAP", 6) == 0 && (ln[6] == ' ' || ln[6] == '\0')) { for (i = 0; i < height; i++) { - if ((ln = fgetln(fp, &length)) == NULL) { + if ((ln = fgetln(fp, &length)) == NULL) errx(1, "Unexpected EOF!\n"); - return (1); - } ln[length - 1] = '\0'; sscanf(ln, "%x", &line); if (parse_bitmap_line(bytes + i * wbytes, @@ -528,10 +517,8 @@ main(int argc, char *argv[]) switch (ch) { case 'h': val = atoi(optarg); - if (val <= 0 || val > 128) { + if (val <= 0 || val > 128) errx(1, "Invalid height %d", val); - return (1); - } height = val; break; case 'v': From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 17:48:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B59D770; Mon, 21 Jul 2014 17:48:38 +0000 (UTC) Received: from forward18.mail.yandex.net (forward18.mail.yandex.net [IPv6:2a02:6b8:0:1402::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Certum Level IV CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A79B213D; Mon, 21 Jul 2014 17:48:37 +0000 (UTC) Received: from web23g.yandex.ru (web23g.yandex.ru [95.108.253.232]) by forward18.mail.yandex.net (Yandex) with ESMTP id D467D1781B5E; Mon, 21 Jul 2014 21:48:32 +0400 (MSK) Received: from 127.0.0.1 (localhost [127.0.0.1]) by web23g.yandex.ru (Yandex) with ESMTP id 3C0443200153; Mon, 21 Jul 2014 21:48:32 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1405964912; bh=eNuiDgR3NBN0R5V5LWjkwwpfsE79R9s3lGG0KmmIvm0=; h=From:To:Cc:In-Reply-To:References:Subject:Date; b=SbgdtD8C4GGYk1bS2E1+D8VCW150eeQEvVsSkJn0oHM1wdOfVDb02iL0KuIIJ0Xht AMsAEqpV+4BE5geepxE7upi8g3J1u4lyjefwhgVmBDd+7CH3jlZ5Nj1qvAdayhM3Sw dfqOMoFwJIlv6+LDZ7b5gLTRRP1PuO1sz19HvFYk= Received: from m1cro.park.rambler.ru (m1cro.park.rambler.ru [81.19.64.111]) by web23g.yandex.ru with HTTP; Mon, 21 Jul 2014 21:48:31 +0400 From: Ilya A. Arkhipov Envelope-From: rum1cro@yandex.ru To: Nikolai Lifanov , Steven Hartland In-Reply-To: <1048c8cc25685b1216b0f1714c4494f1@mail.lifanov.com> References: <201407182041.s6IKffMR077972@svn.freebsd.org> <5d0810f5950150ef60044acf239adb4a@mail.lifanov.com> <09AF6051EC3848B6B691A5570B5B065E@multiplay.co.uk> <1048c8cc25685b1216b0f1714c4494f1@mail.lifanov.com> Subject: Re: svn commit: r268855 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys MIME-Version: 1.0 Message-Id: <9780681405964911@web23g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Mon, 21 Jul 2014 21:48:31 +0400 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r Cc: "svn-src-head@freebsd.org" , Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 17:48:38 -0000 21.07.2014, 07:50, "Nikolai Lifanov" : > On 2014-07-20 22:56, Steven Hartland wrote: >> š----- Original Message ----- From: "Nikolai Lifanov" >> š >> šTo: "Xin LI" >> šCc: ; >> šSent: Monday, July 21, 2014 2:22 AM >> šSubject: Re: svn commit: r268855 - in head: >> šcddl/contrib/opensolaris/cmd/ztest >> šsys/cddl/contrib/opensolaris/uts/common/fs/zfs >> šsys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys >>> šOn 2014-07-18 16:41, Xin LI wrote: >>>> šAuthor: delphij >>>> šDate: Fri Jul 18 20:41:40 2014 >>>> šNew Revision: 268855 >>>> šURL: http://svnweb.freebsd.org/changeset/base/268855 >>>> >>>> šLog: >>>> šššMFV r268848: >>>> >>>> šššInstead of asserting all zio's be properly aligned, only assert >>>> šššon the logical ones. >>>> >>>> šššCap uberblocks at 8k, otherwise with ashift=17, there would be >>>> šššonly one uberblock. >>>> >>>> šššThis fixes a problem that zdb would trip assert on pools with >>>> šššashift >= 0xe (8k). >>>> >>>> šššWhile there, also change the code so it only attempt to condense >>>> šššspace map unless the uncondensed size consumes greater than >>>> šššzfs_metaslab_condense_block_threshold blocks. >>>> >>>> šššIllumos issue: >>>> ššššš4958 zdb trips assert on pools with ashift >= 0xe >>>> >>>> šššMFC after: 2 weeks >>> šThis specific commit makes boot hang just before mounting the root >>> šdataset for me when vfs.zfs.vdev.cache.size tunable is set. Unsetting >>> šthis tunable or reverting this commit (currently running r268933 minus >>> šr268855) fixes the boot for me. >>> >>> šPlease let me know if I can provide any more information. >> šInteresting, is there a reason you enabled vdev caching as its been >> šdisabled by default for quite some time with the comment: >> >> š* TODO: Note that with the current ZFS code, it turns out that the >> š* vdev cache is not helpful, and in some cases actually harmful. šIt >> š* is better if we disable this. šOnce some time has passed, we should >> š* actually remove this to simplify the code. šFor now we just disable >> š* it by setting the zfs_vdev_cache_size to zero. šNote that Solaris 11 >> š* has made these same changes. >> >> ššššRegards >> ššššSteve >> >> š_______________________________________________ >> šsvn-src-head@freebsd.org mailing list >> šhttp://lists.freebsd.org/mailman/listinfo/svn-src-head >> šTo unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > > I noticed that it was disabled on default and I'm not seeing any ill > effect now that I have it disabled. I don't find vdev cache beneficial, > but I had it in my loader.conf for some time, and I had to remove it to > get the system to boot. If it's going to be broken going forward, > perhaps it's worthwhile to just remove the tunable? > > - Nikolai Lifanov > _______________________________________________ > svn-src-head@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Hi All, Looks like I got error related with this commit. Before loading kernel(after installworld) I get error with "zfs unsupported ..."(can't get full error message so fast have reboot) Trying upgrade r256311 to r268939(loading from pxe and rollback solve this problem ^_^). Some one have the same issue? -- With Best Regards, Ilya A. Arkhipov From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 18:51:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 644DFDA0 for ; Mon, 21 Jul 2014 18:51:53 +0000 (UTC) Received: from nm10-vm0.bullet.mail.bf1.yahoo.com (nm10-vm0.bullet.mail.bf1.yahoo.com [98.139.213.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 082402742 for ; Mon, 21 Jul 2014 18:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1405968705; bh=6j7+hH4FrebC3NUgXIIOOr8Ga1aAuCHu8AkYtALA/4Y=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=GoLKGo+0ILX0UFS2WcxXFH5sNPOPGo+T2L6v95Ba/BKHOO30BGamBpz2sgAlzhlH5vGsr5s8QS5wqsD9b0SWdP9tNn/DJl0cumClChrU+qu/0Fq7IyNNbaGjVberYOWC1KjZiVx8CsH81yg4XUwHPM/v7jqOgciszSZ3kYv7fxLTw9V55nTp2p3dwaiYSej0Whv6AgXqZB2n8VRKRmJNyQHl8OoPVjR4p5rlnzjTmxhArmEeIwyCp3/D0veJWRpnQng6HHKB/W0cpiNcgsn8q1Hzf9WvELjLnqEND5AQhbJpfZaxULWjHtpDgrYuG0IN1cEaxfAJ0ZPPu33ggIpwmw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=PZkqtwNxNJJZPivfOhFa7ntqaTJu9/dLKXnvRl7OWpAls+9/EQ+C7uKCfakG7r1NLzVU5nQQrMhL48LVebptveDTWrTtGMQIwXG+4bK1+FrzOYdE5Be7cvytq8zXDYRcusKCm4LViauAYAoED9OUwEQE2WNjF8eJ4pY4SvvvG6zj8M+KwAH3DHh8d3+y6vIcuALTbW1LpYAVzIGeJE3Y+yvOutqWq5MgsUFwso5boBjAHIhbecCzqa410JIJfLsf2Rjk62hEDIGnBF0H/AmiDEbEKrnxhIWMIxqCGLY6+RgCeo5iD1hET4S6UXrd6U3/URfh+ozPUMniPRC3UnPhag==; Received: from [98.139.212.150] by nm10.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jul 2014 18:51:45 -0000 Received: from [68.142.230.65] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jul 2014 18:51:45 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 21 Jul 2014 18:51:45 -0000 X-Yahoo-Newman-Id: 206266.59062.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: ZdDJlBsVM1mulk3aC85cyuuPKX_DnbHeAYZCPFS5HTGvzJP j8FHxB811reSzD_1IrfVmBmzYysluQm.VWQgtfgJR6_55bRbbuX5o9TqRyFb 5jKHX95uEwJCEq64pwpTFY1GIBHyTlT6cw1cacXULmDHw4_YoLxkpNApzZni hnpLtgHNHVXbE.zjxDBQkrM3AHgl3ffzfUuC85C7OtYuejsFzHq1C3Ft5zwV mCEs04PjYvjLieztN0ypsVjAQqETsFGU6IZ5uAqpLD09l35_CTlsFtm9dln5 MqtdGPZYnZl.rRMcUJUsf5I_OBqWzRN2gwBsLze94NC1eilxE0pYtrXmkqUg NcdE7KwvmHiyHaZlzZ2MXdIwpQq92SaHBfEr3_Oewht4hXG87.zIqcAvPc.f E7rxu8og0nV4S4hPEYwUxc6wFNeRq9aDh1HtzCQzCua7ImFoBSu61smjAGQI T4lzooTf5wMlzxSl_wGe7ZosAtWwvku2QKsXSiULN0PGUPS.vnm_8yrfYK6B ud54e40RPtMz_enDX5mKBCDCqhRwLPk3_m04- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268943 - in head: include lib/libc/stdlib From: Pedro Giffuni In-Reply-To: <53CD430F.5040604@fastmail.net> Date: Mon, 21 Jul 2014 13:51:18 -0500 Message-Id: <68E8EDB9-64DE-4037-9047-C8BEAD86801A@freebsd.org> References: <201407211522.s6LFMnQo084633@svn.freebsd.org> <53CD430F.5040604@fastmail.net> To: Bruce Simpson X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 21 Jul 2014 18:51:53 -0000 Il giorno 21/lug/2014, alle ore 11:42, Bruce Simpson = ha scritto: > On 21/07/2014 16:22, Pedro F. Giffuni wrote: >> ] >> Log: >> Add re-entrant versions of the hash functions based on the GNU api. >> =20 > What, if anything, can be done about qsort_r() API incompatibility? qsort_r is non-standard and we did it first, plus we will want to stay = compatible with Apple :). I guess we could do some ugly parameter swapping in the case where = _GNU_SOURCE is defined, but I won=92t volunteer to do that. Pedro.= From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 19:33:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2832EB82; Mon, 21 Jul 2014 19:33:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 094F82B2D; Mon, 21 Jul 2014 19:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LJX8jE099219; Mon, 21 Jul 2014 19:33:08 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LJX8l8099215; Mon, 21 Jul 2014 19:33:08 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407211933.s6LJX8l8099215@svn.freebsd.org> From: Sean Bruno Date: Mon, 21 Jul 2014 19:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268954 - head/sys/dev/drm2/radeon 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.18 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, 21 Jul 2014 19:33:09 -0000 Author: sbruno Date: Mon Jul 21 19:33:08 2014 New Revision: 268954 URL: http://svnweb.freebsd.org/changeset/base/268954 Log: Merge change from upstream linux kernel submitted by OpenBSD: drm/radeon: fix-up some float to fixed conversion thinkos Spotted by Brad Smith when porting to OpenBSD. Noticed-by: Brad Smith Signed-off-by: Alex Deucher ref: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1cd73ff7 Remove #ifdef DUMBBELL_WIP in favor of upstream fix. Phabric: https://phabric.freebsd.org/D423 Reviewed by: dumbbell, jkim MFC after: 2 weeks Modified: head/sys/dev/drm2/radeon/rs690.c head/sys/dev/drm2/radeon/rv515.c Modified: head/sys/dev/drm2/radeon/rs690.c ============================================================================== --- head/sys/dev/drm2/radeon/rs690.c Mon Jul 21 19:08:02 2014 (r268953) +++ head/sys/dev/drm2/radeon/rs690.c Mon Jul 21 19:33:08 2014 (r268954) @@ -308,12 +308,11 @@ static void rs690_crtc_bandwidth_compute if (rdev->pm.max_bandwidth.full > rdev->pm.sideport_bandwidth.full && rdev->pm.sideport_bandwidth.full) rdev->pm.max_bandwidth = rdev->pm.sideport_bandwidth; -#ifdef DUMBBELL_WIP - read_delay_latency.full = dfixed_const(370 * 800 * 1000); -#endif /* DUMBBELL_WIP */ - read_delay_latency.full = UINT_MAX; - read_delay_latency.full = dfixed_div(read_delay_latency, - rdev->pm.igp_sideport_mclk); + read_delay_latency.full = dfixed_const(370 * 800); + a.full = dfixed_const(1000); + b.full = dfixed_div(rdev->pm.igp_sideport_mclk, a); + read_delay_latency.full = dfixed_div(read_delay_latency, b); + read_delay_latency.full = dfixed_mul(read_delay_latency, a); } else { if (rdev->pm.max_bandwidth.full > rdev->pm.k8_bandwidth.full && rdev->pm.k8_bandwidth.full) @@ -488,14 +487,10 @@ void rs690_bandwidth_update(struct radeo } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -526,8 +521,6 @@ void rs690_bandwidth_update(struct radeo } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -555,8 +548,6 @@ void rs690_bandwidth_update(struct radeo } if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d2mode_priority_a_cnt = dfixed_trunc(priority_mark12); Modified: head/sys/dev/drm2/radeon/rv515.c ============================================================================== --- head/sys/dev/drm2/radeon/rv515.c Mon Jul 21 19:08:02 2014 (r268953) +++ head/sys/dev/drm2/radeon/rv515.c Mon Jul 21 19:33:08 2014 (r268954) @@ -1087,14 +1087,10 @@ void rv515_bandwidth_avivo_update(struct } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -1125,8 +1121,6 @@ void rv515_bandwidth_avivo_update(struct } if (wm0.priority_mark.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark.full; - if (dfixed_trunc(priority_mark02) < 0) - priority_mark02.full = 0; if (wm0.priority_mark_max.full > priority_mark02.full) priority_mark02.full = wm0.priority_mark_max.full; d1mode_priority_a_cnt = dfixed_trunc(priority_mark02); @@ -1154,8 +1148,6 @@ void rv515_bandwidth_avivo_update(struct } if (wm1.priority_mark.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark.full; - if (dfixed_trunc(priority_mark12) < 0) - priority_mark12.full = 0; if (wm1.priority_mark_max.full > priority_mark12.full) priority_mark12.full = wm1.priority_mark_max.full; d2mode_priority_a_cnt = dfixed_trunc(priority_mark12); From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 21:26:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0250FED; Mon, 21 Jul 2014 21:26:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E04225F3; Mon, 21 Jul 2014 21:26:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LLQAam053224; Mon, 21 Jul 2014 21:26:10 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LLQALu053223; Mon, 21 Jul 2014 21:26:10 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201407212126.s6LLQALu053223@svn.freebsd.org> From: Dimitry Andric Date: Mon, 21 Jul 2014 21:26:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268957 - 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.18 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, 21 Jul 2014 21:26:10 -0000 Author: dim Date: Mon Jul 21 21:26:10 2014 New Revision: 268957 URL: http://svnweb.freebsd.org/changeset/base/268957 Log: Run mtree for BSD.tests.dist during make xdev-install, if the tests are enabled (which they are in the default configuration). Otherwise, it will fail because ${XDDESTDIR}/usr/include/atf-c does not exist. MFC after: 3 days Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Jul 21 20:38:21 2014 (r268956) +++ head/Makefile.inc1 Mon Jul 21 21:26:10 2014 (r268957) @@ -1942,6 +1942,10 @@ _xi-mtree: -p ${XDDESTDIR}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${XDDESTDIR}/usr/include >/dev/null +.if ${MK_TESTS} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ + -p ${XDDESTDIR}/usr >/dev/null +.endif .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries From owner-svn-src-head@FreeBSD.ORG Mon Jul 21 22:10:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B942D78A; Mon, 21 Jul 2014 22:10:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A65E129FD; Mon, 21 Jul 2014 22:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6LMAUst074627; Mon, 21 Jul 2014 22:10:30 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6LMAToP074623; Mon, 21 Jul 2014 22:10:29 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407212210.s6LMAToP074623@svn.freebsd.org> From: Peter Wemm Date: Mon, 21 Jul 2014 22:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268960 - in head/contrib/serf: . auth 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.18 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, 21 Jul 2014 22:10:30 -0000 Author: peter Date: Mon Jul 21 22:10:29 2014 New Revision: 268960 URL: http://svnweb.freebsd.org/changeset/base/268960 Log: Merge serf-1.3.6 + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. Modified: head/contrib/serf/CHANGES head/contrib/serf/auth/auth.c head/contrib/serf/outgoing.c head/contrib/serf/serf.h Directory Properties: head/contrib/serf/ (props changed) Modified: head/contrib/serf/CHANGES ============================================================================== --- head/contrib/serf/CHANGES Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/CHANGES Mon Jul 21 22:10:29 2014 (r268960) @@ -1,3 +1,7 @@ +Serf 1.3.6 [2014-06-09, from /tags/1.3.6, rxxxx] + Revert r2319 from serf 1.3.5: this change was making serf call handle_response + multiple times in case of an error response, leading to unexpected behavior. + Serf 1.3.5 [2014-04-27, from /tags/1.3.5, rxxxx] Fix issue #125: no reverse lookup during Negotiate authentication for proxies. Fix a crash caused by incorrect reuse of the ssltunnel CONNECT request (r2316) Modified: head/contrib/serf/auth/auth.c ============================================================================== --- head/contrib/serf/auth/auth.c Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/auth/auth.c Mon Jul 21 22:10:29 2014 (r268960) @@ -408,7 +408,6 @@ apr_status_t serf__handle_auth_response( consider the reponse body as invalid and discard it. */ status = discard_body(response); *consumed_response = 1; - if (!APR_STATUS_IS_EOF(status)) { return status; } Modified: head/contrib/serf/outgoing.c ============================================================================== --- head/contrib/serf/outgoing.c Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/outgoing.c Mon Jul 21 22:10:29 2014 (r268960) @@ -916,22 +916,21 @@ static apr_status_t handle_response(serf * themselves by not registering credential callbacks. */ if (request->conn->ctx->cred_cb) { - status = serf__handle_auth_response(&consumed_response, - request, - request->resp_bkt, - request->handler_baton, - pool); - - if (SERF_BUCKET_READ_ERROR(status)) { - /* Report the request as 'died'/'cancelled' to the application */ - (void)(*request->handler)(request, - NULL, - request->handler_baton, - pool); - } - - if (status) - return status; + status = serf__handle_auth_response(&consumed_response, + request, + request->resp_bkt, + request->handler_baton, + pool); + + /* If there was an error reading the response (maybe there wasn't + enough data available), don't bother passing the response to the + application. + + If the authentication was tried, but failed, pass the response + to the application, maybe it can do better. */ + if (status) { + return status; + } } if (!consumed_response) { Modified: head/contrib/serf/serf.h ============================================================================== --- head/contrib/serf/serf.h Mon Jul 21 22:09:16 2014 (r268959) +++ head/contrib/serf/serf.h Mon Jul 21 22:10:29 2014 (r268960) @@ -1062,7 +1062,7 @@ void serf_debug__bucket_alloc_check( /* Version info */ #define SERF_MAJOR_VERSION 1 #define SERF_MINOR_VERSION 3 -#define SERF_PATCH_VERSION 5 +#define SERF_PATCH_VERSION 6 /* Version number string */ #define SERF_VERSION_STRING APR_STRINGIFY(SERF_MAJOR_VERSION) "." \ From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 00:42:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11C491B1; Tue, 22 Jul 2014 00:42:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9538262B; Tue, 22 Jul 2014 00:42:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M0gtca044644; Tue, 22 Jul 2014 00:42:55 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M0gtmC044642; Tue, 22 Jul 2014 00:42:55 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201407220042.s6M0gtmC044642@svn.freebsd.org> From: "Simon J. Gerraty" Date: Tue, 22 Jul 2014 00:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268970 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 00:42:56 -0000 Author: sjg Date: Tue Jul 22 00:42:55 2014 New Revision: 268970 URL: http://svnweb.freebsd.org/changeset/base/268970 Log: bsd.lib.mk does not add OBJS etc to CLEANFILES so does not automatically get them flagged as .NOPATH. This hurts people who don't use obj dirs. Since its clean target seprate rm's for things, use NOPATH_FILES as list to collect things that need .NOPATH. bsd.obj.mk will add CLEANFILES to NOPATH_FILES and do the deed if needed. Reviewed by: sbruno Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.obj.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Jul 22 00:33:41 2014 (r268969) +++ head/share/mk/bsd.lib.mk Tue Jul 22 00:42:55 2014 (r268970) @@ -160,6 +160,7 @@ LDFLAGS+= -L${_SHLIBDIRPREFIX}${LIBPRIVA .if defined(LIB) && !empty(LIB) || defined(SHLIB_NAME) OBJS+= ${SRCS:N*.h:R:S/$/.o/} +NOPATH_FILES+= ${OBJS} .endif .if defined(LIB) && !empty(LIB) @@ -181,6 +182,7 @@ lib${LIB}.a: ${OBJS} ${STATICOBJS} .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) _LIBS+= lib${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} +NOPATH_FILES+= ${POBJS} lib${LIB}_p.a: ${POBJS} @${ECHO} building profiled ${LIB} library @@ -196,6 +198,7 @@ lib${LIB}_p.a: ${POBJS} .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) SOBJS+= ${OBJS:.o=.So} +NOPATH_FILES+= ${SOBJS} .endif .if defined(SHLIB_NAME) @@ -254,6 +257,7 @@ lib${LIB}_pic.a: ${SOBJS} LINTLIB= llib-l${LIB}.ln _LIBS+= ${LINTLIB} LINTOBJS+= ${SRCS:M*.c:.c=.ln} +NOPATH_FILES+= ${LINTOBJS} ${LINTLIB}: ${LINTOBJS} @${ECHO} building lint library ${.TARGET} @@ -454,6 +458,10 @@ clean: .endif .endif +.if !empty(_LIBS) +NOPATH_FILES+= ${_LIBS} +.endif + .include .include Modified: head/share/mk/bsd.obj.mk ============================================================================== --- head/share/mk/bsd.obj.mk Tue Jul 22 00:33:41 2014 (r268969) +++ head/share/mk/bsd.obj.mk Tue Jul 22 00:42:55 2014 (r268970) @@ -119,8 +119,9 @@ cleanobj: clean cleandepend @if [ -L ${.CURDIR}/obj ]; then rm -f ${.CURDIR}/obj; fi # Tell bmake not to look for generated files via .PATH -.if !empty(CLEANFILES) -.NOPATH: ${CLEANFILES} +NOPATH_FILES+= ${CLEANFILES} +.if !empty(NOPATH_FILES) +.NOPATH: ${NOPATH_FILES} .endif .if !target(clean) From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 02:02:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64715B65; Tue, 22 Jul 2014 02:02:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 451C02BF1; Tue, 22 Jul 2014 02:02:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M22eto080225; Tue, 22 Jul 2014 02:02:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M22d34080222; Tue, 22 Jul 2014 02:02:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407220202.s6M22d34080222@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 22 Jul 2014 02:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268971 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 02:02:40 -0000 Author: np Date: Tue Jul 22 02:02:39 2014 New Revision: 268971 URL: http://svnweb.freebsd.org/changeset/base/268971 Log: Simplify r267600, there's no need to distinguish between allocated and inlined mbufs. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Jul 22 00:42:55 2014 (r268970) +++ head/sys/dev/cxgbe/adapter.h Tue Jul 22 02:02:39 2014 (r268971) @@ -290,8 +290,7 @@ struct cluster_metadata { struct fl_sdesc { caddr_t cl; - uint8_t nimbuf; /* # of inline mbufs with ref on the cluster */ - uint8_t nembuf; /* # of allocated mbufs with ref */ + uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */ struct cluster_layout cll; }; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 00:42:55 2014 (r268970) +++ head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 02:02:39 2014 (r268971) @@ -1559,7 +1559,7 @@ get_scatter_segment(struct adapter *sc, /* copy data to mbuf */ bcopy(payload, mtod(m, caddr_t), len); - } else if (sd->nimbuf * MSIZE < cll->region1) { + } else if (sd->nmbuf * MSIZE < cll->region1) { /* * There's spare room in the cluster for an mbuf. Create one @@ -1567,14 +1567,14 @@ get_scatter_segment(struct adapter *sc, */ MPASS(clm != NULL); - m = (struct mbuf *)(sd->cl + sd->nimbuf * MSIZE); + m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); /* No bzero required */ if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE)) return (NULL); fl->mbuf_inlined++; m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nimbuf++; + sd->nmbuf++; } else { @@ -1591,7 +1591,7 @@ get_scatter_segment(struct adapter *sc, if (clm != NULL) { m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nembuf++; + sd->nmbuf++; } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ @@ -3253,7 +3253,7 @@ refill_fl(struct adapter *sc, struct sge if (sd->cl != NULL) { - if (sd->nimbuf + sd->nembuf == 0) { + if (sd->nmbuf == 0) { /* * Fast recycle without involving any atomics on * the cluster's metadata (if the cluster has @@ -3312,8 +3312,7 @@ recycled: #endif clm->refcount = 1; } - sd->nimbuf = 0; - sd->nembuf = 0; + sd->nmbuf = 0; recycled_fast: fl->pending++; fl->needed--; @@ -3382,7 +3381,7 @@ free_fl_sdesc(struct adapter *sc, struct cll = &sd->cll; clm = cl_metadata(sc, fl, cll, sd->cl); - if (sd->nimbuf + sd->nembuf == 0 || + if (sd->nmbuf == 0 || (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) { uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); } From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 03:59:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EA10959; Tue, 22 Jul 2014 03:59:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19EF9252E; Tue, 22 Jul 2014 03:59:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M3xGX3029742; Tue, 22 Jul 2014 03:59:16 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M3xFB9029733; Tue, 22 Jul 2014 03:59:15 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407220359.s6M3xFB9029733@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 22 Jul 2014 03:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268973 - in head/sys/arm/freescale: imx vybrid 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.18 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, 22 Jul 2014 03:59:16 -0000 Author: br Date: Tue Jul 22 03:59:14 2014 New Revision: 268973 URL: http://svnweb.freebsd.org/changeset/base/268973 Log: Rename i.MX I2C driver file. Added: head/sys/arm/freescale/imx/imx_i2c.c - copied unchanged from r268972, head/sys/arm/freescale/imx/i2c.c Deleted: head/sys/arm/freescale/imx/i2c.c Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/vybrid/vf_i2c.c Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/imx/files.imx51 Tue Jul 22 03:59:14 2014 (r268973) @@ -44,7 +44,7 @@ dev/usb/controller/ehci_imx.c optional arm/freescale/imx/imx_wdog.c optional imxwdt # i2c -arm/freescale/imx/i2c.c optional fsliic +arm/freescale/imx/imx_i2c.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/imx/files.imx53 Tue Jul 22 03:59:14 2014 (r268973) @@ -47,7 +47,7 @@ dev/usb/controller/ehci_imx.c optional arm/freescale/imx/imx_wdog.c optional imxwdt # i2c -arm/freescale/imx/i2c.c optional fsliic +arm/freescale/imx/imx_i2c.c optional fsliic # IPU - Image Processing Unit (frame buffer also) arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 03:59:14 2014 (r268973) @@ -52,5 +52,5 @@ arm/freescale/imx/imx6_usbphy.c optiona # #arm/freescale/imx/imx51_iomux.c optional iomux #dev/ata/chipsets/ata-fsl.c optional imxata -#arm/freescale/imx/i2c.c optional fsliic +#arm/freescale/imx/imx_i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Copied: head/sys/arm/freescale/imx/imx_i2c.c (from r268972, head/sys/arm/freescale/imx/i2c.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 03:59:14 2014 (r268973, copy of r268972, head/sys/arm/freescale/imx/i2c.c) @@ -0,0 +1,495 @@ +/*- + * Copyright (C) 2008-2009 Semihalf, Michal Hajduk + * Copyright (c) 2012, 2013 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Oleksandr Rybalko + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include "iicbus_if.h" + +#include +#include +#include +#include + +#define I2C_ADDR_REG 0x00 /* I2C slave address register */ +#define I2C_FDR_REG 0x04 /* I2C frequency divider register */ +#define I2C_CONTROL_REG 0x08 /* I2C control register */ +#define I2C_STATUS_REG 0x0C /* I2C status register */ +#define I2C_DATA_REG 0x10 /* I2C data register */ +#define I2C_DFSRR_REG 0x14 /* I2C Digital Filter Sampling rate */ + +#define I2CCR_MEN (1 << 7) /* Module enable */ +#define I2CCR_MSTA (1 << 5) /* Master/slave mode */ +#define I2CCR_MTX (1 << 4) /* Transmit/receive mode */ +#define I2CCR_TXAK (1 << 3) /* Transfer acknowledge */ +#define I2CCR_RSTA (1 << 2) /* Repeated START */ + +#define I2CSR_MCF (1 << 7) /* Data transfer */ +#define I2CSR_MASS (1 << 6) /* Addressed as a slave */ +#define I2CSR_MBB (1 << 5) /* Bus busy */ +#define I2CSR_MAL (1 << 4) /* Arbitration lost */ +#define I2CSR_SRW (1 << 2) /* Slave read/write */ +#define I2CSR_MIF (1 << 1) /* Module interrupt */ +#define I2CSR_RXAK (1 << 0) /* Received acknowledge */ + +#define I2C_BAUD_RATE_FAST 0x31 +#define I2C_BAUD_RATE_DEF 0x3F +#define I2C_DFSSR_DIV 0x10 + +#ifdef DEBUG +#define debugf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define debugf(fmt, args...) +#endif + +struct i2c_softc { + device_t dev; + device_t iicbus; + struct resource *res; + struct mtx mutex; + int rid; + bus_space_handle_t bsh; + bus_space_tag_t bst; +}; + +static phandle_t i2c_get_node(device_t, device_t); +static int i2c_probe(device_t); +static int i2c_attach(device_t); + +static int i2c_repeated_start(device_t, u_char, int); +static int i2c_start(device_t, u_char, int); +static int i2c_stop(device_t); +static int i2c_reset(device_t, u_char, u_char, u_char *); +static int i2c_read(device_t, char *, int, int *, int, int); +static int i2c_write(device_t, const char *, int, int *, int); + +static device_method_t i2c_methods[] = { + DEVMETHOD(device_probe, i2c_probe), + DEVMETHOD(device_attach, i2c_attach), + + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, i2c_get_node), + + DEVMETHOD(iicbus_callback, iicbus_null_callback), + DEVMETHOD(iicbus_repeated_start, i2c_repeated_start), + DEVMETHOD(iicbus_start, i2c_start), + DEVMETHOD(iicbus_stop, i2c_stop), + DEVMETHOD(iicbus_reset, i2c_reset), + DEVMETHOD(iicbus_read, i2c_read), + DEVMETHOD(iicbus_write, i2c_write), + DEVMETHOD(iicbus_transfer, iicbus_transfer_gen), + + { 0, 0 } +}; + +static driver_t i2c_driver = { + "iichb", + i2c_methods, + sizeof(struct i2c_softc), +}; +static devclass_t i2c_devclass; + +DRIVER_MODULE(i2c, simplebus, i2c_driver, i2c_devclass, 0, 0); +DRIVER_MODULE(iicbus, i2c, iicbus_driver, iicbus_devclass, 0, 0); + +static phandle_t +i2c_get_node(device_t bus, device_t dev) +{ + /* + * Share controller node with iicbus device + */ + return ofw_bus_get_node(bus); +} + +static __inline void +i2c_write_reg(struct i2c_softc *sc, bus_size_t off, uint8_t val) +{ + + bus_space_write_1(sc->bst, sc->bsh, off, val); +} + +static __inline uint8_t +i2c_read_reg(struct i2c_softc *sc, bus_size_t off) +{ + + return (bus_space_read_1(sc->bst, sc->bsh, off)); +} + +static __inline void +i2c_flag_set(struct i2c_softc *sc, bus_size_t off, uint8_t mask) +{ + uint8_t status; + + status = i2c_read_reg(sc, off); + status |= mask; + i2c_write_reg(sc, off, status); +} + +/* Wait for transfer interrupt flag */ +static int +wait_for_iif(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if (i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MIF) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +/* Wait for free bus */ +static int +wait_for_nibb(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + if ((i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MBB) == 0) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +/* Wait for transfer complete+interrupt flag */ +static int +wait_for_icf(struct i2c_softc *sc) +{ + int retry; + + retry = 1000; + while (retry --) { + + if ((i2c_read_reg(sc, I2C_STATUS_REG) & + (I2CSR_MCF|I2CSR_MIF)) == (I2CSR_MCF|I2CSR_MIF)) + return (IIC_NOERR); + DELAY(10); + } + + return (IIC_ETIMEOUT); +} + +static int +i2c_probe(device_t dev) +{ + struct i2c_softc *sc; + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) + return (ENXIO); + + sc = device_get_softc(dev); + sc->rid = 0; + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + /* Enable I2C */ + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); + bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); + device_set_desc(dev, "I2C bus controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +i2c_attach(device_t dev) +{ + struct i2c_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->rid = 0; + + mtx_init(&sc->mutex, device_get_nameunit(dev), "I2C", MTX_DEF); + + sc->res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->rid, + RF_ACTIVE); + if (sc->res == NULL) { + device_printf(dev, "could not allocate resources"); + mtx_destroy(&sc->mutex); + return (ENXIO); + } + + sc->bst = rman_get_bustag(sc->res); + sc->bsh = rman_get_bushandle(sc->res); + + sc->iicbus = device_add_child(dev, "iicbus", -1); + if (sc->iicbus == NULL) { + device_printf(dev, "could not add iicbus child"); + mtx_destroy(&sc->mutex); + return (ENXIO); + } + + bus_generic_attach(dev); + return (IIC_NOERR); +} + +static int +i2c_repeated_start(device_t dev, u_char slave, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + + i2c_write_reg(sc, I2C_ADDR_REG, slave); + if ((i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MBB) == 0) { + mtx_unlock(&sc->mutex); + return (IIC_EBUSBSY); + } + + /* Set repeated start condition */ + DELAY(10); + i2c_flag_set(sc, I2C_CONTROL_REG, I2CCR_RSTA); + DELAY(10); + /* Clear status */ + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + /* Write target address - LSB is R/W bit */ + i2c_write_reg(sc, I2C_DATA_REG, slave); + + error = wait_for_iif(sc); + + /* Clear status */ + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + + mtx_unlock(&sc->mutex); + + if (error) + return (error); + + return (IIC_NOERR); +} + +static int +i2c_start(device_t dev, u_char slave, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + + mtx_lock(&sc->mutex); + i2c_write_reg(sc, I2C_ADDR_REG, slave); + if (i2c_read_reg(sc, I2C_STATUS_REG) & I2CSR_MBB) { + mtx_unlock(&sc->mutex); + return (IIC_EBUSBSY); + } + + /* Set start condition */ + i2c_write_reg(sc, I2C_CONTROL_REG, + I2CCR_MEN | I2CCR_MSTA | I2CCR_TXAK); + DELAY(100); + i2c_write_reg(sc, I2C_CONTROL_REG, + I2CCR_MEN | I2CCR_MSTA | I2CCR_MTX | I2CCR_TXAK); + /* Clear status */ + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + /* Write target address - LSB is R/W bit */ + i2c_write_reg(sc, I2C_DATA_REG, slave); + + error = wait_for_iif(sc); + + mtx_unlock(&sc->mutex); + if (error) + return (error); + + return (IIC_NOERR); +} + + +static int +i2c_stop(device_t dev) +{ + struct i2c_softc *sc; + + sc = device_get_softc(dev); + mtx_lock(&sc->mutex); + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | I2CCR_TXAK); + DELAY(100); + /* Reset controller if bus still busy after STOP */ + if (wait_for_nibb(sc) == IIC_ETIMEOUT) { + i2c_write_reg(sc, I2C_CONTROL_REG, 0); + DELAY(1000); + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | I2CCR_TXAK); + + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_reset(device_t dev, u_char speed, u_char addr, u_char *oldadr) +{ + struct i2c_softc *sc; + uint8_t baud_rate; + + sc = device_get_softc(dev); + + switch (speed) { + case IIC_FAST: + baud_rate = I2C_BAUD_RATE_FAST; + break; + case IIC_SLOW: + case IIC_UNKNOWN: + case IIC_FASTEST: + default: + baud_rate = I2C_BAUD_RATE_DEF; + break; + } + + mtx_lock(&sc->mutex); + i2c_write_reg(sc, I2C_CONTROL_REG, 0x0); + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + DELAY(1000); + + i2c_write_reg(sc, I2C_FDR_REG, 20); + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); + DELAY(1000); + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_read(device_t dev, char *buf, int len, int *read, int last, int delay) +{ + struct i2c_softc *sc; + int error, reg; + + sc = device_get_softc(dev); + *read = 0; + + mtx_lock(&sc->mutex); + + if (len) { + if (len == 1) + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_MSTA | I2CCR_TXAK); + + else + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_MSTA); + + /* dummy read */ + i2c_read_reg(sc, I2C_DATA_REG); + DELAY(1000); + } + + while (*read < len) { + error = wait_for_icf(sc); + if (error) { + mtx_unlock(&sc->mutex); + return (error); + } + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + if ((*read == len - 2) && last) { + /* NO ACK on last byte */ + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_MSTA | I2CCR_TXAK); + } + + if ((*read == len - 1) && last) { + /* Transfer done, remove master bit */ + i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN | + I2CCR_TXAK); + } + + reg = i2c_read_reg(sc, I2C_DATA_REG); + *buf++ = reg; + (*read)++; + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} + +static int +i2c_write(device_t dev, const char *buf, int len, int *sent, int timeout) +{ + struct i2c_softc *sc; + int error; + + sc = device_get_softc(dev); + *sent = 0; + + mtx_lock(&sc->mutex); + while (*sent < len) { + i2c_write_reg(sc, I2C_STATUS_REG, 0x0); + i2c_write_reg(sc, I2C_DATA_REG, *buf++); + + error = wait_for_iif(sc); + if (error) { + mtx_unlock(&sc->mutex); + return (error); + } + + (*sent)++; + } + mtx_unlock(&sc->mutex); + + return (IIC_NOERR); +} Modified: head/sys/arm/freescale/vybrid/vf_i2c.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_i2c.c Tue Jul 22 03:14:37 2014 (r268972) +++ head/sys/arm/freescale/vybrid/vf_i2c.c Tue Jul 22 03:59:14 2014 (r268973) @@ -30,7 +30,7 @@ */ /* - * This driver is based on the I2C driver for IMX (imx/i2c.c). + * This driver is based on the I2C driver for i.MX */ #include From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 04:37:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 42E0EED6; Tue, 22 Jul 2014 04:37:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC1D282E; Tue, 22 Jul 2014 04:37:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4bmXd047650; Tue, 22 Jul 2014 04:37:48 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4blHu047648; Tue, 22 Jul 2014 04:37:47 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407220437.s6M4blHu047648@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 Jul 2014 04:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268974 - in head/sys/boot: efi/libefi 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.18 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, 22 Jul 2014 04:37:48 -0000 Author: sbruno Date: Tue Jul 22 04:37:47 2014 New Revision: 268974 URL: http://svnweb.freebsd.org/changeset/base/268974 Log: Supress clang warning for FreeBSD printf %b and %D formats MFC after: 2 weeks Modified: head/sys/boot/efi/libefi/Makefile head/sys/boot/i386/libi386/Makefile Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Jul 22 03:59:14 2014 (r268973) +++ head/sys/boot/efi/libefi/Makefile Tue Jul 22 04:37:47 2014 (r268974) @@ -16,4 +16,8 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/li # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common + +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .include Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Jul 22 03:59:14 2014 (r268973) +++ head/sys/boot/i386/libi386/Makefile Tue Jul 22 04:37:47 2014 (r268974) @@ -55,6 +55,9 @@ CFLAGS+= -I${.CURDIR}/../../common -I${. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +# Suppress warning from clang for FreeBSD %b and %D formats +CFLAGS+= -fformat-extensions + .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 04:38:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C1FFAF; Tue, 22 Jul 2014 04:38:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED5772838; Tue, 22 Jul 2014 04:38:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4cSxk047783; Tue, 22 Jul 2014 04:38:28 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4cSSr047782; Tue, 22 Jul 2014 04:38:28 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407220438.s6M4cSSr047782@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 Jul 2014 04:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268975 - head/sys/boot/amd64/boot1.efi 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.18 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, 22 Jul 2014 04:38:29 -0000 Author: sbruno Date: Tue Jul 22 04:38:28 2014 New Revision: 268975 URL: http://svnweb.freebsd.org/changeset/base/268975 Log: Remove boot1.efi during clean target. Modified: head/sys/boot/amd64/boot1.efi/Makefile Modified: head/sys/boot/amd64/boot1.efi/Makefile ============================================================================== --- head/sys/boot/amd64/boot1.efi/Makefile Tue Jul 22 04:37:47 2014 (r268974) +++ head/sys/boot/amd64/boot1.efi/Makefile Tue Jul 22 04:38:28 2014 (r268975) @@ -77,7 +77,7 @@ CLEANFILES= boot1.efifat beforedepend ${OBJS}: machine x86 -CLEANFILES+= machine x86 +CLEANFILES+= machine x86 boot1.efi machine: ln -sf ${.CURDIR}/../../../amd64/include machine From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 04:39:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22B5E32E; Tue, 22 Jul 2014 04:39:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F58D2849; Tue, 22 Jul 2014 04:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4dXIl048000; Tue, 22 Jul 2014 04:39:33 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4dXdb047994; Tue, 22 Jul 2014 04:39:33 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407220439.s6M4dXdb047994@svn.freebsd.org> From: Ruslan Bukin Date: Tue, 22 Jul 2014 04:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268977 - in head/sys: arm/conf arm/freescale/imx 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.18 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, 22 Jul 2014 04:39:34 -0000 Author: br Date: Tue Jul 22 04:39:32 2014 New Revision: 268977 URL: http://svnweb.freebsd.org/changeset/base/268977 Log: Enable Freescale i.MX I2C driver for i.MX6. Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx_i2c.c head/sys/boot/fdt/dts/arm/imx6.dtsi Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/conf/IMX6 Tue Jul 22 04:39:32 2014 (r268977) @@ -154,8 +154,8 @@ options FREEBSD_BOOT_LOADER # Process # SoC-specific devices device ffec # Freescale Fast Ethernet Controller -#device fsliic # Freescale i2c/iic (not ready yet) -#device iic # iic protocol -#device iicbus # iic bus +device fsliic # Freescale i2c/iic +device iic # iic protocol +device iicbus # iic bus #device imxwdt # Watchdog. WARNING: can't be disabled!!! Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/freescale/imx/files.imx6 Tue Jul 22 04:39:32 2014 (r268977) @@ -27,6 +27,7 @@ arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard arm/freescale/imx/imx_gpio.c optional gpio +arm/freescale/imx/imx_i2c.c optional fsliic # # Optional devices. @@ -52,5 +53,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # #arm/freescale/imx/imx51_iomux.c optional iomux #dev/ata/chipsets/ata-fsl.c optional imxata -#arm/freescale/imx/imx_i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Jul 22 04:39:32 2014 (r268977) @@ -86,6 +86,12 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-i2c", 1}, + {"fsl,imx-i2c", 1}, + {NULL, 0} +}; + struct i2c_softc { device_t dev; device_t iicbus; @@ -227,7 +233,7 @@ i2c_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c")) + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); sc = device_get_softc(dev); @@ -246,7 +252,7 @@ i2c_probe(device_t dev) /* Enable I2C */ i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN); bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res); - device_set_desc(dev, "I2C bus controller"); + device_set_desc(dev, "Freescale i.MX I2C bus controller"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Tue Jul 22 04:39:16 2014 (r268976) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Tue Jul 22 04:39:32 2014 (r268977) @@ -338,6 +338,27 @@ reg = <0x02100000 0x00100000>; ranges; + i2c1: i2c@021a0000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a0000 0x4000>; + interrupts = < 68 >; + status = "disabled"; + }; + + i2c2: i2c@021a4000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a4000 0x4000>; + interrupts = < 69 >; + status = "disabled"; + }; + + i2c3: i2c@021ac000 { + compatible = "fsl,imx6q-i2c"; + reg = <0x021a8000 0x4000>; + interrupts = < 70 >; + status = "disabled"; + }; + fec1: ethernet@02188000 { compatible = "fsl,imx6q-fec"; reg = <0x02188000 0x4000>; From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 04:47:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 416384CA; Tue, 22 Jul 2014 04:47:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E71628EC; Tue, 22 Jul 2014 04:47:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M4lK9P052017; Tue, 22 Jul 2014 04:47:20 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M4lKVJ052016; Tue, 22 Jul 2014 04:47:20 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407220447.s6M4lKVJ052016@svn.freebsd.org> From: Sean Bruno Date: Tue, 22 Jul 2014 04:47:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268978 - head/sys/boot/userboot/test 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.18 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, 22 Jul 2014 04:47:20 -0000 Author: sbruno Date: Tue Jul 22 04:47:19 2014 New Revision: 268978 URL: http://svnweb.freebsd.org/changeset/base/268978 Log: copyin/copyout should return 0 if they are truly emulating copyin/copyout behavior. remove stray %s in printf rewrite printf to display 64bit type without warning. Modified: head/sys/boot/userboot/test/test.c Modified: head/sys/boot/userboot/test/test.c ============================================================================== --- head/sys/boot/userboot/test/test.c Tue Jul 22 04:39:32 2014 (r268977) +++ head/sys/boot/userboot/test/test.c Tue Jul 22 04:47:19 2014 (r268978) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -292,6 +293,7 @@ test_copyin(void *arg, const void *from, if (to + size > image_size) size = image_size - to; memcpy(&image[to], from, size); + return(0); } int @@ -304,6 +306,7 @@ test_copyout(void *arg, uint64_t from, v if (from + size > image_size) size = image_size - from; memcpy(to, &image[from], size); + return(0); } void @@ -333,7 +336,7 @@ test_setgdt(void *arg, uint64_t v, size_ void test_exec(void *arg, uint64_t pc) { - printf("Execute at 0x%llx\n", pc); + printf("Execute at 0x%"PRIu64"\n", pc); test_exit(arg, 0); } @@ -411,7 +414,7 @@ void usage() { - printf("usage: %s [-d ] [-h \n"); + printf("usage: [-d ] [-h \n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 06:40:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5980527C; Tue, 22 Jul 2014 06:40:28 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46E3921EC; Tue, 22 Jul 2014 06:40:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M6eSGw004603; Tue, 22 Jul 2014 06:40:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M6eSKX004602; Tue, 22 Jul 2014 06:40:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407220640.s6M6eSKX004602@svn.freebsd.org> From: Xin LI Date: Tue, 22 Jul 2014 06:40:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268979 - head/libexec/save-entropy 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.18 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, 22 Jul 2014 06:40:28 -0000 Author: delphij Date: Tue Jul 22 06:40:27 2014 New Revision: 268979 URL: http://svnweb.freebsd.org/changeset/base/268979 Log: Don't save entropy inside jails. As of r126744, we no longer feed the entropy device in jails upon start, and collecting them is no longer useful. PR: conf/126744 Submitted by: Eugene Grosbein (with minor changes) MFC after: 1 week Approved by: so (des) Modified: head/libexec/save-entropy/save-entropy.sh Modified: head/libexec/save-entropy/save-entropy.sh ============================================================================== --- head/libexec/save-entropy/save-entropy.sh Tue Jul 22 04:47:19 2014 (r268978) +++ head/libexec/save-entropy/save-entropy.sh Tue Jul 22 06:40:27 2014 (r268979) @@ -42,6 +42,8 @@ elif [ -r /etc/rc.conf ]; then . /etc/rc.conf 2>/dev/null fi +[ $(/sbin/sysctl -n security.jail.jailed) = 0 ] || exit 0 + case ${entropy_dir} in [Nn][Oo]) exit 0 From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 08:37:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E61F526; Tue, 22 Jul 2014 08:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4392B9B; Tue, 22 Jul 2014 08:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M8b104057752; Tue, 22 Jul 2014 08:37:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M8b12u057751; Tue, 22 Jul 2014 08:37:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407220837.s6M8b12u057751@svn.freebsd.org> From: Xin LI Date: Tue, 22 Jul 2014 08:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268980 - 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.18 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, 22 Jul 2014 08:37:02 -0000 Author: delphij Date: Tue Jul 22 08:37:01 2014 New Revision: 268980 URL: http://svnweb.freebsd.org/changeset/base/268980 Log: Correct typo introduced with r268855. MFC after: 10 days X-MFC with: r268855 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 06:40:27 2014 (r268979) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 08:37:01 2014 (r268980) @@ -208,7 +208,7 @@ enum zio_flag { ZIO_FLAG_NOPWRITE = 1 << 26, ZIO_FLAG_REEXECUTED = 1 << 27, ZIO_FLAG_DELEGATED = 1 << 28, - ZIO_FLAG_QUEUE_IO_DONE = 1 << 28, + ZIO_FLAG_QUEUE_IO_DONE = 1 << 29, }; #define ZIO_FLAG_MUSTSUCCEED 0 From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 08:52:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE4C585A; Tue, 22 Jul 2014 08:52:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A21DB2CF7; Tue, 22 Jul 2014 08:52:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6M8qneE066100; Tue, 22 Jul 2014 08:52:49 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6M8qnNv066099; Tue, 22 Jul 2014 08:52:49 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201407220852.s6M8qnNv066099@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 22 Jul 2014 08:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268981 - head/sys/dev/drm2 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.18 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, 22 Jul 2014 08:52:49 -0000 Author: ray Date: Tue Jul 22 08:52:49 2014 New Revision: 268981 URL: http://svnweb.freebsd.org/changeset/base/268981 Log: Remove #ifdef-s to reduce difference to upstream. Pointed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/drm2/drm_fb_helper.c Modified: head/sys/dev/drm2/drm_fb_helper.c ============================================================================== --- head/sys/dev/drm2/drm_fb_helper.c Tue Jul 22 08:37:01 2014 (r268980) +++ head/sys/dev/drm2/drm_fb_helper.c Tue Jul 22 08:52:49 2014 (r268981) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__FreeBSD__) struct vt_kms_softc { struct drm_fb_helper *fb_helper; struct task fb_mode_task; @@ -69,7 +68,6 @@ vt_kms_postswitch(void *arg) return (0); } -#endif static DRM_LIST_HEAD(kernel_fb_helper_list); @@ -934,10 +932,8 @@ int drm_fb_helper_single_fb_probe(struct struct fb_info *info; struct drm_fb_helper_surface_size sizes; int gamma_size = 0; -#if defined(__FreeBSD__) struct vt_kms_softc *sc; device_t kdev; -#endif memset(&sizes, 0, sizeof(struct drm_fb_helper_surface_size)); sizes.surface_depth = 24; @@ -1014,7 +1010,6 @@ int drm_fb_helper_single_fb_probe(struct if (new_fb < 0) return new_fb; -#if defined(__FreeBSD__) sc = malloc(sizeof(struct vt_kms_softc), DRM_MEM_KMS, M_WAITOK | M_ZERO); sc->fb_helper = fb_helper; @@ -1029,14 +1024,12 @@ int drm_fb_helper_single_fb_probe(struct info->fb_stride = fb_helper->fb->pitches[0]; info->fb_priv = sc; info->enter = &vt_kms_postswitch; -#endif /* set the fb pointer */ for (i = 0; i < fb_helper->crtc_count; i++) { fb_helper->crtc_info[i].mode_set.fb = fb_helper->fb; } -#if defined(__FreeBSD__) if (new_fb) { device_t fbd; int ret; @@ -1052,30 +1045,6 @@ int drm_fb_helper_single_fb_probe(struct DRM_ERROR("Failed to attach fbd device: %d\n", ret); #endif } -#else - if (new_fb) { - info->var.pixclock = 0; - if (register_framebuffer(info) < 0) { - return -EINVAL; - } - - printf("fb%d: %s frame buffer device\n", info->node, - info->fix.id); - - } else { - drm_fb_helper_set_par(info); - } - - /* Switch back to kernel console on panic */ - /* multi card linked list maybe */ - if (list_empty(&kernel_fb_helper_list)) { - printf("drm: registered panic notifier\n"); - atomic_notifier_chain_register(&panic_notifier_list, - &paniced); - } - if (new_fb) - list_add(&fb_helper->kernel_fb_list, &kernel_fb_helper_list); -#endif return 0; } From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 09:02:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C897AC76; Tue, 22 Jul 2014 09:02:23 +0000 (UTC) Received: from smtp1.multiplay.co.uk (smtp1.multiplay.co.uk [85.236.96.35]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4272DCD; Tue, 22 Jul 2014 09:02:23 +0000 (UTC) Received: by smtp1.multiplay.co.uk (Postfix, from userid 65534) id 7254C20E7088C; Tue, 22 Jul 2014 09:02:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.multiplay.co.uk X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=8.0 tests=AWL,BAYES_00,DOS_OE_TO_MX, FSL_HELO_NON_FQDN_1,HELO_NO_DOMAIN,RDNS_DYNAMIC,STOX_REPLY_TYPE autolearn=no version=3.3.1 Received: from r2d2 (82-69-141-170.dsl.in-addr.zen.co.uk [82.69.141.170]) by smtp1.multiplay.co.uk (Postfix) with ESMTPS id 2731520E70886; Tue, 22 Jul 2014 09:02:11 +0000 (UTC) Message-ID: <6B8002A135E04714BC8E5F3B41DD2AFF@multiplay.co.uk> From: "Steven Hartland" To: "Xin LI" , , , References: <201407220837.s6M8b12u057751@svn.freebsd.org> Subject: Re: svn commit: r268980 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys Date: Tue, 22 Jul 2014 10:02:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 09:02:23 -0000 Nice catch, that could well be the cause of the "Solaris Assert/zio.c:2548" panics don't you think? Regards Steve ----- Original Message ----- From: "Xin LI" To: ; ; Sent: Tuesday, July 22, 2014 9:37 AM Subject: svn commit: r268980 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys > Author: delphij > Date: Tue Jul 22 08:37:01 2014 > New Revision: 268980 > URL: http://svnweb.freebsd.org/changeset/base/268980 > > Log: > Correct typo introduced with r268855. > > MFC after: 10 days > X-MFC with: r268855 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > > Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h > ============================================================================== > --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 06:40:27 2014 (r268979) > +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Tue Jul 22 08:37:01 2014 (r268980) > @@ -208,7 +208,7 @@ enum zio_flag { > ZIO_FLAG_NOPWRITE = 1 << 26, > ZIO_FLAG_REEXECUTED = 1 << 27, > ZIO_FLAG_DELEGATED = 1 << 28, > - ZIO_FLAG_QUEUE_IO_DONE = 1 << 28, > + ZIO_FLAG_QUEUE_IO_DONE = 1 << 29, > }; > > #define ZIO_FLAG_MUSTSUCCEED 0 > > From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 12:00:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1F48A82; Tue, 22 Jul 2014 12:00:00 +0000 (UTC) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEDDA2CE2; Tue, 22 Jul 2014 11:59:59 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id k48so7721801wev.26 for ; Tue, 22 Jul 2014 04:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=QE/wyDuFBC0KG4lqOEGK6UWWd45Jno9jeX0x2GL5rks=; b=e/H7EXNRQpWZ6oN1M8IqZp52hYEhcBVHRIWZMuvnzVf8ML/++nze+GTL/Aknle8ruE PwNZPGMxRzdqDYp02qj4j0CWvu2lFvDjuKAUckRial6VBn9Aox+/bIZLXlKL8ukv1/Rb f7SiyTDnYFZmCqneL/R2rsqpcKGJYhlHRe6gzM1ukqVIEHmIBsEd8ugiUHQCaxzx/vFy CX3buLV985ZBhXj8HromVc9yM0elIQFAXRIPFmwODJFAjW1Y13esi4SDLNSYRJ7g8u1z /gVStcDKGmDRjdtl7ZQZ8LB5ujEpR3lN4t3Ooblbb17iXYQVyM+FonQx4Q6KEVCDZcvN 5Dbg== X-Received: by 10.180.95.166 with SMTP id dl6mr14296842wib.15.1406030397417; Tue, 22 Jul 2014 04:59:57 -0700 (PDT) Received: from [172.16.1.30] (39.Red-2-136-52.dynamicIP.rima-tde.net. [2.136.52.39]) by mx.google.com with ESMTPSA id wv8sm526262wjb.1.2014.07.22.04.59.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 04:59:56 -0700 (PDT) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Message-ID: <53CE5238.5030106@FreeBSD.org> Date: Tue, 22 Jul 2014 13:59:52 +0200 From: =?UTF-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268158 - in head/sys: amd64/amd64 kern sys References: <201407021324.s62DOMfa065093@svn.freebsd.org> In-Reply-To: <201407021324.s62DOMfa065093@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 12:00:00 -0000 On 02/07/14 15:24, Ed Maste wrote: > Author: emaste > Date: Wed Jul 2 13:24:21 2014 > New Revision: 268158 > URL: http://svnweb.freebsd.org/changeset/base/268158 > > Log: > Prefer vt(4) for UEFI boot > > The UEFI framebuffer driver vt_efifb requires vt(4), so add a mechanism > for the startup routine to set the preferred console. This change is > ugly because console init happens very early in the boot, making a > cleaner interface difficult. This change is intended only to facilitate > the sc(4) / vt(4) transition, and can be reverted once vt(4) is the > default. > > Modified: > head/sys/amd64/amd64/machdep.c > head/sys/kern/kern_cons.c > head/sys/sys/cons.h > > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Wed Jul 2 13:09:26 2014 (r268157) > +++ head/sys/amd64/amd64/machdep.c Wed Jul 2 13:24:21 2014 (r268158) > @@ -1955,6 +1955,14 @@ hammer_time(u_int64_t modulep, u_int64_t > clock_init(); > > /* > + * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) > + * transition). > + */ > + if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != > + NULL) > + vty_set_preferred(VTY_VT); I think a kmdp != NULL check should be added here, because on Xen PVH guests kmdp == NULL. Roger. From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 13:58:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71C22800; Tue, 22 Jul 2014 13:58:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F90C28B1; Tue, 22 Jul 2014 13:58:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MDwYa5002042; Tue, 22 Jul 2014 13:58:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MDwYfG002041; Tue, 22 Jul 2014 13:58:34 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407221358.s6MDwYfG002041@svn.freebsd.org> From: Ed Maste Date: Tue, 22 Jul 2014 13:58:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268982 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 13:58:34 -0000 Author: emaste Date: Tue Jul 22 13:58:33 2014 New Revision: 268982 URL: http://svnweb.freebsd.org/changeset/base/268982 Log: Don't pass null kmdp to preload_search_info On Xen PVH guests kmdp == NULL. Submitted by: royger MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Jul 22 08:52:49 2014 (r268981) +++ head/sys/amd64/amd64/machdep.c Tue Jul 22 13:58:33 2014 (r268982) @@ -1958,8 +1958,8 @@ hammer_time(u_int64_t modulep, u_int64_t * Use vt(4) by default for UEFI boot (during the sc(4)/vt(4) * transition). */ - if (preload_search_info(kmdp, MODINFO_METADATA | MODINFOMD_EFI_MAP) != - NULL) + if (kmdp != NULL && preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_MAP) != NULL) vty_set_preferred(VTY_VT); /* From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 16:10:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C38D9931; Tue, 22 Jul 2014 16:10:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1245275B; Tue, 22 Jul 2014 16:10:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MGAuRF065271; Tue, 22 Jul 2014 16:10:56 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MGAugj065254; Tue, 22 Jul 2014 16:10:56 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221610.s6MGAugj065254@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 16:10:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268983 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 16:10:56 -0000 Author: pfg Date: Tue Jul 22 16:10:56 2014 New Revision: 268983 URL: http://svnweb.freebsd.org/changeset/base/268983 Log: rewind: always clear error indicator. Required by POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/rewind.html Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 1 week Modified: head/lib/libc/stdio/rewind.c Modified: head/lib/libc/stdio/rewind.c ============================================================================== --- head/lib/libc/stdio/rewind.c Tue Jul 22 13:58:33 2014 (r268982) +++ head/lib/libc/stdio/rewind.c Tue Jul 22 16:10:56 2014 (r268983) @@ -53,9 +53,8 @@ rewind(FILE *fp) __sinit(); FLOCKFILE(fp); - if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) { - clearerr_unlocked(fp); + if (_fseeko(fp, (off_t)0, SEEK_SET, 1) == 0) errno = serrno; - } + clearerr_unlocked(fp); /* POSIX: clear stdio error regardless */ FUNLOCKFILE(fp); } From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 16:19:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33835DE1; Tue, 22 Jul 2014 16:19:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20C8627FD; Tue, 22 Jul 2014 16:19:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MGJ1LY068004; Tue, 22 Jul 2014 16:19:01 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MGJ10G068003; Tue, 22 Jul 2014 16:19:01 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221619.s6MGJ10G068003@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 16:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268984 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 16:19:02 -0000 Author: pfg Date: Tue Jul 22 16:19:01 2014 New Revision: 268984 URL: http://svnweb.freebsd.org/changeset/base/268984 Log: ftello: return 1 when seeking offset on an append stream. Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 2 weeks Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) * Find offset of underlying I/O object, then * adjust for buffered bytes. */ + if (__sflush(fp)) /* may adjust seek offset on append stream */ + return (1); if (fp->_flags & __SOFF) pos = fp->_offset; else { From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 16:39:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10C479D6; Tue, 22 Jul 2014 16:39:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F20992A55; Tue, 22 Jul 2014 16:39:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MGdBpY077094; Tue, 22 Jul 2014 16:39:11 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MGdB3U077092; Tue, 22 Jul 2014 16:39:11 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221639.s6MGdB3U077092@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 16:39:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268985 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 16:39:12 -0000 Author: pfg Date: Tue Jul 22 16:39:11 2014 New Revision: 268985 URL: http://svnweb.freebsd.org/changeset/base/268985 Log: Mostly cosmetic cleanups. In fputs() avoid implcit casting on iov.iov_len. MFC after: 3 days Modified: head/lib/libc/stdio/fputs.c head/lib/libc/stdio/puts.c Modified: head/lib/libc/stdio/fputs.c ============================================================================== --- head/lib/libc/stdio/fputs.c Tue Jul 22 16:19:01 2014 (r268984) +++ head/lib/libc/stdio/fputs.c Tue Jul 22 16:39:11 2014 (r268985) @@ -55,7 +55,7 @@ fputs(const char * __restrict s, FILE * struct __siov iov; iov.iov_base = (void *)s; - iov.iov_len = uio.uio_resid = strlen(s); + uio.uio_resid = iov.iov_len = strlen(s); uio.uio_iov = &iov; uio.uio_iovcnt = 1; FLOCKFILE(fp); Modified: head/lib/libc/stdio/puts.c ============================================================================== --- head/lib/libc/stdio/puts.c Tue Jul 22 16:19:01 2014 (r268984) +++ head/lib/libc/stdio/puts.c Tue Jul 22 16:39:11 2014 (r268985) @@ -51,12 +51,12 @@ int puts(char const *s) { int retval; - size_t c = strlen(s); + size_t c; struct __suio uio; struct __siov iov[2]; iov[0].iov_base = (void *)s; - iov[0].iov_len = c; + iov[0].iov_len = c = strlen(s); iov[1].iov_base = "\n"; iov[1].iov_len = 1; uio.uio_resid = c + 1; From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 16:44:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CDD5FD7D for ; Tue, 22 Jul 2014 16:44:54 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52ACA2B12 for ; Tue, 22 Jul 2014 16:44:54 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id v6so6168861lbi.38 for ; Tue, 22 Jul 2014 09:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=DoRe0Y0C72NGvWraBvzaDi4LuH2RBXEDmhsIlbk3+x0=; b=bcgcll40jqveGgiLdZr7Y8O9UZVlD4Nh8JLAYmuqPMWe9beBOtUpnpb4DIQyGvFdec cewyG68vJqrAcv2zJX3bQokc//x656wxu3RH9BmSj7DLdHqw07HIwBsP3+emqVHxwZ69 rn5ts289ry3ZfGPX6p2CwOs0JGMPHu4KcoFwqO+ZEKYjgQD2AVaQbdokLjBfmR70/lLI bAsUU2F8/wu03wbNWxT4m/80F5BdomMllzd+2fTqvAulvFnKX3khzgEYpQjjnaTkUrVe SO27stZe+lOCna4jbPtzo0XfQRNZ80+eG6ogBecR/9zddP2wWGhwkTQLMStll9c5/ZDb 9usQ== X-Gm-Message-State: ALoCoQmTSMfbsGkFkD+paidiZRv8dE+VCj493/IwfHD21mi05iEjaSkFvoQZFBtoIfKhtTyNOVMA X-Received: by 10.152.25.229 with SMTP id f5mr13472857lag.87.1406047486378; Tue, 22 Jul 2014 09:44:46 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id xm1sm1283864lbb.15.2014.07.22.09.44.45 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 09:44:45 -0700 (PDT) Message-ID: <53CE94F6.3090003@freebsd.org> Date: Tue, 22 Jul 2014 20:44:38 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> In-Reply-To: <201407221619.s6MGJ10G068003@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 16:44:54 -0000 Producing physical writes on ftell cause great performance degradation. You should check for __SAPP flag before calling sflush to do this only for append-mode files. On 22.07.2014 20:19, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jul 22 16:19:01 2014 > New Revision: 268984 > URL: http://svnweb.freebsd.org/changeset/base/268984 > > Log: > ftello: return 1 when seeking offset on an append stream. > > Obtained from: Apple Inc. (Libc 997.90.3) > Phabric: D442 > MFC after: 2 weeks > > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) > @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) > * Find offset of underlying I/O object, then > * adjust for buffered bytes. > */ > + if (__sflush(fp)) /* may adjust seek offset on append stream */ > + return (1); > if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 16:56:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A48E023A; Tue, 22 Jul 2014 16:56:51 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E647C2C40; Tue, 22 Jul 2014 16:56:50 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CCA7E7280; Tue, 22 Jul 2014 16:56:49 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 4EF5395C; Tue, 22 Jul 2014 18:56:31 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mateusz Guzik Subject: Re: svn commit: r268745 - in head/usr.bin: . timeout References: <201407160955.s6G9taro084054@svn.freebsd.org> <20140716102908.GA17076@dft-labs.eu> Date: Tue, 22 Jul 2014 18:56:31 +0200 In-Reply-To: <20140716102908.GA17076@dft-labs.eu> (Mateusz Guzik's message of "Wed, 16 Jul 2014 12:29:08 +0200") Message-ID: <86oawh5o3k.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 16:56:51 -0000 Mateusz Guzik writes: > Baptiste Daroussin writes: > > +static sig_atomic_t sig_chld =3D 0; > > +static sig_atomic_t sig_term =3D 0; > > +static sig_atomic_t sig_alrm =3D 0; > > +static sig_atomic_t sig_ign =3D 0; > No reason to se these explicitely to 0. They do however need to be volatile. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 17:08:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DB7D533 for ; Tue, 22 Jul 2014 17:08:18 +0000 (UTC) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com [209.85.215.53]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7F3C2D29 for ; Tue, 22 Jul 2014 17:08:17 +0000 (UTC) Received: by mail-la0-f53.google.com with SMTP id gl10so6395073lab.12 for ; Tue, 22 Jul 2014 10:08:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=H7y5JUzll25UFuY4vrxkYp/iwWUzSSyPh3K1yLYiBQ0=; b=WW3TeOE+zrU0YU4oxlBueHrlf0rI4j0v4UlEa88/cU8MSX5zVI7HktULEspcJLOb4U aI8xAjOOq/jh+RuhSjM4peg8YRmSArHSKL4aQZxwCtlGeyhVguB/Tt2ZpWrh3z7Pkvun on5a/NDTJdf9PS51gqPhe6AGW2kOE2IalO1Dc2ZLXdT3T28oDNUxIO2B7ElyIsOjWP0E 1reX26IjbI3hrZT+xO4cc/DACMlgWfi4xLVdxSxbVvT3+qlB0RuZzXSgolJACxQn2P2O XTidjx8bnWM6aMDgEud7vuPYMAUfcg6re+lEJtc4RBJxEsaVgYJzpb9HGhJ+87iL4Wz1 ZUSQ== X-Gm-Message-State: ALoCoQnhi0xZaqnJNqBHPARoEAvHbGL3F9QfZMf92UTxPDBkSna1hkK3oCW2ZZoP04Ha1H0CZarm X-Received: by 10.112.157.68 with SMTP id wk4mr13378712lbb.85.1406048895509; Tue, 22 Jul 2014 10:08:15 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id c7sm1349742lbd.37.2014.07.22.10.08.14 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 10:08:14 -0700 (PDT) Message-ID: <53CE9A77.4060000@freebsd.org> Date: Tue, 22 Jul 2014 21:08:07 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> <53CE94F6.3090003@freebsd.org> In-Reply-To: <53CE94F6.3090003@freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 17:08:18 -0000 On 22.07.2014 20:44, Andrey Chernov wrote: > Producing physical writes on ftell cause great performance degradation. > You should check for __SAPP flag before calling sflush to do this only > for append-mode files. BTW, I believe that sflush() should be completely eliminated even for _SAPP case. Something like that instead: if (fp->_flags & __SAPP) { pos = _sseek(fp, (fpos_t)0, SEEK_END); if (pos == -1) return (1); } else if (fp->_flags & __SOFF) pos = fp->_offset; else { pos = _sseek(fp, (fpos_t)0, SEEK_CUR); if (pos == -1) return (1); } > > On 22.07.2014 20:19, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Tue Jul 22 16:19:01 2014 >> New Revision: 268984 >> URL: http://svnweb.freebsd.org/changeset/base/268984 >> >> Log: >> ftello: return 1 when seeking offset on an append stream. >> >> Obtained from: Apple Inc. (Libc 997.90.3) >> Phabric: D442 >> MFC after: 2 weeks >> >> Modified: >> head/lib/libc/stdio/ftell.c >> >> Modified: head/lib/libc/stdio/ftell.c >> ============================================================================== >> --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) >> +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) >> @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) >> * Find offset of underlying I/O object, then >> * adjust for buffered bytes. >> */ >> + if (__sflush(fp)) /* may adjust seek offset on append stream */ >> + return (1); >> if (fp->_flags & __SOFF) >> pos = fp->_offset; >> else { >> > > -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 17:30:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56CDBBD9; Tue, 22 Jul 2014 17:30:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 429302EFC; Tue, 22 Jul 2014 17:30:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MHU6VV099772; Tue, 22 Jul 2014 17:30:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MHU6Ej099771; Tue, 22 Jul 2014 17:30:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407221730.s6MHU6Ej099771@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 22 Jul 2014 17:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268986 - head/sys/geom/uzip 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.18 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, 22 Jul 2014 17:30:06 -0000 Author: marcel Date: Tue Jul 22 17:30:05 2014 New Revision: 268986 URL: http://svnweb.freebsd.org/changeset/base/268986 Log: In r264504, we prevented doing I/O for more than MAXPHYS by making the assumption that consumers would respect bio_completed and/or bio_resid to detect short reads. This assumption proved false and file corruption was the result. Create as many bios as we need to satisfy the original request. Check the cached chunk every time we need to do I/O to increase the hit rate. Obtained from: junipre Networks, Inc. MFC after: 1 week Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Jul 22 16:39:11 2014 (r268985) +++ head/sys/geom/uzip/g_uzip.c Tue Jul 22 17:30:05 2014 (r268986) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2004 Max Khon + * Copyright (c) 2014 Juniper Networks, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -86,6 +87,8 @@ struct g_uzip_softc { int req_cached; /* cached requests */ }; +static void g_uzip_done(struct bio *bp); + static void g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) { @@ -120,213 +123,229 @@ z_free(void *nil, void *ptr) free(ptr, M_GEOM_UZIP); } +static int +g_uzip_cached(struct g_geom *gp, struct bio *bp) +{ + struct g_uzip_softc *sc; + off_t ofs; + size_t blk, blkofs, usz; + + sc = gp->softc; + ofs = bp->bio_offset + bp->bio_completed; + blk = ofs / sc->blksz; + mtx_lock(&sc->last_mtx); + if (blk == sc->last_blk) { + blkofs = ofs % sc->blksz; + usz = sc->blksz - blkofs; + if (bp->bio_resid < usz) + usz = bp->bio_resid; + memcpy(bp->bio_data + bp->bio_completed, sc->last_buf + blkofs, + usz); + sc->req_cached++; + mtx_unlock(&sc->last_mtx); + + DPRINTF(("%s/%s: %p: offset=%jd: got %jd bytes from cache\n", + __func__, gp->name, bp, (intmax_t)ofs, (intmax_t)usz)); + + bp->bio_completed += usz; + bp->bio_resid -= usz; + + if (bp->bio_resid == 0) { + g_io_deliver(bp, 0); + return (1); + } + } else + mtx_unlock(&sc->last_mtx); + + return (0); +} + +static int +g_uzip_request(struct g_geom *gp, struct bio *bp) +{ + struct g_uzip_softc *sc; + struct bio *bp2; + struct g_consumer *cp; + struct g_provider *pp; + off_t ofs; + size_t start_blk, end_blk; + + if (g_uzip_cached(gp, bp) != 0) + return (1); + + sc = gp->softc; + + bp2 = g_clone_bio(bp); + if (bp2 == NULL) { + g_io_deliver(bp, ENOMEM); + return (1); + } + bp2->bio_done = g_uzip_done; + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; + + ofs = bp->bio_offset + bp->bio_completed; + start_blk = ofs / sc->blksz; + KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); + end_blk = (ofs + bp->bio_resid + sc->blksz - 1) / sc->blksz; + KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); + + DPRINTF(("%s/%s: %p: start=%u (%jd), end=%u (%jd)\n", + __func__, gp->name, bp, + (u_int)start_blk, (intmax_t)sc->offsets[start_blk], + (u_int)end_blk, (intmax_t)sc->offsets[end_blk])); + + bp2->bio_offset = sc->offsets[start_blk] - + sc->offsets[start_blk] % pp->sectorsize; + while (1) { + bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; + bp2->bio_length = (bp2->bio_length + pp->sectorsize - 1) / + pp->sectorsize * pp->sectorsize; + if (bp2->bio_length <= MAXPHYS) + break; + + end_blk--; + } + + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); + if (bp2->bio_data == NULL) { + g_destroy_bio(bp2); + g_io_deliver(bp, ENOMEM); + return (1); + } + + DPRINTF(("%s/%s: %p: reading %jd bytes from offset %jd\n", + __func__, gp->name, bp, + (intmax_t)bp2->bio_length, (intmax_t)bp2->bio_offset)); + + g_io_request(bp2, cp); + return (0); +} + static void g_uzip_done(struct bio *bp) { - int err; - struct bio *bp2; z_stream zs; - struct g_provider *pp, *pp2; + struct bio *bp2; + struct g_provider *pp; struct g_consumer *cp; struct g_geom *gp; struct g_uzip_softc *sc; - off_t iolen, pos, upos; - uint32_t start_blk, i; - size_t bsize; + char *data, *data2; + off_t ofs; + size_t blk, blkofs, len, ulen; bp2 = bp->bio_parent; - pp = bp2->bio_to; - gp = pp->geom; - cp = LIST_FIRST(&gp->consumer); - pp2 = cp->provider; + gp = bp2->bio_to->geom; sc = gp->softc; - DPRINTF(("%s: done\n", gp->name)); + + cp = LIST_FIRST(&gp->consumer); + pp = cp->provider; bp2->bio_error = bp->bio_error; if (bp2->bio_error != 0) goto done; - /* - * Uncompress data. - */ + /* Make sure there's forward progress. */ + if (bp->bio_completed == 0) { + bp2->bio_error = ECANCELED; + goto done; + } + zs.zalloc = z_alloc; zs.zfree = z_free; - err = inflateInit(&zs); - if (err != Z_OK) { - bp2->bio_error = EIO; + if (inflateInit(&zs) != Z_OK) { + bp2->bio_error = EILSEQ; goto done; } - start_blk = bp2->bio_offset / sc->blksz; - bsize = pp2->sectorsize; - iolen = bp->bio_completed; - pos = sc->offsets[start_blk] % bsize; - upos = 0; - DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd, iolen %jd " - "(%jd, %d, %zd)\n", - gp->name, start_blk, (intmax_t)pos, (intmax_t)upos, - (intmax_t)iolen, (intmax_t)bp2->bio_offset, sc->blksz, bsize)); - for (i = start_blk; upos < bp2->bio_length; i++) { - off_t len, ulen, uoff; - - uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; - ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); - len = sc->offsets[i + 1] - sc->offsets[i]; + ofs = bp2->bio_offset + bp2->bio_completed; + blk = ofs / sc->blksz; + blkofs = ofs % sc->blksz; + data = bp->bio_data + sc->offsets[blk] % pp->sectorsize; + data2 = bp2->bio_data + bp2->bio_completed; + while (bp->bio_completed && bp2->bio_resid) { + ulen = MIN(sc->blksz - blkofs, bp2->bio_resid); + len = sc->offsets[blk + 1] - sc->offsets[blk]; + DPRINTF(("%s/%s: %p/%ju: data2=%p, ulen=%u, data=%p, len=%u\n", + __func__, gp->name, gp, bp->bio_completed, + data2, (u_int)ulen, data, (u_int)len)); if (len == 0) { /* All zero block: no cache update */ - bzero(bp2->bio_data + upos, ulen); - upos += ulen; - bp2->bio_completed += ulen; - continue; - } - if (len > iolen) { - DPRINTF(("%s: done: early termination: len (%jd) > " - "iolen (%jd)\n", - gp->name, (intmax_t)len, (intmax_t)iolen)); - break; - } - zs.next_in = bp->bio_data + pos; - zs.avail_in = len; - zs.next_out = sc->last_buf; - zs.avail_out = sc->blksz; - mtx_lock(&sc->last_mtx); - err = inflate(&zs, Z_FINISH); - if (err != Z_STREAM_END) { - sc->last_blk = -1; + bzero(data2, ulen); + } else if (len <= bp->bio_completed) { + zs.next_in = data; + zs.avail_in = len; + zs.next_out = sc->last_buf; + zs.avail_out = sc->blksz; + mtx_lock(&sc->last_mtx); + if (inflate(&zs, Z_FINISH) != Z_STREAM_END) { + sc->last_blk = -1; + mtx_unlock(&sc->last_mtx); + inflateEnd(&zs); + bp2->bio_error = EILSEQ; + goto done; + } + sc->last_blk = blk; + memcpy(data2, sc->last_buf + blkofs, ulen); mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: done: inflate failed (%jd + %jd -> %jd + %jd + %jd)\n", - gp->name, (intmax_t)pos, (intmax_t)len, - (intmax_t)uoff, (intmax_t)upos, (intmax_t)ulen)); - inflateEnd(&zs); - bp2->bio_error = EIO; - goto done; - } - sc->last_blk = i; - DPRINTF(("%s: done: inflated %jd + %jd -> %jd + %jd + %jd\n", - gp->name, (intmax_t)pos, (intmax_t)len, (intmax_t)uoff, - (intmax_t)upos, (intmax_t)ulen)); - memcpy(bp2->bio_data + upos, sc->last_buf + uoff, ulen); - mtx_unlock(&sc->last_mtx); + if (inflateReset(&zs) != Z_OK) { + inflateEnd(&zs); + bp2->bio_error = EILSEQ; + goto done; + } + data += len; + } else + break; - pos += len; - iolen -= len; - upos += ulen; + data2 += ulen; bp2->bio_completed += ulen; - err = inflateReset(&zs); - if (err != Z_OK) { - inflateEnd(&zs); - bp2->bio_error = EIO; - goto done; - } - } - err = inflateEnd(&zs); - if (err != Z_OK) { - bp2->bio_error = EIO; - goto done; + bp2->bio_resid -= ulen; + bp->bio_completed -= len; + blkofs = 0; + blk++; } + if (inflateEnd(&zs) != Z_OK) + bp2->bio_error = EILSEQ; + done: - /* - * Finish processing the request. - */ - DPRINTF(("%s: done: (%d, %jd, %ld)\n", - gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, - bp2->bio_resid)); + /* Finish processing the request. */ free(bp->bio_data, M_GEOM_UZIP); g_destroy_bio(bp); - g_io_deliver(bp2, bp2->bio_error); + if (bp2->bio_error != 0 || bp2->bio_resid == 0) + g_io_deliver(bp2, bp2->bio_error); + else + g_uzip_request(gp, bp2); } static void g_uzip_start(struct bio *bp) { - struct bio *bp2; - struct g_provider *pp, *pp2; + struct g_provider *pp; struct g_geom *gp; - struct g_consumer *cp; struct g_uzip_softc *sc; - uint32_t start_blk, end_blk; - size_t bsize; pp = bp->bio_to; gp = pp->geom; - DPRINTF(("%s: start (%d)\n", gp->name, bp->bio_cmd)); - if (bp->bio_cmd != BIO_READ) { - g_io_deliver(bp, EOPNOTSUPP); - return; - } + DPRINTF(("%s/%s: %p: cmd=%d, offset=%jd, length=%jd, buffer=%p\n", + __func__, gp->name, bp, bp->bio_cmd, (intmax_t)bp->bio_offset, + (intmax_t)bp->bio_length, bp->bio_data)); - cp = LIST_FIRST(&gp->consumer); - pp2 = cp->provider; sc = gp->softc; - - start_blk = bp->bio_offset / sc->blksz; - end_blk = (bp->bio_offset + bp->bio_length + sc->blksz - 1) / sc->blksz; - KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); - KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); - sc->req_total++; - if (start_blk + 1 == end_blk) { - mtx_lock(&sc->last_mtx); - if (start_blk == sc->last_blk) { - off_t uoff; - - uoff = bp->bio_offset % sc->blksz; - KASSERT(bp->bio_length <= sc->blksz - uoff, - ("cached data error")); - memcpy(bp->bio_data, sc->last_buf + uoff, - bp->bio_length); - sc->req_cached++; - mtx_unlock(&sc->last_mtx); - DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", - gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, - (intmax_t)bp->bio_length)); - bp->bio_completed = bp->bio_length; - g_io_deliver(bp, 0); - return; - } - mtx_unlock(&sc->last_mtx); - } - - bp2 = g_clone_bio(bp); - if (bp2 == NULL) { - g_io_deliver(bp, ENOMEM); + if (bp->bio_cmd != BIO_READ) { + g_io_deliver(bp, EOPNOTSUPP); return; } - bp2->bio_done = g_uzip_done; - DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", - gp->name, start_blk, end_blk, - pp->name, pp->sectorsize, (intmax_t)pp->mediasize, - pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); - bsize = pp2->sectorsize; - bp2->bio_offset = sc->offsets[start_blk] - sc->offsets[start_blk] % bsize; - while (1) { - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; - bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; - if (bp2->bio_length < MAXPHYS) - break; - end_blk--; - DPRINTF(("%s: bio_length (%jd) > MAXPHYS: lowering end_blk " - "to %u\n", gp->name, (intmax_t)bp2->bio_length, end_blk)); - } - DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", - gp->name, - (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, - (uintmax_t)sc->offsets[start_blk], - (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], - (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); - if (bp2->bio_data == NULL) { - g_destroy_bio(bp2); - g_io_deliver(bp, ENOMEM); - return; - } + bp->bio_resid = bp->bio_length; + bp->bio_completed = 0; - g_io_request(bp2, cp); - DPRINTF(("%s: start ok\n", gp->name)); + g_uzip_request(gp, bp); } static void From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 17:42:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D47123F2 for ; Tue, 22 Jul 2014 17:42:45 +0000 (UTC) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com [209.85.215.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58AE020A3 for ; Tue, 22 Jul 2014 17:42:45 +0000 (UTC) Received: by mail-la0-f49.google.com with SMTP id hz20so6233562lab.8 for ; Tue, 22 Jul 2014 10:42:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=sEP8FK3/IytSD/lw18c36wnTbBARHlGVahTWGsazclI=; b=IznFfGMrB7w4Pq/V9OO9VTiAVFzONSjM1k8vDU59QXvf+/exWE6QfrTV03l+mCfkdv DdS1v2Z2iX0pKbO3Q3muWF58JBpFBOMNUGwRFSHwEFf1fPpggIRm9P2vDI/OIN3ydQvR YcBWKKD39xOuLJT1gtViSaQoaw5YIGwolctXg0b85hbXzGJHxrZGdXBIijPYMTNt7NWH w1eImUIBUaFD79n85TfWTDWr7UtLsKbp0PzXS+WEHvm/ISlBfIGUz/U5erda++wS2nos +PBw1DfSnnejikSDEoYrQUU63wfUDHoltEEZg5Jmr3rPn3RZG+ta19ilNFkLXqNXzFWw eXIw== X-Gm-Message-State: ALoCoQnr0NRw4SGKaMtlh5ajUZcadpuJJx+2AfGW1w1iXOoqR0UpLutuR6EdOxLm82DXg/jXjV7/ X-Received: by 10.112.202.39 with SMTP id kf7mr34982350lbc.37.1406050962880; Tue, 22 Jul 2014 10:42:42 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id uo5sm1488403lbb.6.2014.07.22.10.42.42 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 10:42:42 -0700 (PDT) Message-ID: <53CEA28A.3040106@freebsd.org> Date: Tue, 22 Jul 2014 21:42:34 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268984 - head/lib/libc/stdio References: <201407221619.s6MGJ10G068003@svn.freebsd.org> <53CE94F6.3090003@freebsd.org> <53CE9A77.4060000@freebsd.org> In-Reply-To: <53CE9A77.4060000@freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 17:42:46 -0000 On 22.07.2014 21:08, Andrey Chernov wrote: > On 22.07.2014 20:44, Andrey Chernov wrote: >> Producing physical writes on ftell cause great performance degradation. >> You should check for __SAPP flag before calling sflush to do this only >> for append-mode files. > > BTW, I believe that sflush() should be completely eliminated even for > _SAPP case. Something like that instead: Proper patch to the old version: --- ftell.c.bak 2014-07-22 21:25:46.000000000 +0400 +++ ftell.c 2014-07-22 21:28:01.000000000 +0400 @@ -118,6 +118,11 @@ if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + if (fp->_flags & __SAPP) { + pos = _sseek(fp, (fpos_t)0, SEEK_END); + if (pos == -1) + return (1); + } /* * Writing. Any buffered characters cause the * position to be greater than that in the Forget the code below, it breaks reading: > if (fp->_flags & __SAPP) { > pos = _sseek(fp, (fpos_t)0, SEEK_END); > if (pos == -1) > return (1); > } else if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > pos = _sseek(fp, (fpos_t)0, SEEK_CUR); > if (pos == -1) > return (1); > } > >> >> On 22.07.2014 20:19, Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Tue Jul 22 16:19:01 2014 >>> New Revision: 268984 >>> URL: http://svnweb.freebsd.org/changeset/base/268984 >>> >>> Log: >>> ftello: return 1 when seeking offset on an append stream. >>> >>> Obtained from: Apple Inc. (Libc 997.90.3) >>> Phabric: D442 >>> MFC after: 2 weeks >>> >>> Modified: >>> head/lib/libc/stdio/ftell.c >>> >>> Modified: head/lib/libc/stdio/ftell.c >>> ============================================================================== >>> --- head/lib/libc/stdio/ftell.c Tue Jul 22 16:10:56 2014 (r268983) >>> +++ head/lib/libc/stdio/ftell.c Tue Jul 22 16:19:01 2014 (r268984) >>> @@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset) >>> * Find offset of underlying I/O object, then >>> * adjust for buffered bytes. >>> */ >>> + if (__sflush(fp)) /* may adjust seek offset on append stream */ >>> + return (1); >>> if (fp->_flags & __SOFF) >>> pos = fp->_offset; >>> else { >>> >> >> > > -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 17:46:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9A756EA; Tue, 22 Jul 2014 17:46:25 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 667EA20D5; Tue, 22 Jul 2014 17:46:25 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id f12so6896071qad.17 for ; Tue, 22 Jul 2014 10:46:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2fy8R9+jKN3aW2V3VtciuZTzS/yErvy1qqnmYv3X30U=; b=pv8ysDER1KxZn/+dZFa/BHE4bwJ635rWgc4xogk3Zvfll6zFeD0wYV5QT0zrhVUDkX PsNHY7yP34ZPR8v3YMyPqhMsKteIgqM1tF1Ckz8YWeVhZG2kIJn+iVQ34XkNAO0M7PyG bZbe3btYhfR/KFJceCa4lrP7jL8T8PF9vacvuR3WgbtJdydsMpTM0XaMxkgjsAuWFm93 rqUA/erIxnTZTpu7g8eLfIlsvxFj+k3uW9PfedfzHtb6QPE3tf8VLLk7WKPa1OJR7Oqs V9vfl5ZoYlkELTvLH2jbFCYMUzXxHOKvuTMF+HfTmsMoWd06IIkZVvSs7mjrJKc/DL0Z WPFQ== MIME-Version: 1.0 X-Received: by 10.224.171.197 with SMTP id i5mr59637428qaz.55.1406051184510; Tue, 22 Jul 2014 10:46:24 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Tue, 22 Jul 2014 10:46:24 -0700 (PDT) In-Reply-To: <201407221730.s6MHU6Ej099771@svn.freebsd.org> References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> Date: Tue, 22 Jul 2014 10:46:24 -0700 X-Google-Sender-Auth: StKa64ZlJ0UVQ5ypVcG0zQddoqc Message-ID: Subject: Re: svn commit: r268986 - head/sys/geom/uzip From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 17:46:26 -0000 Wait, which consumers failed that test? -a On 22 July 2014 10:30, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Jul 22 17:30:05 2014 > New Revision: 268986 > URL: http://svnweb.freebsd.org/changeset/base/268986 > > Log: > In r264504, we prevented doing I/O for more than MAXPHYS by making > the assumption that consumers would respect bio_completed and/or > bio_resid to detect short reads. This assumption proved false and > file corruption was the result. > Create as many bios as we need to satisfy the original request. > Check the cached chunk every time we need to do I/O to increase the > hit rate. > > Obtained from: junipre Networks, Inc. > MFC after: 1 week > > Modified: > head/sys/geom/uzip/g_uzip.c > > Modified: head/sys/geom/uzip/g_uzip.c > ============================================================================== > --- head/sys/geom/uzip/g_uzip.c Tue Jul 22 16:39:11 2014 (r268985) > +++ head/sys/geom/uzip/g_uzip.c Tue Jul 22 17:30:05 2014 (r268986) > @@ -1,5 +1,6 @@ > /*- > * Copyright (c) 2004 Max Khon > + * Copyright (c) 2014 Juniper Networks, Inc. > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -86,6 +87,8 @@ struct g_uzip_softc { > int req_cached; /* cached requests */ > }; > > +static void g_uzip_done(struct bio *bp); > + > static void > g_uzip_softc_free(struct g_uzip_softc *sc, struct g_geom *gp) > { > @@ -120,213 +123,229 @@ z_free(void *nil, void *ptr) > free(ptr, M_GEOM_UZIP); > } > > +static int > +g_uzip_cached(struct g_geom *gp, struct bio *bp) > +{ > + struct g_uzip_softc *sc; > + off_t ofs; > + size_t blk, blkofs, usz; > + > + sc = gp->softc; > + ofs = bp->bio_offset + bp->bio_completed; > + blk = ofs / sc->blksz; > + mtx_lock(&sc->last_mtx); > + if (blk == sc->last_blk) { > + blkofs = ofs % sc->blksz; > + usz = sc->blksz - blkofs; > + if (bp->bio_resid < usz) > + usz = bp->bio_resid; > + memcpy(bp->bio_data + bp->bio_completed, sc->last_buf + blkofs, > + usz); > + sc->req_cached++; > + mtx_unlock(&sc->last_mtx); > + > + DPRINTF(("%s/%s: %p: offset=%jd: got %jd bytes from cache\n", > + __func__, gp->name, bp, (intmax_t)ofs, (intmax_t)usz)); > + > + bp->bio_completed += usz; > + bp->bio_resid -= usz; > + > + if (bp->bio_resid == 0) { > + g_io_deliver(bp, 0); > + return (1); > + } > + } else > + mtx_unlock(&sc->last_mtx); > + > + return (0); > +} > + > +static int > +g_uzip_request(struct g_geom *gp, struct bio *bp) > +{ > + struct g_uzip_softc *sc; > + struct bio *bp2; > + struct g_consumer *cp; > + struct g_provider *pp; > + off_t ofs; > + size_t start_blk, end_blk; > + > + if (g_uzip_cached(gp, bp) != 0) > + return (1); > + > + sc = gp->softc; > + > + bp2 = g_clone_bio(bp); > + if (bp2 == NULL) { > + g_io_deliver(bp, ENOMEM); > + return (1); > + } > + bp2->bio_done = g_uzip_done; > + > + cp = LIST_FIRST(&gp->consumer); > + pp = cp->provider; > + > + ofs = bp->bio_offset + bp->bio_completed; > + start_blk = ofs / sc->blksz; > + KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); > + end_blk = (ofs + bp->bio_resid + sc->blksz - 1) / sc->blksz; > + KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); > + > + DPRINTF(("%s/%s: %p: start=%u (%jd), end=%u (%jd)\n", > + __func__, gp->name, bp, > + (u_int)start_blk, (intmax_t)sc->offsets[start_blk], > + (u_int)end_blk, (intmax_t)sc->offsets[end_blk])); > + > + bp2->bio_offset = sc->offsets[start_blk] - > + sc->offsets[start_blk] % pp->sectorsize; > + while (1) { > + bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; > + bp2->bio_length = (bp2->bio_length + pp->sectorsize - 1) / > + pp->sectorsize * pp->sectorsize; > + if (bp2->bio_length <= MAXPHYS) > + break; > + > + end_blk--; > + } > + > + bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); > + if (bp2->bio_data == NULL) { > + g_destroy_bio(bp2); > + g_io_deliver(bp, ENOMEM); > + return (1); > + } > + > + DPRINTF(("%s/%s: %p: reading %jd bytes from offset %jd\n", > + __func__, gp->name, bp, > + (intmax_t)bp2->bio_length, (intmax_t)bp2->bio_offset)); > + > + g_io_request(bp2, cp); > + return (0); > +} > + > static void > g_uzip_done(struct bio *bp) > { > - int err; > - struct bio *bp2; > z_stream zs; > - struct g_provider *pp, *pp2; > + struct bio *bp2; > + struct g_provider *pp; > struct g_consumer *cp; > struct g_geom *gp; > struct g_uzip_softc *sc; > - off_t iolen, pos, upos; > - uint32_t start_blk, i; > - size_t bsize; > + char *data, *data2; > + off_t ofs; > + size_t blk, blkofs, len, ulen; > > bp2 = bp->bio_parent; > - pp = bp2->bio_to; > - gp = pp->geom; > - cp = LIST_FIRST(&gp->consumer); > - pp2 = cp->provider; > + gp = bp2->bio_to->geom; > sc = gp->softc; > - DPRINTF(("%s: done\n", gp->name)); > + > + cp = LIST_FIRST(&gp->consumer); > + pp = cp->provider; > > bp2->bio_error = bp->bio_error; > if (bp2->bio_error != 0) > goto done; > > - /* > - * Uncompress data. > - */ > + /* Make sure there's forward progress. */ > + if (bp->bio_completed == 0) { > + bp2->bio_error = ECANCELED; > + goto done; > + } > + > zs.zalloc = z_alloc; > zs.zfree = z_free; > - err = inflateInit(&zs); > - if (err != Z_OK) { > - bp2->bio_error = EIO; > + if (inflateInit(&zs) != Z_OK) { > + bp2->bio_error = EILSEQ; > goto done; > } > - start_blk = bp2->bio_offset / sc->blksz; > - bsize = pp2->sectorsize; > - iolen = bp->bio_completed; > - pos = sc->offsets[start_blk] % bsize; > - upos = 0; > - DPRINTF(("%s: done: start_blk %d, pos %jd, upos %jd, iolen %jd " > - "(%jd, %d, %zd)\n", > - gp->name, start_blk, (intmax_t)pos, (intmax_t)upos, > - (intmax_t)iolen, (intmax_t)bp2->bio_offset, sc->blksz, bsize)); > - for (i = start_blk; upos < bp2->bio_length; i++) { > - off_t len, ulen, uoff; > - > - uoff = i == start_blk ? bp2->bio_offset % sc->blksz : 0; > - ulen = MIN(sc->blksz - uoff, bp2->bio_length - upos); > - len = sc->offsets[i + 1] - sc->offsets[i]; > > + ofs = bp2->bio_offset + bp2->bio_completed; > + blk = ofs / sc->blksz; > + blkofs = ofs % sc->blksz; > + data = bp->bio_data + sc->offsets[blk] % pp->sectorsize; > + data2 = bp2->bio_data + bp2->bio_completed; > + while (bp->bio_completed && bp2->bio_resid) { > + ulen = MIN(sc->blksz - blkofs, bp2->bio_resid); > + len = sc->offsets[blk + 1] - sc->offsets[blk]; > + DPRINTF(("%s/%s: %p/%ju: data2=%p, ulen=%u, data=%p, len=%u\n", > + __func__, gp->name, gp, bp->bio_completed, > + data2, (u_int)ulen, data, (u_int)len)); > if (len == 0) { > /* All zero block: no cache update */ > - bzero(bp2->bio_data + upos, ulen); > - upos += ulen; > - bp2->bio_completed += ulen; > - continue; > - } > - if (len > iolen) { > - DPRINTF(("%s: done: early termination: len (%jd) > " > - "iolen (%jd)\n", > - gp->name, (intmax_t)len, (intmax_t)iolen)); > - break; > - } > - zs.next_in = bp->bio_data + pos; > - zs.avail_in = len; > - zs.next_out = sc->last_buf; > - zs.avail_out = sc->blksz; > - mtx_lock(&sc->last_mtx); > - err = inflate(&zs, Z_FINISH); > - if (err != Z_STREAM_END) { > - sc->last_blk = -1; > + bzero(data2, ulen); > + } else if (len <= bp->bio_completed) { > + zs.next_in = data; > + zs.avail_in = len; > + zs.next_out = sc->last_buf; > + zs.avail_out = sc->blksz; > + mtx_lock(&sc->last_mtx); > + if (inflate(&zs, Z_FINISH) != Z_STREAM_END) { > + sc->last_blk = -1; > + mtx_unlock(&sc->last_mtx); > + inflateEnd(&zs); > + bp2->bio_error = EILSEQ; > + goto done; > + } > + sc->last_blk = blk; > + memcpy(data2, sc->last_buf + blkofs, ulen); > mtx_unlock(&sc->last_mtx); > - DPRINTF(("%s: done: inflate failed (%jd + %jd -> %jd + %jd + %jd)\n", > - gp->name, (intmax_t)pos, (intmax_t)len, > - (intmax_t)uoff, (intmax_t)upos, (intmax_t)ulen)); > - inflateEnd(&zs); > - bp2->bio_error = EIO; > - goto done; > - } > - sc->last_blk = i; > - DPRINTF(("%s: done: inflated %jd + %jd -> %jd + %jd + %jd\n", > - gp->name, (intmax_t)pos, (intmax_t)len, (intmax_t)uoff, > - (intmax_t)upos, (intmax_t)ulen)); > - memcpy(bp2->bio_data + upos, sc->last_buf + uoff, ulen); > - mtx_unlock(&sc->last_mtx); > + if (inflateReset(&zs) != Z_OK) { > + inflateEnd(&zs); > + bp2->bio_error = EILSEQ; > + goto done; > + } > + data += len; > + } else > + break; > > - pos += len; > - iolen -= len; > - upos += ulen; > + data2 += ulen; > bp2->bio_completed += ulen; > - err = inflateReset(&zs); > - if (err != Z_OK) { > - inflateEnd(&zs); > - bp2->bio_error = EIO; > - goto done; > - } > - } > - err = inflateEnd(&zs); > - if (err != Z_OK) { > - bp2->bio_error = EIO; > - goto done; > + bp2->bio_resid -= ulen; > + bp->bio_completed -= len; > + blkofs = 0; > + blk++; > } > > + if (inflateEnd(&zs) != Z_OK) > + bp2->bio_error = EILSEQ; > + > done: > - /* > - * Finish processing the request. > - */ > - DPRINTF(("%s: done: (%d, %jd, %ld)\n", > - gp->name, bp2->bio_error, (intmax_t)bp2->bio_completed, > - bp2->bio_resid)); > + /* Finish processing the request. */ > free(bp->bio_data, M_GEOM_UZIP); > g_destroy_bio(bp); > - g_io_deliver(bp2, bp2->bio_error); > + if (bp2->bio_error != 0 || bp2->bio_resid == 0) > + g_io_deliver(bp2, bp2->bio_error); > + else > + g_uzip_request(gp, bp2); > } > > static void > g_uzip_start(struct bio *bp) > { > - struct bio *bp2; > - struct g_provider *pp, *pp2; > + struct g_provider *pp; > struct g_geom *gp; > - struct g_consumer *cp; > struct g_uzip_softc *sc; > - uint32_t start_blk, end_blk; > - size_t bsize; > > pp = bp->bio_to; > gp = pp->geom; > - DPRINTF(("%s: start (%d)\n", gp->name, bp->bio_cmd)); > > - if (bp->bio_cmd != BIO_READ) { > - g_io_deliver(bp, EOPNOTSUPP); > - return; > - } > + DPRINTF(("%s/%s: %p: cmd=%d, offset=%jd, length=%jd, buffer=%p\n", > + __func__, gp->name, bp, bp->bio_cmd, (intmax_t)bp->bio_offset, > + (intmax_t)bp->bio_length, bp->bio_data)); > > - cp = LIST_FIRST(&gp->consumer); > - pp2 = cp->provider; > sc = gp->softc; > - > - start_blk = bp->bio_offset / sc->blksz; > - end_blk = (bp->bio_offset + bp->bio_length + sc->blksz - 1) / sc->blksz; > - KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); > - KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); > - > sc->req_total++; > - if (start_blk + 1 == end_blk) { > - mtx_lock(&sc->last_mtx); > - if (start_blk == sc->last_blk) { > - off_t uoff; > - > - uoff = bp->bio_offset % sc->blksz; > - KASSERT(bp->bio_length <= sc->blksz - uoff, > - ("cached data error")); > - memcpy(bp->bio_data, sc->last_buf + uoff, > - bp->bio_length); > - sc->req_cached++; > - mtx_unlock(&sc->last_mtx); > > - DPRINTF(("%s: start: cached 0 + %jd, %jd + 0 + %jd\n", > - gp->name, (intmax_t)bp->bio_length, (intmax_t)uoff, > - (intmax_t)bp->bio_length)); > - bp->bio_completed = bp->bio_length; > - g_io_deliver(bp, 0); > - return; > - } > - mtx_unlock(&sc->last_mtx); > - } > - > - bp2 = g_clone_bio(bp); > - if (bp2 == NULL) { > - g_io_deliver(bp, ENOMEM); > + if (bp->bio_cmd != BIO_READ) { > + g_io_deliver(bp, EOPNOTSUPP); > return; > } > - bp2->bio_done = g_uzip_done; > - DPRINTF(("%s: start (%d..%d), %s: %d + %jd, %s: %d + %jd\n", > - gp->name, start_blk, end_blk, > - pp->name, pp->sectorsize, (intmax_t)pp->mediasize, > - pp2->name, pp2->sectorsize, (intmax_t)pp2->mediasize)); > - bsize = pp2->sectorsize; > - bp2->bio_offset = sc->offsets[start_blk] - sc->offsets[start_blk] % bsize; > - while (1) { > - bp2->bio_length = sc->offsets[end_blk] - bp2->bio_offset; > - bp2->bio_length = (bp2->bio_length + bsize - 1) / bsize * bsize; > - if (bp2->bio_length < MAXPHYS) > - break; > > - end_blk--; > - DPRINTF(("%s: bio_length (%jd) > MAXPHYS: lowering end_blk " > - "to %u\n", gp->name, (intmax_t)bp2->bio_length, end_blk)); > - } > - DPRINTF(("%s: start %jd + %jd -> %ju + %ju -> %jd + %jd\n", > - gp->name, > - (intmax_t)bp->bio_offset, (intmax_t)bp->bio_length, > - (uintmax_t)sc->offsets[start_blk], > - (uintmax_t)sc->offsets[end_blk] - sc->offsets[start_blk], > - (intmax_t)bp2->bio_offset, (intmax_t)bp2->bio_length)); > - bp2->bio_data = malloc(bp2->bio_length, M_GEOM_UZIP, M_NOWAIT); > - if (bp2->bio_data == NULL) { > - g_destroy_bio(bp2); > - g_io_deliver(bp, ENOMEM); > - return; > - } > + bp->bio_resid = bp->bio_length; > + bp->bio_completed = 0; > > - g_io_request(bp2, cp); > - DPRINTF(("%s: start ok\n", gp->name)); > + g_uzip_request(gp, bp); > } > > static void > From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 17:48:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BFE9862; Tue, 22 Jul 2014 17:48:02 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 056CF20E6; Tue, 22 Jul 2014 17:48:01 +0000 (UTC) Received: from rluna-sslvpn-nc.jnpr.net ([66.129.239.12]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s6MHlqR2041353 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 22 Jul 2014 10:47:54 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268986 - head/sys/geom/uzip From: Marcel Moolenaar In-Reply-To: Date: Tue, 22 Jul 2014 10:47:46 -0700 Message-Id: References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1878.6) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 17:48:02 -0000 --Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jul 22, 2014, at 10:46 AM, Adrian Chadd wrote: > Wait, which consumers failed that test? geom_vfs I presume, because the file corruption is seen with UFS. -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4 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 - http://gpgtools.org iEYEARECAAYFAlPOo8MACgkQpgWlLWHuifa3xACfVT2gZqQ9Ynlu95u/XmuAqCJO JVcAn0cw/my+l8HpE6TZ7ooaAuekVqOv =3fIj -----END PGP SIGNATURE----- --Apple-Mail=_F0EB4552-4C5B-41CF-AEC6-504DD2D4BCB4-- From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 17:59:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DEE213F; Tue, 22 Jul 2014 17:59:35 +0000 (UTC) Received: from mail-qa0-x22a.google.com (mail-qa0-x22a.google.com [IPv6:2607:f8b0:400d:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFEE421E6; Tue, 22 Jul 2014 17:59:34 +0000 (UTC) Received: by mail-qa0-f42.google.com with SMTP id j15so11221qaq.15 for ; Tue, 22 Jul 2014 10:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oZzNmkLmuahjCN7FMH6bY8vGrZFMpad3W+c5HgF/Xz0=; b=QxBk9BxShDjhrzDen4PNKOKwQWr5JV49U/BnOFmTZwJt2MTnZMVj1IvKUgqHduTige zxXA59e/5cL+RrROe/5daIYDIHSUVqF6TNoiz52lxXubcBYfNdnzxDjk7Q30XOS+KQzH 5NqBVHrmjHVZM6EDD13lnaponIZsXzX5W67nXv+cEEp62/AnWAERWm0BLw/Z9DkSlIxz /z4NPzhyLhWy7VQsziL9XNVCRCpp0djjfpQ6zKaCdoPOkyitbfO/+rZS0HuEBElrZQz3 N47bh1bHopLZwzqIx8u7qLU9g/UABM61dhuUTEmCndQAgA02XjU1rRHYZi1MuA4GQFPN 2o+Q== MIME-Version: 1.0 X-Received: by 10.224.171.197 with SMTP id i5mr59779119qaz.55.1406051974077; Tue, 22 Jul 2014 10:59:34 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Tue, 22 Jul 2014 10:59:34 -0700 (PDT) In-Reply-To: References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> Date: Tue, 22 Jul 2014 10:59:34 -0700 X-Google-Sender-Auth: ivOo4cmZbcf3Z872D8k4KgEwsxQ Message-ID: Subject: Re: svn commit: r268986 - head/sys/geom/uzip From: Adrian Chadd To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 17:59:35 -0000 On 22 July 2014 10:47, Marcel Moolenaar wrote: > > On Jul 22, 2014, at 10:46 AM, Adrian Chadd wrote: > >> Wait, which consumers failed that test? > > geom_vfs I presume, because the file corruption is seen with UFS. Interesting. I wonder if this is about time we bit the bullet and compiled up GEOM modules in userland so we can run regression tests on things. -a From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 18:38:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 687D6FE3; Tue, 22 Jul 2014 18:38:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 549B82600; Tue, 22 Jul 2014 18:38:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MIc0t1032546; Tue, 22 Jul 2014 18:38:00 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MIc0i9032540; Tue, 22 Jul 2014 18:38:00 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407221838.s6MIc0i9032540@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 18:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268987 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 18:38:00 -0000 Author: pfg Date: Tue Jul 22 18:37:59 2014 New Revision: 268987 URL: http://svnweb.freebsd.org/changeset/base/268987 Log: Revert r268984: Check for __SAPP flag before calling sflush. This avoids performance degradation compared to the previous approach. Submitted by: ache MFC after: 2 weeks Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 17:30:05 2014 (r268986) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 18:37:59 2014 (r268987) @@ -97,8 +97,6 @@ _ftello(FILE *fp, fpos_t *offset) * Find offset of underlying I/O object, then * adjust for buffered bytes. */ - if (__sflush(fp)) /* may adjust seek offset on append stream */ - return (1); if (fp->_flags & __SOFF) pos = fp->_offset; else { @@ -120,6 +118,11 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + if (fp->_flags & __SAPP) { + pos = _sseek(fp, (fpos_t)0, SEEK_END); + if (pos == -1) + return (1); + } /* * Writing. Any buffered characters cause the * position to be greater than that in the From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 18:56:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4217738; Tue, 22 Jul 2014 18:56:22 +0000 (UTC) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CC6F281A; Tue, 22 Jul 2014 18:56:22 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1X9fEZ-000OfQ-C1; Tue, 22 Jul 2014 22:56:19 +0400 Date: Tue, 22 Jul 2014 22:56:19 +0400 From: Slawa Olhovchenkov To: Marcel Moolenaar Subject: Re: svn commit: r268986 - head/sys/geom/uzip Message-ID: <20140722185619.GA94673@zxy.spb.ru> References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407221730.s6MHU6Ej099771@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 18:56:22 -0000 On Tue, Jul 22, 2014 at 05:30:06PM +0000, Marcel Moolenaar wrote: > Author: marcel > Date: Tue Jul 22 17:30:05 2014 > New Revision: 268986 > URL: http://svnweb.freebsd.org/changeset/base/268986 > > Log: > In r264504, we prevented doing I/O for more than MAXPHYS by making > the assumption that consumers would respect bio_completed and/or > bio_resid to detect short reads. This assumption proved false and > file corruption was the result. > Create as many bios as we need to satisfy the original request. > Check the cached chunk every time we need to do I/O to increase the > hit rate. Can you check other cases I/O for more than MAXPHYS? I think caused by incorrect partition scheme. From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 19:09:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E7F9ED0 for ; Tue, 22 Jul 2014 19:09:01 +0000 (UTC) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E8FE2959 for ; Tue, 22 Jul 2014 19:09:00 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id el20so79532lab.27 for ; Tue, 22 Jul 2014 12:08:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=k+jpCkUZs1TGsEZtmtcwW3WMdu3GPjVIi3RIS4q7IRw=; b=CnR1o75P+YwM+GTls6r4PM5wHaOAdsJOpneBhuXmEe9L7ezLhs7u7/HpG2fmwxw7Rn KATDhLBqkkDHueG+qG/nT6GzodGwX/qcINku+P6N4TPcgjWDGDURQ/iVzaBoxn+9ABWL sCbkPLUqTTNTwDh+FtzyyElQLGhqQtrP4YywrryRETeMzereNFkQc/VHrUe8+4AVbIsh 3jdC8dINO5ZIjPpqoQt1Ss9GFTLTUxgWea0ouvBZCmm0WhMoV94jGzMxa0cVOjDr0C2/ ioJGq6MaTJG31HN8XxWlBzrqZ8aPOYlw/qtUWCOB98OWeChihq9mPMg3n7RvUFFNkKyr IikA== X-Gm-Message-State: ALoCoQlVoXBTvkPOGjX8O0ZGSvHnDAjFOMsZZO4ar8euh+wAxUF5LW3pztFt2gEHRBDw2iZL97ep X-Received: by 10.152.25.132 with SMTP id c4mr14371677lag.88.1406056133274; Tue, 22 Jul 2014 12:08:53 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by mx.google.com with ESMTPSA id c7sm1752777lbd.37.2014.07.22.12.08.52 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Jul 2014 12:08:52 -0700 (PDT) Message-ID: <53CEB6BD.3000403@freebsd.org> Date: Tue, 22 Jul 2014 23:08:45 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268987 - head/lib/libc/stdio References: <201407221838.s6MIc0i9032540@svn.freebsd.org> In-Reply-To: <201407221838.s6MIc0i9032540@svn.freebsd.org> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 19:09:01 -0000 On 22.07.2014 22:38, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jul 22 18:37:59 2014 > New Revision: 268987 > URL: http://svnweb.freebsd.org/changeset/base/268987 > > Log: > Revert r268984: > Check for __SAPP flag before calling sflush. This avoids > performance degradation compared to the previous approach. Thanx. In this version sflush which doing physical write is never called, only _sseek (lseek) for __SAPP. Here is the test program, run it several times and notice ftell position increased from time to time (or not in our old version): #include int main(int argc, char *argv[]) { FILE *fp = fopen("testfile", "a"); rewind(fp); fwrite("1", 1, 1, fp); printf("%ld\n", ftell(fp)); fclose(fp); } It probably worth to be added to our test framework, but I completely unaware how to do it. > > Submitted by: ache > MFC after: 2 weeks > > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 17:30:05 2014 (r268986) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 18:37:59 2014 (r268987) > @@ -97,8 +97,6 @@ _ftello(FILE *fp, fpos_t *offset) > * Find offset of underlying I/O object, then > * adjust for buffered bytes. > */ > - if (__sflush(fp)) /* may adjust seek offset on append stream */ > - return (1); > if (fp->_flags & __SOFF) > pos = fp->_offset; > else { > @@ -120,6 +118,11 @@ _ftello(FILE *fp, fpos_t *offset) > if (HASUB(fp)) > pos -= fp->_r; /* Can be negative at this point. */ > } else if ((fp->_flags & __SWR) && fp->_p != NULL) { > + if (fp->_flags & __SAPP) { > + pos = _sseek(fp, (fpos_t)0, SEEK_END); > + if (pos == -1) > + return (1); > + } > /* > * Writing. Any buffered characters cause the > * position to be greater than that in the > -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 19:37:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C431F39; Tue, 22 Jul 2014 19:37:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77FC52C91; Tue, 22 Jul 2014 19:37:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJbd4D060707; Tue, 22 Jul 2014 19:37:39 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJbdSA060706; Tue, 22 Jul 2014 19:37:39 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407221937.s6MJbdSA060706@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 22 Jul 2014 19:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268988 - 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.18 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, 22 Jul 2014 19:37:39 -0000 Author: pluknet Date: Tue Jul 22 19:37:38 2014 New Revision: 268988 URL: http://svnweb.freebsd.org/changeset/base/268988 Log: Grammar and spelling fixes. Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Tue Jul 22 18:37:59 2014 (r268987) +++ head/share/man/man4/ddb.4 Tue Jul 22 19:37:38 2014 (r268988) @@ -1124,7 +1124,7 @@ abbreviations. .It Ic capture status .Nm supports a basic output capture facility, which can be used to retrieve the -results of debugging commands from userpsace using +results of debugging commands from userspace using .Xr sysctl 2 . .Ic capture on enables output capture; @@ -1429,7 +1429,7 @@ diagnose problems. Other bus' bridge chipsets may be able to generate NMI using bus specific methods. .Sh FILES -Header files mention in this manual page can be found below +Header files mentioned in this manual page can be found below .Pa /usr/include directory. .Pp From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 19:48:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B084A765; Tue, 22 Jul 2014 19:48:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C8D12DCE; Tue, 22 Jul 2014 19:48:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJmLkJ065807; Tue, 22 Jul 2014 19:48:21 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJmL8J065806; Tue, 22 Jul 2014 19:48:21 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407221948.s6MJmL8J065806@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 22 Jul 2014 19:48:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268989 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 19:48:21 -0000 Author: np Date: Tue Jul 22 19:48:21 2014 New Revision: 268989 URL: http://svnweb.freebsd.org/changeset/base/268989 Log: Add missing newline to an error message. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 19:37:38 2014 (r268988) +++ head/sys/dev/cxgbe/t4_sge.c Tue Jul 22 19:48:21 2014 (r268989) @@ -2939,7 +2939,7 @@ alloc_eq(struct adapter *sc, struct port } if (rc != 0) { device_printf(sc->dev, - "failed to allocate egress queue(%d): %d", + "failed to allocate egress queue(%d): %d\n", eq->flags & EQ_TYPEMASK, rc); } From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 19:54:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4EEECB89; Tue, 22 Jul 2014 19:54:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AE172F2F; Tue, 22 Jul 2014 19:54:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJsN2o069677; Tue, 22 Jul 2014 19:54:23 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJsNK9069676; Tue, 22 Jul 2014 19:54:23 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201407221954.s6MJsNK9069676@svn.freebsd.org> From: Michael Tuexen Date: Tue, 22 Jul 2014 19:54:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268990 - 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.18 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, 22 Jul 2014 19:54:23 -0000 Author: tuexen Date: Tue Jul 22 19:54:22 2014 New Revision: 268990 URL: http://svnweb.freebsd.org/changeset/base/268990 Log: Cleanup the definition of two structures which are exposed to userland. Therefore no MFC. Modified: head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Tue Jul 22 19:48:21 2014 (r268989) +++ head/sys/netinet/sctp_uio.h Tue Jul 22 19:54:22 2014 (r268990) @@ -323,7 +323,6 @@ struct sctp_paddr_change { uint32_t spc_state; uint32_t spc_error; sctp_assoc_t spc_assoc_id; - uint8_t spc_padding[4]; }; /* paddr state values */ @@ -346,7 +345,7 @@ struct sctp_remote_error { uint32_t sre_length; uint16_t sre_error; sctp_assoc_t sre_assoc_id; - uint8_t sre_data[4]; + uint8_t sre_data[]; }; /* data send failure event (deprecated) */ From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 19:55:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7C79CD8; Tue, 22 Jul 2014 19:55:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3ACF2F3E; Tue, 22 Jul 2014 19:55:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MJtP4S069937; Tue, 22 Jul 2014 19:55:25 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MJtPYt069936; Tue, 22 Jul 2014 19:55:25 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407221955.s6MJtPYt069936@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 22 Jul 2014 19:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268991 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 19:55:26 -0000 Author: ache Date: Tue Jul 22 19:55:25 2014 New Revision: 268991 URL: http://svnweb.freebsd.org/changeset/base/268991 Log: Checking for __SAPP alone is not enough because it is emulated O_APPEND only, so works for only special fdopen() case. Add real O_APPEND too. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 19:54:22 2014 (r268990) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 19:55:25 2014 (r268991) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include "un-namespace.h" @@ -118,7 +119,7 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { - if (fp->_flags & __SAPP) { + if (fp->_flags & (__SAPP|O_APPEND)) { pos = _sseek(fp, (fpos_t)0, SEEK_END); if (pos == -1) return (1); From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 20:13:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 408B518E; Tue, 22 Jul 2014 20:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C278211D; Tue, 22 Jul 2014 20:13:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MKDkdO079202; Tue, 22 Jul 2014 20:13:46 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MKDk68079201; Tue, 22 Jul 2014 20:13:46 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407222013.s6MKDk68079201@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 22 Jul 2014 20:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268992 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 20:13:47 -0000 Author: ache Date: Tue Jul 22 20:13:46 2014 New Revision: 268992 URL: http://svnweb.freebsd.org/changeset/base/268992 Log: Back the whole change out until I figure out how to obtain O_APPEND, it can't be used in this field at all. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 19:55:25 2014 (r268991) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 20:13:46 2014 (r268992) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include -#include #include #include #include "un-namespace.h" @@ -119,11 +118,6 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { - if (fp->_flags & (__SAPP|O_APPEND)) { - pos = _sseek(fp, (fpos_t)0, SEEK_END); - if (pos == -1) - return (1); - } /* * Writing. Any buffered characters cause the * position to be greater than that in the From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 20:32:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D5E7A8; Tue, 22 Jul 2014 20:32:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1C852321; Tue, 22 Jul 2014 20:32:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MKWOoh088287; Tue, 22 Jul 2014 20:32:24 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MKWOd7088286; Tue, 22 Jul 2014 20:32:24 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407222032.s6MKWOd7088286@svn.freebsd.org> From: Ian Lepore Date: Tue, 22 Jul 2014 20:32:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268993 - head/contrib/libstdc++/libsupc++ 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.18 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, 22 Jul 2014 20:32:25 -0000 Author: ian Date: Tue Jul 22 20:32:24 2014 New Revision: 268993 URL: http://svnweb.freebsd.org/changeset/base/268993 Log: Fix EABI unwind function declarations to match the function definitions. The mismatch was noticed by clang, when using it to compile the in-tree gcc and libstdc++. Modified: head/contrib/libstdc++/libsupc++/unwind-cxx.h Modified: head/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- head/contrib/libstdc++/libsupc++/unwind-cxx.h Tue Jul 22 20:13:46 2014 (r268992) +++ head/contrib/libstdc++/libsupc++/unwind-cxx.h Tue Jul 22 20:32:24 2014 (r268993) @@ -142,9 +142,9 @@ typedef enum { ctm_succeeded = 1, ctm_succeeded_with_ptr_to_base = 2 } __cxa_type_match_result; -extern "C" bool __cxa_type_match(_Unwind_Exception*, const std::type_info*, +extern "C" __cxa_type_match_result __cxa_type_match(_Unwind_Exception*, const std::type_info*, bool, void**); -extern "C" void __cxa_begin_cleanup (_Unwind_Exception*); +extern "C" bool __cxa_begin_cleanup (_Unwind_Exception*); extern "C" void __cxa_end_cleanup (void); #endif From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 20:49:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 733E9C72; Tue, 22 Jul 2014 20:49:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F65C247D; Tue, 22 Jul 2014 20:49:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MKnxkr093811; Tue, 22 Jul 2014 20:49:59 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MKnxfl093810; Tue, 22 Jul 2014 20:49:59 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407222049.s6MKnxfl093810@svn.freebsd.org> From: Ian Lepore Date: Tue, 22 Jul 2014 20:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268994 - head/contrib/gcc/config/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.18 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, 22 Jul 2014 20:49:59 -0000 Author: ian Date: Tue Jul 22 20:49:58 2014 New Revision: 268994 URL: http://svnweb.freebsd.org/changeset/base/268994 Log: Add FreeBSD to the list of environments that needs to handle R_ARM_TARGET2 relocations in unwind data as pc-relative indirect references. MFC after: 1 week Modified: head/contrib/gcc/config/arm/unwind-arm.h Modified: head/contrib/gcc/config/arm/unwind-arm.h ============================================================================== --- head/contrib/gcc/config/arm/unwind-arm.h Tue Jul 22 20:32:24 2014 (r268993) +++ head/contrib/gcc/config/arm/unwind-arm.h Tue Jul 22 20:49:58 2014 (r268994) @@ -232,7 +232,7 @@ extern "C" { if (!tmp) return 0; -#if defined(linux) || defined(__NetBSD__) +#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) /* Pc-relative indirect. */ tmp += ptr; tmp = *(_Unwind_Word *) tmp; From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 22:16:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF31B671; Tue, 22 Jul 2014 22:16:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B08502D1D; Tue, 22 Jul 2014 22:16:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMGOY8036780; Tue, 22 Jul 2014 22:16:24 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMGOVA036774; Tue, 22 Jul 2014 22:16:24 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407222216.s6MMGOVA036774@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 22 Jul 2014 22:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268995 - in 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.18 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, 22 Jul 2014 22:16:24 -0000 Author: pluknet Date: Tue Jul 22 22:16:23 2014 New Revision: 268995 URL: http://svnweb.freebsd.org/changeset/base/268995 Log: s/PCBGROUPS/PCBGROUP/ manpage to match "options PCBGROUP". Added: head/share/man/man9/PCBGROUP.9 - copied, changed from r268994, head/share/man/man9/PCBGROUPS.9 Deleted: head/share/man/man9/PCBGROUPS.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jul 22 20:49:58 2014 (r268994) +++ head/ObsoleteFiles.inc Tue Jul 22 22:16:23 2014 (r268995) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140723: renamed to PCBGROUP.9 +OLD_FILES+=usr/share/man/man9/PCBGROUPS.9.gz # 20140719: libsbuf version bump OLD_LIBS+=lib/libsbuf.so.6 # 20140718: Remove obsolete man pages Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Jul 22 20:49:58 2014 (r268994) +++ head/share/man/man9/Makefile Tue Jul 22 22:16:23 2014 (r268995) @@ -188,7 +188,7 @@ MAN= accept_filter.9 \ osd.9 \ panic.9 \ pbuf.9 \ - PCBGROUPS.9 \ + PCBGROUP.9 \ p_candebug.9 \ p_cansee.9 \ pci.9 \ Copied and modified: head/share/man/man9/PCBGROUP.9 (from r268994, head/share/man/man9/PCBGROUPS.9) ============================================================================== --- head/share/man/man9/PCBGROUPS.9 Tue Jul 22 20:49:58 2014 (r268994, copy source) +++ head/share/man/man9/PCBGROUP.9 Tue Jul 22 22:16:23 2014 (r268995) @@ -27,10 +27,10 @@ .\" $FreeBSD$ .\" .Dd July 18, 2014 -.Dt PCBGROUPS 9 +.Dt PCBGROUP 9 .Os .Sh NAME -.Nm PCBGROUPS +.Nm PCBGROUP .Nd Distributed Protocol Control Block Groups .Sh SYNOPSIS .Ft void @@ -58,16 +58,16 @@ .Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" .Fc .Pp -.Cd "options PCBGROUPS" +.Cd "options PCBGROUP" .Sh DESCRIPTION -PCBGROUPS, or "connection groups", are based on Willman, Rixner, and Cox's +PCBGROUP, or "connection groups", are based on Willman, Rixner, and Cox's 2006 USENIX paper, .Qo An Evaluation of Network Stack Parallelization Strategies in Modern Operating Systems .Qc . .Pp -The PCBGROUPS paper describes two main kind of connection groups. +The PCBGROUP paper describes two main kind of connection groups. The first, called ConnP-T, uses a pool of worker threads which implement the network stack. Serialization occurs when queuing work into and completing work from @@ -102,7 +102,7 @@ Connection establishment and teardown ca expensive than without connection groups, but that steady-state processing can be significantly faster. .Pp -Enabling PCBGROUPS in the kernel only provides the infrastructure +Enabling PCBGROUP in the kernel only provides the infrastructure required to create and manage multiple PCB groups. An implementation needs to fill in a few functions to provide PCB group hash information in order for PCBs to be placed in a PCB group. @@ -133,9 +133,9 @@ wildcard table. The PCBGROUP tables operate in conjunction with the normal single PCB list in a PCB info block. Thus, inserting and removing a PCB will still incur the same costs -as without PCBGROUPS. -A protocol which uses PCBGROUPS should fall back to the normal PCB list -lookup if a call to the PCBGROUPS layer does not yield a lookup hit. +as without PCBGROUP. +A protocol which uses PCBGROUP should fall back to the normal PCB list +lookup if a call to the PCBGROUP layer does not yield a lookup hit. .Ss Usage Initialize a PCBGROUP in a PCB info block .Pq Vt "struct pcbinfo" @@ -165,7 +165,7 @@ The PCB code in .Pa sys/netinet and .Pa sys/netinet6 -is aware of PCBGROUPS and will call into the PCBGROUPS code to do +is aware of PCBGROUP and will call into the PCBGROUP code to do PCBGROUP assignment and lookup, preferring a PCBGROUP lookup to the default global PCB info table. .Pp @@ -201,10 +201,10 @@ receive path in .Xr netisr 9 , .Xr RSS 9 .Sh HISTORY -PCBGROUPS first appeared in +PCBGROUP first appeared in .Fx 9.0 . .Pp -The PCBGROUPS implementation is inspired by Willman, Rixner, and Cox's +The PCBGROUP implementation is inspired by Willman, Rixner, and Cox's 2006 USENIX paper, .Qo An Evaluation of Network Stack Parallelization Strategies in Modern @@ -213,7 +213,7 @@ Operating Systems .Li http://www.ece.rice.edu/~willmann/pubs/paranet_usenix.pdf .Sh AUTHORS .An -nosplit -The PCBGROUPS implementation was written by +The PCBGROUP implementation was written by .An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org under contract to Juniper Networks, Inc. .Pp @@ -224,12 +224,12 @@ The .Xr RSS 9 implementation currently uses .Ic #ifdef -blocks to tie into PCBGROUPS. +blocks to tie into PCBGROUP. This is a sign that a more abstract programming API is needed. .Pp -There is currently no support for re-balancing the PCBGROUPS assignment, +There is currently no support for re-balancing the PCBGROUP assignment, nor is there any support for overriding which PCBGROUP a socket/PCB should be in. .Pp -No statistics are kept to indicate how often PCBGROUPS lookups +No statistics are kept to indicate how often PCBGROUP lookups succeed or fail. From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 22:40:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05360E42; Tue, 22 Jul 2014 22:40:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6DA82F48; Tue, 22 Jul 2014 22:39:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMdxY2046336; Tue, 22 Jul 2014 22:39:59 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMdx75046335; Tue, 22 Jul 2014 22:39:59 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407222239.s6MMdx75046335@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 22 Jul 2014 22:39:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268996 - 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.18 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, 22 Jul 2014 22:40:00 -0000 Author: pluknet Date: Tue Jul 22 22:39:59 2014 New Revision: 268996 URL: http://svnweb.freebsd.org/changeset/base/268996 Log: Re-sort synopsis, add includes. Modified: head/share/man/man9/PCBGROUP.9 Modified: head/share/man/man9/PCBGROUP.9 ============================================================================== --- head/share/man/man9/PCBGROUP.9 Tue Jul 22 22:16:23 2014 (r268995) +++ head/share/man/man9/PCBGROUP.9 Tue Jul 22 22:39:59 2014 (r268996) @@ -26,13 +26,18 @@ .\" .\" $FreeBSD$ .\" -.Dd July 18, 2014 +.Dd July 23, 2014 .Dt PCBGROUP 9 .Os .Sh NAME .Nm PCBGROUP .Nd Distributed Protocol Control Block Groups .Sh SYNOPSIS +.Cd "options PCBGROUP" +.Pp +.In sys/param.h +.In netinet/in.h +.In netinet/in_pcb.h .Ft void .Fo in_pcbgroup_init .Fa "struct inpcbinfo *pcbinfo" "u_int hashfields" "int hash_nelements" @@ -53,12 +58,11 @@ .Fn in_pcbgroup_remove "struct inpcb *inp" .Ft int .Fn in_pcbgroup_enabled "struct inpcbinfo *pcbinfo" +.In netinet6/in6_pcb.h .Ft struct inpcbgroup * .Fo in6_pcbgroup_byhash .Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" .Fc -.Pp -.Cd "options PCBGROUP" .Sh DESCRIPTION PCBGROUP, or "connection groups", are based on Willman, Rixner, and Cox's 2006 USENIX paper, From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 22:49:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC8F8E8; Tue, 22 Jul 2014 22:49:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA2C02027; Tue, 22 Jul 2014 22:49:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMnbhH050700; Tue, 22 Jul 2014 22:49:37 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMnbNb050699; Tue, 22 Jul 2014 22:49:37 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407222249.s6MMnbNb050699@svn.freebsd.org> From: "Andrey A. Chernov" Date: Tue, 22 Jul 2014 22:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268997 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 22:49:37 -0000 Author: ache Date: Tue Jul 22 22:49:37 2014 New Revision: 268997 URL: http://svnweb.freebsd.org/changeset/base/268997 Log: For "a"-mode files and rewind/fseek + fwrite combination return meaningful value now, like Apple does, but avoid their __sflush physical write performance degradation as much as possible. Modified: head/lib/libc/stdio/ftell.c Modified: head/lib/libc/stdio/ftell.c ============================================================================== --- head/lib/libc/stdio/ftell.c Tue Jul 22 22:39:59 2014 (r268996) +++ head/lib/libc/stdio/ftell.c Tue Jul 22 22:49:37 2014 (r268997) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #include #include #include "un-namespace.h" @@ -87,6 +88,7 @@ _ftello(FILE *fp, fpos_t *offset) { fpos_t pos; size_t n; + int dflags; if (fp->_seek == NULL) { errno = ESPIPE; /* historic practice */ @@ -118,6 +120,22 @@ _ftello(FILE *fp, fpos_t *offset) if (HASUB(fp)) pos -= fp->_r; /* Can be negative at this point. */ } else if ((fp->_flags & __SWR) && fp->_p != NULL) { + dflags = 0; + if (fp->_flags & __SAPP) + dflags = O_APPEND; + else if (fp->_file != -1 && + (dflags = _fcntl(fp->_file, F_GETFL)) < 0) + return (1); + if ((dflags & O_APPEND) && + (pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { + if ((fp->_flags & __SOPT) || __sflush(fp) || + (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) + return (1); + else { + *offset = pos; + return (0); + } + } /* * Writing. Any buffered characters cause the * position to be greater than that in the From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 22:55:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F19B318 for ; Tue, 22 Jul 2014 22:55:27 +0000 (UTC) Received: from nm15.bullet.mail.bf1.yahoo.com (nm15.bullet.mail.bf1.yahoo.com [98.139.212.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13F0120DF for ; Tue, 22 Jul 2014 22:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1406069719; bh=GlAV9l07dZDVb+Ms5aCfWJr7nfm4Jzcn+p0+ehr9/G8=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=hqD526gU42IFNSvounRn/aAzN3FvRojG0vzbDyl9Mu23LzIsM+onv3NopJJoCcCg8zQ+Hp+jUBFreb1VYzQLnq11GaHEJU+iujN1gnlv+pss851nmY6JnX/Fh9K40/4MIFuaBwtC9hP8ceR9V9k099Ywf9Zy7JlLZz/HM+30jXhRfasu3XpxiL3MBb5Nm3lG53Aw+Z0FRRV70Zv+rpemU0WAInQr3eESNpKuFM/gq6mFzPwWovkiT182ByhoSSYeXzfQqDWhbxt4/G7ujLYY7E8dYNorRMvBaCLOy1FPBIJLgqZXE2E6t5rvipDu2NgKSjrmAkpj6qQQzsNZXyyPNA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=SwExRtRMFQpOY7OU4HdLiAatgYZktVTmH9NNoFcbgO3H4JgTd84go/rtZXBVbE+h/mvyg3WURMqKM93+IegjicfUTK81VwAQM+uyYP/eMVOUCWyKexUyv+cSCk209/BYzTAZaoAVgFVIHg97jYIBt26GCnUeArAuAYdH/SqofS9+aWICkfalJdO78ogPWpLoJM2q7NjKNAnlCfVAmqXn48EArVBUjuSqfC3rQQ7ArI7cibZ6a6JyFtzoZgMPv5s2ZD4CSkGXkTl7VUsBfHW0zhUxDK72BM2ND+dU9XzIpnWyMaMEdM/BEfrJWNLwWuL0KJ3jXvwgf7IY488cLZnxFA==; Received: from [98.139.215.143] by nm15.bullet.mail.bf1.yahoo.com with NNFMP; 22 Jul 2014 22:55:19 -0000 Received: from [68.142.230.72] by tm14.bullet.mail.bf1.yahoo.com with NNFMP; 22 Jul 2014 22:55:19 -0000 Received: from [127.0.0.1] by smtp229.mail.bf1.yahoo.com with NNFMP; 22 Jul 2014 22:55:19 -0000 X-Yahoo-Newman-Id: 45606.3751.bm@smtp229.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: MqHSaJIVM1nSIXgAwytp0b66CN9GqRm0qaDl9ThyuDc84Nf HAe70Qd7Y8.K4xa9UsomhyAYxKklamM90OnPDqCkcXICvqBKGZPHK8s8uWbd 6lrJ.I07mRmVkOSGWksD7F5l90ChbOme.1m5xABfDPTJPBeV.M9oAv37zjpT LyvuWEoD3oDLbG63dfeSwpX04diM9DHmtMqYWH9dFnmKm_bM5ABzEdv.N0Lh IPswiEuNeu9a2BRQhubGwbMNk0ZwQZeS8pqEyWHxmbWdpZ0Uaiin07Hr6JbI c2XgzygkEwmqekpo7IxM9WY.e.XfaLye4rHMH2LSjG1TXDSwxHuTkaQn7rKj MTk7Jc4o_Oe2b8G.DYbZkrUBtmxWlxiJbpIYfT01JvcvvCGNq5ZuMMVx9VA7 Ps3GvPPFJ7T61l6UyJfa0WaMEZjXkXZerS3LlEcxp2vHSXjNxEYe2qwwbYEU LSGSrDZYaDypg3CU7zczqjLkL2Cd9TGKXxTBAhc3kUot4vwQAOCdt8hbzdZ1 iy78KxI5aMhlBqL6GALa2YPAwofy2_X_hpvpWKcPJOR6oGbw1M5Qe9AYCKpl bbmCAEEQ4x2WOHERtL3RfzfMZpbrG.xmhVVbIX0qgws0Xa2SeX_KfzDJy8Bl 2 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <53CEEBE3.10807@freebsd.org> Date: Tue, 22 Jul 2014 17:55:31 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Andrey A. Chernov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268997 - head/lib/libc/stdio References: <201407222249.s6MMnbNb050699@svn.freebsd.org> In-Reply-To: <201407222249.s6MMnbNb050699@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 22:55:27 -0000 On 07/22/14 17:49, Andrey A. Chernov wrote: > Author: ache > Date: Tue Jul 22 22:49:37 2014 > New Revision: 268997 > URL: http://svnweb.freebsd.org/changeset/base/268997 > > Log: > For "a"-mode files and rewind/fseek + fwrite combination return meaningful > value now, like Apple does, but avoid their __sflush physical write > performance degradation as much as possible. Great ! Thank you !! Pedro. > Modified: > head/lib/libc/stdio/ftell.c > > Modified: head/lib/libc/stdio/ftell.c > ============================================================================== > --- head/lib/libc/stdio/ftell.c Tue Jul 22 22:39:59 2014 (r268996) > +++ head/lib/libc/stdio/ftell.c Tue Jul 22 22:49:37 2014 (r268997) > @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); > #include "namespace.h" > #include > #include > +#include > #include > #include > #include "un-namespace.h" > @@ -87,6 +88,7 @@ _ftello(FILE *fp, fpos_t *offset) > { > fpos_t pos; > size_t n; > + int dflags; > > if (fp->_seek == NULL) { > errno = ESPIPE; /* historic practice */ > @@ -118,6 +120,22 @@ _ftello(FILE *fp, fpos_t *offset) > if (HASUB(fp)) > pos -= fp->_r; /* Can be negative at this point. */ > } else if ((fp->_flags & __SWR) && fp->_p != NULL) { > + dflags = 0; > + if (fp->_flags & __SAPP) > + dflags = O_APPEND; > + else if (fp->_file != -1 && > + (dflags = _fcntl(fp->_file, F_GETFL)) < 0) > + return (1); > + if ((dflags & O_APPEND) && > + (pos = _sseek(fp, (fpos_t)0, SEEK_END)) == -1) { > + if ((fp->_flags & __SOPT) || __sflush(fp) || > + (pos = _sseek(fp, (fpos_t)0, SEEK_CUR)) == -1) > + return (1); > + else { > + *offset = pos; > + return (0); > + } > + } > /* > * Writing. Any buffered characters cause the > * position to be greater than that in the > From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 22:57:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 705F4567; Tue, 22 Jul 2014 22:57:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E56D2102; Tue, 22 Jul 2014 22:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MMvRtt054937; Tue, 22 Jul 2014 22:57:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MMvR4O054936; Tue, 22 Jul 2014 22:57:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407222257.s6MMvR4O054936@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 22 Jul 2014 22:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268998 - 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.18 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, 22 Jul 2014 22:57:27 -0000 Author: gavin Date: Tue Jul 22 22:57:26 2014 New Revision: 268998 URL: http://svnweb.freebsd.org/changeset/base/268998 Log: /usr/bin/sendbug and the sendbug(1) man page were part of send-pr and are no longer installed since r267486. Add them to ObsoleteFiles.inc1, which should have been done in r267486. PR: 192010 Submitted by: Vick Khera Pointyhat to: gavin MFC after: 3 days Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Jul 22 22:49:37 2014 (r268997) +++ head/ObsoleteFiles.inc Tue Jul 22 22:57:26 2014 (r268998) @@ -83,8 +83,10 @@ OLD_FILES+=usr/share/examples/cvsup/stab OLD_FILES+=usr/share/examples/cvsup/standard-supfile OLD_DIRS+=usr/share/examples/cvsup # 20140614: send-pr removal +OLD_FILES+=usr/bin/sendbug OLD_FILES+=usr/share/info/send-pr.info.gz OLD_FILES+=usr/share/man/man1/send-pr.1.gz +OLD_FILES+=usr/share/man/man1/sendbug.1.gz OLD_FILES+=etc/gnats/freefall OLD_DIRS+=etc/gnats # 20140512: new clang import which bumps version from 3.4 to 3.4.1. From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 23:10:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BADD690F; Tue, 22 Jul 2014 23:10:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5CA52216; Tue, 22 Jul 2014 23:10:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MNAExE060368; Tue, 22 Jul 2014 23:10:14 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MNACJM060347; Tue, 22 Jul 2014 23:10:12 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407222310.s6MNACJM060347@svn.freebsd.org> From: Devin Teske Date: Tue, 22 Jul 2014 23:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268999 - in head/usr.sbin/bsdconfig: examples include share share/media share/packages 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.18 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, 22 Jul 2014 23:10:14 -0000 Author: dteske Date: Tue Jul 22 23:10:12 2014 New Revision: 268999 URL: http://svnweb.freebsd.org/changeset/base/268999 Log: Add example script `add_some_packages.sh', demonstrating how to install a list of packages using the bsdconfig(8) API, providing dialog(8) based user experience (versus plain console output were you to use pkg(8) directly to install the same list of packages). Remove example script `browse_packages_ftp.sh', made obsolete because the digests.txz and packagesite.txz databases for pkg(8) are not available via FTP (HTTP only to pkg.freebsd.org SRV hosts). Update example script `browse_packages_http.sh', made to work with new pkg(8) demonstrating how to generate a local package repository. Fix a bug in `bsdconfig packages' where packages were listed twice. This fix requires pkg(8) version 1.2.7_4 or higher. NB: It is the introduction of pkg(8) 1.2.7_4 wherein I am also able to drastically reduce the generation time of package dependencies prior to the dialog display (by utilizing the new `-I' flag to pkg-rquery(8)). While here, fix a positional argument nit for f_index_initialize() of `packages/index.subr' include (the one and only argument is positional argument 1 to state the by-ref handle, indicating the variable to set in the caller's namespace; the nit I'm fixing here is that we were querying positional argument 2 for this information incorrectly; caused by a missing hunk back around SVN r257795). Fix a bug in sysrc(8) described by PR bin/187458 "sysrc(8) silently and unexpectedly bootstraps pkg". This was caused by an explicit entry in `/usr/share/bsdconfig/common.subr' (used by sysrc(8)) that called pkg(8) to populate the $PKG_ABI global (called in a way that allows implicit bootstrap of pkg(8)). The solution to which was to find every place in bsdconfig(8) that requires the $PKG_ABI global and add a layer of protection by way of introducing the new API call f_musthavepkg_init() (provided by new include, `/usr/share/bsdconfig/packages/musthavepkg.subr' intented to mirror `/usr/share/bsdconfig/mustberoot.subr'). When the $PKG_ABI global is required, you can use `f_musthavepkg_init' to cause graceful premature termination in the event that pkg(8) has not yet been bootstrapped, and thus cannot be used to populate $PKG_ABI. NB: If running interactively ($nonInteractive is NULL or unset), the f_musthavepkg_init() API call will attempt to bootstrap pkg(8), but only if the user chooses "Yes" to a Yes/No dialog confirming it is ok to bootstrap. While here, simplify an if-conditional in `media/http.subr' include to use sh(1) inline assignment-with-break. Also, fix a bug in `media/http.subr' and `media/httpproxy.subr' wherein the error messages for various HTTP failures were not finding their way to the console (needed to pass stdout to pass-thru descriptor). While here, remove the executable bit from `packages/categories.subr', `packages/index.subr', and `packages/packages.subr' includes. Fix issues where pkg(8) complains about PACKAGESITE being defined. Previously, we would set $PACKAGESITE and export it. Now we only set $PACKAGESITE for invocations of "pkg update" -- getting rid of all the spurious warnings about PACKAGESITE being deprecated (it's still used in the case of "pkg update" for simplicity versus having to configure a config-file). Remove the leading argument from invocations of f_index_initialize() in `packages/packages.subr' include. The leading argument no longer means what it used to, pre SVN r257995). PR: bin/187458 Reviewed by: nwhitehorn MFC after: 1 week X-MFC-to: stable/10, stable/9 Added: head/usr.sbin/bsdconfig/examples/add_some_packages.sh (contents, props changed) head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr (contents, props changed) Deleted: head/usr.sbin/bsdconfig/examples/browse_packages_ftp.sh Modified: head/usr.sbin/bsdconfig/examples/Makefile head/usr.sbin/bsdconfig/examples/browse_packages_http.sh head/usr.sbin/bsdconfig/include/messages.subr head/usr.sbin/bsdconfig/share/common.subr head/usr.sbin/bsdconfig/share/media/http.subr head/usr.sbin/bsdconfig/share/media/httpproxy.subr head/usr.sbin/bsdconfig/share/packages/Makefile head/usr.sbin/bsdconfig/share/packages/index.subr (contents, props changed) head/usr.sbin/bsdconfig/share/packages/packages.subr (contents, props changed) Directory Properties: head/usr.sbin/bsdconfig/share/packages/categories.subr (props changed) Modified: head/usr.sbin/bsdconfig/examples/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/examples/Makefile Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/examples/Makefile Tue Jul 22 23:10:12 2014 (r268999) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/examples/bsdconfig -FILES= browse_packages_ftp.sh browse_packages_http.sh bsdconfigrc +FILES= add_some_packages.sh browse_packages_http.sh bsdconfigrc beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Added: head/usr.sbin/bsdconfig/examples/add_some_packages.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/examples/add_some_packages.sh Tue Jul 22 23:10:12 2014 (r268999) @@ -0,0 +1,13 @@ +#!/bin/sh +# $FreeBSD$ +# +# This sample installs a short list of packages from the main HTTP site. +# +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 +nonInteractive=1 +_httpPath=http://pkg.freebsd.org +mediaSetHTTP +mediaOpen +for package in wget bash rsync; do + packageAdd +done Modified: head/usr.sbin/bsdconfig/examples/browse_packages_http.sh ============================================================================== --- head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/examples/browse_packages_http.sh Tue Jul 22 23:10:12 2014 (r268999) @@ -1,25 +1,32 @@ #!/bin/sh # $FreeBSD$ # -# This sample downloads the package INDEX file from HTTP to /tmp (if it doesn't -# already exist) and then displays the package configuration/management screen -# using the local INDEX file (results in faster browsing of packages from-start -# since the INDEX can be loaded from local media). +# This sample downloads the package digests.txz and packagesite.txz files from +# HTTP to /tmp (if they don't already exist) and then displays the package +# configuration/management screen using the local files (resulting in faster +# browsing of packages from-start since digests.txz/packagesite.txz can be +# loaded from local media). # -# NOTE: Packages cannot be installed unless staged to /tmp/packages/All +# NOTE: Packages cannot be installed unless staged to +# /tmp/packages/$PKG_ABI/All # -. /usr/share/bsdconfig/script.subr +[ "$_SCRIPT_SUBR" ] || . /usr/share/bsdconfig/script.subr || exit 1 nonInteractive=1 +f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI TMPDIR=/tmp -if [ ! -e "$TMPDIR/packages/INDEX" ]; then - [ -d "$TMPDIR/packages" ] || mkdir -p "$TMPDIR/packages" || exit 1 - _httpPath=http://ftp.freebsd.org - # For older releases, use http://ftp-archive.freebsd.org - mediaSetHTTP - mediaOpen - f_show_info "Downloading packages/INDEX from\n %s" "$_httpPath" - f_device_get device_media packages/INDEX > $TMPDIR/packages/INDEX -fi +PKGDIR=$TMPDIR/packages/$PKG_ABI +[ -d "$PKGDIR" ] || mkdir -p "$PKGDIR" || exit 1 +for file in digests.txz packagesite.txz; do + [ -s "$PKGDIR/$file" ] && continue + if [ ! "$HTTP_INITIALIZED" ]; then + _httpPath=http://pkg.freebsd.org + mediaSetHTTP + mediaOpen + fi + f_show_info "Downloading %s from\n %s" "$file" "$_httpPath" + f_device_get device_media "/$PKG_ABI/latest/$file" > $PKGDIR/$file || + exit 1 +done _directoryPath=$TMPDIR mediaSetDirectory configPackages Modified: head/usr.sbin/bsdconfig/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/include/messages.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -57,6 +57,7 @@ msg_back="Back" msg_becoming_root_via_sudo="Becoming root via sudo(8)..." msg_benchmarks_desc="Utilities for measuring system performance." msg_biology_desc="Software related to biology." +msg_bootstrapping_pkg="Bootstrapping pkg(8)..." msg_brazil="Brazil" msg_building_package_menus="Building package menu(s)..." msg_cad_desc="Computer Aided Design utilities." @@ -142,8 +143,6 @@ msg_generating_index_from_pkg_database=" msg_geography_desc="Geography-related software." msg_german_desc="Ported software for Germanic countries." msg_germany="Germany" -msg_getting_package_categories_via_pkg_rquery="Getting package categories via pkg-rquery(8)..." -msg_getting_package_dependencies_via_pkg_rquery="Getting package dependencies via pkg-rquery(8)\n(this can take a while)..." msg_gnome_desc="Components of the Gnome Desktop environment." msg_gnustep_desc="Software for GNUstep desktop environment." msg_graphics_desc="Graphics libraries and utilities." @@ -219,6 +218,7 @@ msg_misc_desc="Miscellaneous utilities." msg_missing_ftp_host_or_directory="Missing FTP host or directory specification. FTP media not initialized." msg_multimedia_desc="Multimedia software." msg_must_be_root_to_execute="%s: must be root to execute" +msg_must_have_pkg_to_execute="%s: must have pkg(8) to execute" msg_must_specify_a_host_name_of_some_sort="Must specify a host name of some sort!" msg_name_server="Name server" msg_net_desc="Networking utilities." @@ -274,6 +274,7 @@ msg_perl5_desc="Utilities/modules for th msg_permission_denied="%s: %s: Permission denied" msg_pkg_delete_failed="Warning: pkg-delete(8) of %s failed.\n Run with debugging for details." msg_pkg_install_apparently_did_not_like_the_package="pkg-install(8) apparently did not like the %s package." +msg_pkg_not_yet_installed_install_now="pkg(8) not yet installed. Install now?" msg_plan9_desc="Software from the Plan9 operating system." msg_please_check_the_url_and_try_again="No such directory: %s\nplease check the URL and try again.\n" msg_please_enter_password="Please enter your password for sudo(8):" @@ -376,15 +377,13 @@ msg_unable_to_get_proper_ftp_path="Unabl msg_unable_to_initialize_media_type_for_package_extract="Unable to initialize media type for package extract." msg_unable_to_make_directory_mountpoint="Unable to make %s directory mountpoint for %s!" msg_unable_to_open="Unable to open %s" -msg_unable_to_pkg_rquery_package_categories="Unable to pkg-rquery(8) package categories!" -msg_unable_to_pkg_rquery_package_dependencies="Unable to pkg-rquery(8) package dependencies!" msg_unable_to_update_pkg_from_selected_media="Unable to update pkg(8) from selected media." msg_uninstall="Uninstall" msg_uninstall_desc="Mark this package for deletion" msg_uninstalling_package_waiting_for_pkg_delete="Uninstalling %s package - waiting for pkg-delete(8)" msg_unknown="unknown" msg_unknown_user="Unknown user: %s" -msg_url_was_not_found="%s was not found, maybe directory or release-version are wrong?" +msg_url_was_not_found="%s was not found,\nmaybe directory or release-version are wrong?" msg_usa="USA" msg_usage="Usage" msg_usb="USB" Modified: head/usr.sbin/bsdconfig/share/common.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/common.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/common.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -62,12 +62,6 @@ export UNAME_S="$( uname -s )" # Operati export UNAME_P="$( uname -p )" # Processor Architecture (i.e. i386) export UNAME_M="$( uname -m )" # Machine platform (i.e. i386) export UNAME_R="$( uname -r )" # Release Level (i.e. X.Y-RELEASE) -if [ ! "${PKG_ABI+set}" ]; then - export PKG_ABI="$( - ASSUME_ALWAYS_YES=1 pkg -vv 2> /dev/null | - awk '$1=="ABI"{print $3;exit}' - )" -fi # # Default behavior is to call f_debug_init() automatically when loaded. Modified: head/usr.sbin/bsdconfig/share/media/http.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/http.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/media/http.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -515,10 +515,7 @@ f_media_init_http() fi esac - if [ $http_found -eq $SUCCESS ]; then - HTTP_INITIALIZED=YES - break - fi + [ $http_found -eq $SUCCESS ] && HTTP_INITIALIZED=YES break f_getvar $VAR_HTTP_PATH http_path f_show_msg "$msg_please_check_the_url_and_try_again" \ @@ -668,7 +665,7 @@ f_media_get_http() 44) f_show_msg "$msg_url_was_not_found" "$url" ;; 4) f_show_msg "$msg_client_error" ;; *) f_show_msg "$msg_error_when_requesting_url" "$url" ;; - esac + esac 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD return $FAILURE } Modified: head/usr.sbin/bsdconfig/share/media/httpproxy.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/media/httpproxy.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/media/httpproxy.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -452,7 +452,7 @@ f_media_get_http_proxy() 44) f_show_msg "$msg_url_was_not_found" "$url" ;; 4) f_show_msg "$msg_client_error" ;; *) f_show_msg "$msg_error_when_requesting_url" "$url" ;; - esac + esac 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD return $FAILURE } Modified: head/usr.sbin/bsdconfig/share/packages/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/Makefile Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/packages/Makefile Tue Jul 22 23:10:12 2014 (r268999) @@ -3,7 +3,7 @@ NO_OBJ= FILESDIR= ${SHAREDIR}/bsdconfig/packages -FILES= categories.subr index.subr packages.subr +FILES= categories.subr index.subr musthavepkg.subr packages.subr beforeinstall: mkdir -p ${DESTDIR}${FILESDIR} Modified: head/usr.sbin/bsdconfig/share/packages/index.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/index.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/packages/index.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -33,6 +33,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" f_dprintf "%s: loading includes..." packages/index.subr f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/common.subr +f_include $BSDCFG_SHARE/packages/musthavepkg.subr f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" @@ -53,27 +54,6 @@ SQLITE_REPO="/var/db/pkg/repo-packagesit # PACKAGES_INDEX_CACHEFILE="/var/run/bsdconfig/packages_INDEX.cache" -# -# INDEX format for FreeBSD-6.0 or higher: -# -# package|port-origin|install-prefix|comment|port-desc-file|maintainer| -# categories|build-deps|run-deps|www-site|reserve|reserve|reserve|disc -# -INDEX_FORMAT="%n-%v" # package -INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o" # port-origin -INDEX_FORMAT="$INDEX_FORMAT|%p" # install-prefix -INDEX_FORMAT="$INDEX_FORMAT|%c" # comment -INDEX_FORMAT="$INDEX_FORMAT|/usr/ports/%o/pkg-descr" # port-desc-file -INDEX_FORMAT="$INDEX_FORMAT|%m" # maintainer -INDEX_FORMAT="$INDEX_FORMAT|@CATEGORIES@" # place-holder -INDEX_FORMAT="$INDEX_FORMAT|" # build-deps -INDEX_FORMAT="$INDEX_FORMAT|@RUNDEPS@" # place-holder -INDEX_FORMAT="$INDEX_FORMAT|%w" # www-site -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # reserved -INDEX_FORMAT="$INDEX_FORMAT|" # disc - ############################################################ FUNCTIONS # f_index_initialize [$var_to_set] @@ -87,13 +67,16 @@ INDEX_FORMAT="$INDEX_FORMAT|" # disc f_index_initialize() { local __funcname=f_index_initialize - local __var_to_set="${2:-PACKAGE_INDEX}" + local __var_to_set="${1:-PACKAGE_INDEX}" [ "$_INDEX_INITTED" ] && return $SUCCESS # Got any media? f_media_verify || return $FAILURE + # Make sure we have a usable pkg(8) with $PKG_ABI + f_musthavepkg_init + # Does it move when you kick it? f_device_init device_media || return $FAILURE @@ -126,9 +109,10 @@ f_index_initialize() __site="file://$MOUNTPOINT/packages/$PKG_ABI" esac - export PACKAGESITE="$__site" - f_dprintf "PACKAGESITE=[%s]" "$PACKAGESITE" - if ! f_eval_catch $__funcname pkg "pkg update"; then + f_dprintf "PACKAGESITE=[%s]" "$__site" + if ! f_eval_catch $__funcname pkg \ + 'PACKAGESITE="%s" pkg update' "$__site" + then f_show_err "$msg_unable_to_update_pkg_from_selected_media" f_device_shutdown device_media return $FAILURE @@ -195,53 +179,8 @@ f_index_initialize() # If we reach this point, we need to generate the data from scratch # - f_show_info "$msg_getting_package_categories_via_pkg_rquery" - if ! eval "$( pkg rquery "%n-%v %C" | awk ' - { categories[$1] = categories[$1] " " $2 } - END { - for (package in categories) - { - cats = categories[package] - sub(/^ /, "", cats) - gsub(/[^[:alnum:]_]/, "_", package) - printf "local _%s_categories=\"%s\";\n", package, cats - } - }' )"; then - f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" - f_device_shutdown device_media - return $FAILURE - fi - - f_show_info "$msg_getting_package_dependencies_via_pkg_rquery" - if ! eval "$( pkg rquery "%n-%v %dn-%dv" | awk ' - { rundeps[$1] = rundeps[$1] " " $2 } - END { - for (package in rundeps) - { - deps = rundeps[package] - sub(/^ /, "", deps) - gsub(/[^[:alnum:]_]/, "_", package) - printf "local _%s_rundeps=\"%s\";\n", package, deps - } - }' )"; then - f_show_err "$msg_unable_to_pkg_rquery_package_dependencies" - f_device_shutdown device_media - return $FAILURE - fi - f_show_info "$msg_generating_index_from_pkg_database" - eval "$__var_to_set"='$( pkg rquery "$INDEX_FORMAT" | - while read LINE; do - package="${LINE%%|*}"; - f_str2varname "$package" varpkg; - eval f_replaceall \"\$LINE\" \"\|@CATEGORIES@\|\" \ - \"\|\$_${varpkg}_categories\|\" LINE - eval f_replaceall \"\$LINE\" \"\|@RUNDEPS@\|\" \ - \"\|\$_${varpkg}_rundeps\|\" LINE - echo "$LINE" - done - )' # always returns true (status of last item in pipe-chain) - eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )' + eval "$__var_to_set"='$( pkg rquery -I | sort )' # # Attempt to create the persistant on-disk cache Added: head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdconfig/share/packages/musthavepkg.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -0,0 +1,87 @@ +if [ ! "$_PACKAGES_MUSTHAVEPKG_SUBR" ]; then _PACKAGES_MUSTHAVEPKG_SUBR=1 +# +# Copyright (c) 2014 Devin Teske +# 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$ +# +############################################################ INCLUDES + +BSDCFG_SHARE="/usr/share/bsdconfig" +. $BSDCFG_SHARE/common.subr || exit 1 +f_dprintf "%s: loading includes..." packages/musthavepkg.subr +f_include $BSDCFG_SHARE/dialog.subr +f_include $BSDCFG_SHARE/mustberoot.subr + +############################################################ FUNCTIONS + +# f_musthavepkg_init +# +# Validate pkg(8) is installed and set $PKG_ABI global if not already set. +# Returns success unless pkg(8) is not installed and user refuses to install +# it (upon prompt when running interactively). +# +f_musthavepkg_init() +{ + local funcname=f_musthavepkg_init + local pkg_abi_awk='$1~/^ABI/{print $NF; exit}' + + if [ "$PKG_ABI" ]; then # Already set + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + f_quietly pkg -N -vv # return status (pkg(8) functional?) + return $? + fi + + # Attempt to get PKG_ABI without prematurely bootstrapping pkg(8) + if f_eval_catch -k PKG_ABI $funcname pkg \ + "pkg -N -vv | awk '%s'" "$pkg_abi_awk" + then + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + return $SUCCESS + fi + + # pkg(8) not yet bootstrapped; ask for permission unless nonInteractive + f_dialog_yesno "$msg_pkg_not_yet_installed_install_now" || + f_die 1 "$msg_must_have_pkg_to_execute" "$pgm" + + f_mustberoot_init # Have to be root to install pkg(8) + + # Bootstrap pkg(8) + f_dialog_info "$msg_bootstrapping_pkg" + f_eval_catch -k PKG_ABI $funcname pkg \ + "ASSUME_ALWAYS_YES=1 pkg -vv | awk '%s'" "$pkg_abi_awk" || + f_die 1 "$msg_must_have_pkg_to_execute" "$pgm" + + f_dprintf "PKG_ABI=[%s]" "$PKG_ABI" + export PKG_ABI + return $SUCCESS +} + +############################################################ MAIN + +f_dprintf "%s: Successfully loaded." packages/musthavepkg.subr + +fi # ! $_PACKAGES_MUSTHAVEPKG_SUBR Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/packages/packages.subr Tue Jul 22 22:57:26 2014 (r268998) +++ head/usr.sbin/bsdconfig/share/packages/packages.subr Tue Jul 22 23:10:12 2014 (r268999) @@ -36,6 +36,7 @@ f_include $BSDCFG_SHARE/device.subr f_include $BSDCFG_SHARE/media/common.subr f_include $BSDCFG_SHARE/packages/categories.subr f_include $BSDCFG_SHARE/packages/index.subr +f_include $BSDCFG_SHARE/packages/musthavepkg.subr f_include $BSDCFG_SHARE/strings.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" @@ -662,7 +663,7 @@ f_package_review() f_package_config() { # Did we get an INDEX? - f_index_initialize packages/INDEX || return $FAILURE + f_index_initialize || return $FAILURE # Creates following variables (indirectly via f_index_read()) # CATEGORY_MENU_LIST _categories_{varpkg} _rundeps_{varpkg} # PACKAGE_CATEGORIES _npkgs @@ -839,7 +840,7 @@ f_package_add() { # Verify and initialize device media if-defined f_media_verify && f_device_init device_media && - f_index_initialize packages/INDEX + f_index_initialize } || return $FAILURE # Now we have (indirectly via f_index_read()): @@ -946,6 +947,8 @@ f_package_extract() local device="$1" name="$2" depended="$3" local devname= + f_musthavepkg_init # Make sure we have a usable pkg(8) with $PKG_ABI + $device get name devname f_dprintf "$funcname: device=[%s] name=[%s] depended=[%s]" \ "$devname" "$name" "$depended" @@ -1065,7 +1068,7 @@ f_package_delete() { # Verify and initialize device media if-defined f_media_verify && f_device_init device_media && - f_index_initialize packages/INDEX + f_index_initialize } || return $FAILURE # Now we have (indirectly via f_index_read()): From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 23:29:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA2A2FB1; Tue, 22 Jul 2014 23:29:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9753523D8; Tue, 22 Jul 2014 23:29:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6MNTt1K069645; Tue, 22 Jul 2014 23:29:55 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6MNTtLI069643; Tue, 22 Jul 2014 23:29:55 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407222329.s6MNTtLI069643@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 22 Jul 2014 23:29:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269001 - head/lib/libc/stdio 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.18 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, 22 Jul 2014 23:29:55 -0000 Author: pfg Date: Tue Jul 22 23:29:54 2014 New Revision: 269001 URL: http://svnweb.freebsd.org/changeset/base/269001 Log: Avoid possible cast degradation. For consistency with r268985 for fputs.c, assign iov_len first, avoiding the cast to uio_resid (int in stdio) from degrading the value. We currently don't support lengths higher than INT_MAX so this change is little more than cosmetic. MFC after: 3 days Modified: head/lib/libc/stdio/fputws.c head/lib/libc/stdio/putw.c Modified: head/lib/libc/stdio/fputws.c ============================================================================== --- head/lib/libc/stdio/fputws.c Tue Jul 22 23:16:28 2014 (r269000) +++ head/lib/libc/stdio/fputws.c Tue Jul 22 23:29:54 2014 (r269001) @@ -67,7 +67,7 @@ fputws_l(const wchar_t * __restrict ws, &fp->_mbstate); if (nbytes == (size_t)-1) goto error; - iov.iov_len = uio.uio_resid = nbytes; + uio.uio_resid = iov.iov_len = nbytes; if (__sfvwrite(fp, &uio) != 0) goto error; } while (wsp != NULL); Modified: head/lib/libc/stdio/putw.c ============================================================================== --- head/lib/libc/stdio/putw.c Tue Jul 22 23:16:28 2014 (r269000) +++ head/lib/libc/stdio/putw.c Tue Jul 22 23:29:54 2014 (r269001) @@ -50,7 +50,7 @@ putw(int w, FILE *fp) struct __siov iov; iov.iov_base = &w; - iov.iov_len = uio.uio_resid = sizeof(w); + uio.uio_resid = iov.iov_len = sizeof(w); uio.uio_iov = &iov; uio.uio_iovcnt = 1; FLOCKFILE(fp); From owner-svn-src-head@FreeBSD.ORG Tue Jul 22 23:58:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5142F817; Tue, 22 Jul 2014 23:58:15 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 290F22624; Tue, 22 Jul 2014 23:58:14 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id s6MNwEpc066803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jul 2014 16:58:14 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id s6MNwDlF066802; Tue, 22 Jul 2014 16:58:13 -0700 (PDT) (envelope-from jmg) Date: Tue, 22 Jul 2014 16:58:13 -0700 From: John-Mark Gurney To: Adrian Chadd Subject: Re: svn commit: r268986 - head/sys/geom/uzip Message-ID: <20140722235813.GI43962@funkthat.com> References: <201407221730.s6MHU6Ej099771@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 22 Jul 2014 16:58:14 -0700 (PDT) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Marcel Moolenaar , "src-committers@freebsd.org" , Marcel Moolenaar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 22 Jul 2014 23:58:15 -0000 Adrian Chadd wrote this message on Tue, Jul 22, 2014 at 10:59 -0700: > On 22 July 2014 10:47, Marcel Moolenaar wrote: > > > > On Jul 22, 2014, at 10:46 AM, Adrian Chadd wrote: > > > >> Wait, which consumers failed that test? > > > > geom_vfs I presume, because the file corruption is seen with UFS. > > Interesting. > > I wonder if this is about time we bit the bullet and compiled up GEOM > modules in userland so we can run regression tests on things. Or add proper KASSERTs... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 04:28:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB079B58; Wed, 23 Jul 2014 04:28:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5DA52BBB; Wed, 23 Jul 2014 04:28:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6N4Sr1L008542; Wed, 23 Jul 2014 04:28:53 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6N4SpOM008531; Wed, 23 Jul 2014 04:28:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407230428.s6N4SpOM008531@svn.freebsd.org> From: Neel Natu Date: Wed, 23 Jul 2014 04:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269008 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm 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.18 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, 23 Jul 2014 04:28:53 -0000 Author: neel Date: Wed Jul 23 04:28:51 2014 New Revision: 269008 URL: http://svnweb.freebsd.org/changeset/base/269008 Log: Emulate instructions emitted by OpenBSD/i386 version 5.5: - CMP REG, r/m - MOV AX/EAX/RAX, moffset - MOV moffset, AX/EAX/RAX - PUSH r/m Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_instruction_emul.h head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_instruction_emul.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/mem.c head/usr.sbin/bhyve/mem.h head/usr.sbin/bhyve/task_switch.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/lib/libvmmapi/vmmapi.c Wed Jul 23 04:28:51 2014 (r269008) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -327,6 +328,16 @@ vm_get_desc(struct vmctx *ctx, int vcpu, } int +vm_get_seg_desc(struct vmctx *ctx, int vcpu, int reg, struct seg_desc *seg_desc) +{ + int error; + + error = vm_get_desc(ctx, vcpu, reg, &seg_desc->base, &seg_desc->limit, + &seg_desc->access); + return (error); +} + +int vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val) { int error; @@ -988,7 +999,7 @@ gla2gpa(struct vmctx *ctx, int vcpu, str #endif int -vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, +vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt) { uint64_t gpa; @@ -1135,3 +1146,30 @@ vm_set_intinfo(struct vmctx *ctx, int vc error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); return (error); } + +void +vm_inject_ss(struct vmctx *ctx, int vcpu, int errcode) +{ + int error; + + error = vm_inject_exception2(ctx, vcpu, IDT_SS, errcode); + assert(error == 0); +} + +void +vm_inject_ac(struct vmctx *ctx, int vcpu, int errcode) +{ + int error; + + error = vm_inject_exception2(ctx, vcpu, IDT_AC, errcode); + assert(error == 0); +} + +void +vm_inject_gp(struct vmctx *ctx, int vcpu, int errcode) +{ + int error; + + error = vm_inject_exception2(ctx, vcpu, IDT_GP, errcode); + assert(error == 0); +} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Wed Jul 23 02:55:03 2014 (r269007) +++ head/lib/libvmmapi/vmmapi.h Wed Jul 23 04:28:51 2014 (r269008) @@ -66,6 +66,8 @@ int vm_set_desc(struct vmctx *ctx, int v uint64_t base, uint32_t limit, uint32_t access); int vm_get_desc(struct vmctx *ctx, int vcpu, int reg, uint64_t *base, uint32_t *limit, uint32_t *access); +int vm_get_seg_desc(struct vmctx *ctx, int vcpu, int reg, + struct seg_desc *seg_desc); int vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val); int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval); int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, @@ -124,13 +126,18 @@ int vm_get_hpet_capabilities(struct vmct * The 'iovcnt' should be big enough to accomodate all GPA segments. * Returns 0 on success, 1 on a guest fault condition and -1 otherwise. */ -int vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, +int vm_copy_setup(struct vmctx *ctx, int vcpu, struct vm_guest_paging *pg, uint64_t gla, size_t len, int prot, struct iovec *iov, int iovcnt); void vm_copyin(struct vmctx *ctx, int vcpu, struct iovec *guest_iov, void *host_dst, size_t len); void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, struct iovec *guest_iov, size_t len); +/* Helper functions to inject exceptions */ +void vm_inject_ss(struct vmctx *ctx, int vcpu, int errcode); +void vm_inject_ac(struct vmctx *ctx, int vcpu, int errcode); +void vm_inject_gp(struct vmctx *ctx, int vcpu, int errcode); + /* Reset vcpu register state */ int vcpu_reset(struct vmctx *ctx, int vcpu); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Jul 23 02:55:03 2014 (r269007) +++ head/sys/amd64/include/vmm.h Wed Jul 23 04:28:51 2014 (r269008) @@ -114,6 +114,7 @@ struct vioapic; struct vlapic; struct vmspace; struct vm_object; +struct vm_guest_paging; struct pmap; typedef int (*vmm_init_func_t)(int ipinum); @@ -317,10 +318,41 @@ int vm_get_intinfo(struct vm *vm, int vc void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ +void vm_inject_ac(struct vm *vm, int vcpuid, int errcode); /* #AC */ +void vm_inject_ss(struct vm *vm, int vcpuid, int errcode); /* #SS */ void vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2); enum vm_reg_name vm_segment_name(int seg_encoding); +struct vm_copyinfo { + uint64_t gpa; + size_t len; + void *hva; + void *cookie; +}; + +/* + * Set up 'copyinfo[]' to copy to/from guest linear address space starting + * at 'gla' and 'len' bytes long. The 'prot' should be set to PROT_READ for + * a copyin or PROT_WRITE for a copyout. + * + * Returns 0 on success. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + * + * The 'copyinfo[]' can be passed to 'vm_copyin()' or 'vm_copyout()' only if + * the return value is 0. The 'copyinfo[]' resources should be freed by calling + * 'vm_copy_teardown()' after the copy is done. + */ +int vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, + int num_copyinfo); +void vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, + int num_copyinfo); +void vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, + void *kaddr, size_t len); +void vm_copyout(struct vm *vm, int vcpuid, const void *kaddr, + struct vm_copyinfo *copyinfo, size_t len); #endif /* KERNEL */ #define VM_MAXCPU 16 /* maximum virtual cpus */ Modified: head/sys/amd64/include/vmm_instruction_emul.h ============================================================================== --- head/sys/amd64/include/vmm_instruction_emul.h Wed Jul 23 02:55:03 2014 (r269007) +++ head/sys/amd64/include/vmm_instruction_emul.h Wed Jul 23 04:28:51 2014 (r269008) @@ -52,8 +52,8 @@ typedef int (*mem_region_write_t)(void * * s */ int vmm_emulate_instruction(void *vm, int cpuid, uint64_t gpa, struct vie *vie, - mem_region_read_t mrr, mem_region_write_t mrw, - void *mrarg); + struct vm_guest_paging *paging, mem_region_read_t mrr, + mem_region_write_t mrw, void *mrarg); int vie_update_register(void *vm, int vcpuid, enum vm_reg_name reg, uint64_t val, int size); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/sys/amd64/vmm/vmm.c Wed Jul 23 04:28:51 2014 (r269008) @@ -1235,8 +1235,8 @@ vm_handle_inst_emul(struct vm *vm, int v return (0); } - error = vmm_emulate_instruction(vm, vcpuid, gpa, vie, mread, mwrite, - retu); + error = vmm_emulate_instruction(vm, vcpuid, gpa, vie, paging, + mread, mwrite, retu); return (error); } @@ -1751,6 +1751,30 @@ vm_inject_ud(struct vm *vm, int vcpuid) vm_inject_fault(vm, vcpuid, &udf); } +void +vm_inject_ac(struct vm *vm, int vcpuid, int error_code) +{ + struct vm_exception acf = { + .vector = IDT_AC, + .error_code_valid = 1, + .error_code = error_code + }; + + vm_inject_fault(vm, vcpuid, &acf); +} + +void +vm_inject_ss(struct vm *vm, int vcpuid, int error_code) +{ + struct vm_exception ssf = { + .vector = IDT_SS, + .error_code_valid = 1, + .error_code = error_code + }; + + vm_inject_fault(vm, vcpuid, &ssf); +} + static VMM_STAT(VCPU_NMI_COUNT, "number of NMIs delivered to vcpu"); int @@ -2182,6 +2206,97 @@ vm_segment_name(int seg) return (seg_names[seg]); } +void +vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, + int num_copyinfo) +{ + int idx; + + for (idx = 0; idx < num_copyinfo; idx++) { + if (copyinfo[idx].cookie != NULL) + vm_gpa_release(copyinfo[idx].cookie); + } + bzero(copyinfo, num_copyinfo * sizeof(struct vm_copyinfo)); +} + +int +vm_copy_setup(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, + uint64_t gla, size_t len, int prot, struct vm_copyinfo *copyinfo, + int num_copyinfo) +{ + int error, idx, nused; + size_t n, off, remaining; + void *hva, *cookie; + uint64_t gpa; + + bzero(copyinfo, sizeof(struct vm_copyinfo) * num_copyinfo); + + nused = 0; + remaining = len; + while (remaining > 0) { + KASSERT(nused < num_copyinfo, ("insufficient vm_copyinfo")); + error = vmm_gla2gpa(vm, vcpuid, paging, gla, prot, &gpa); + if (error) + return (error); + off = gpa & PAGE_MASK; + n = min(remaining, PAGE_SIZE - off); + copyinfo[nused].gpa = gpa; + copyinfo[nused].len = n; + remaining -= n; + gla += n; + nused++; + } + + for (idx = 0; idx < nused; idx++) { + hva = vm_gpa_hold(vm, copyinfo[idx].gpa, copyinfo[idx].len, + prot, &cookie); + if (hva == NULL) + break; + copyinfo[idx].hva = hva; + copyinfo[idx].cookie = cookie; + } + + if (idx != nused) { + vm_copy_teardown(vm, vcpuid, copyinfo, num_copyinfo); + return (-1); + } else { + return (0); + } +} + +void +vm_copyin(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, void *kaddr, + size_t len) +{ + char *dst; + int idx; + + dst = kaddr; + idx = 0; + while (len > 0) { + bcopy(copyinfo[idx].hva, dst, copyinfo[idx].len); + len -= copyinfo[idx].len; + dst += copyinfo[idx].len; + idx++; + } +} + +void +vm_copyout(struct vm *vm, int vcpuid, const void *kaddr, + struct vm_copyinfo *copyinfo, size_t len) +{ + const char *src; + int idx; + + src = kaddr; + idx = 0; + while (len > 0) { + bcopy(src, copyinfo[idx].hva, copyinfo[idx].len); + len -= copyinfo[idx].len; + src += copyinfo[idx].len; + idx++; + } +} /* * Return the amount of in-use and wired memory for the VM. Since Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Wed Jul 23 04:28:51 2014 (r269008) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #else /* !_KERNEL */ #include #include +#include #include @@ -65,6 +66,8 @@ enum { VIE_OP_TYPE_AND, VIE_OP_TYPE_OR, VIE_OP_TYPE_TWO_BYTE, + VIE_OP_TYPE_PUSH, + VIE_OP_TYPE_CMP, VIE_OP_TYPE_LAST }; @@ -72,6 +75,7 @@ enum { #define VIE_OP_F_IMM (1 << 0) /* 16/32-bit immediate operand */ #define VIE_OP_F_IMM8 (1 << 1) /* 8-bit immediate operand */ #define VIE_OP_F_MOFFSET (1 << 2) /* 16/32/64-bit immediate moffset */ +#define VIE_OP_F_NO_MODRM (1 << 3) static const struct vie_op two_byte_opcodes[256] = { [0xB6] = { @@ -89,6 +93,10 @@ static const struct vie_op one_byte_opco .op_byte = 0x0F, .op_type = VIE_OP_TYPE_TWO_BYTE }, + [0x3B] = { + .op_byte = 0x3B, + .op_type = VIE_OP_TYPE_CMP, + }, [0x88] = { .op_byte = 0x88, .op_type = VIE_OP_TYPE_MOV, @@ -105,6 +113,16 @@ static const struct vie_op one_byte_opco .op_byte = 0x8B, .op_type = VIE_OP_TYPE_MOV, }, + [0xA1] = { + .op_byte = 0xA1, + .op_type = VIE_OP_TYPE_MOV, + .op_flags = VIE_OP_F_MOFFSET | VIE_OP_F_NO_MODRM, + }, + [0xA3] = { + .op_byte = 0xA3, + .op_type = VIE_OP_TYPE_MOV, + .op_flags = VIE_OP_F_MOFFSET | VIE_OP_F_NO_MODRM, + }, [0xC6] = { /* XXX Group 11 extended opcode - not just MOV */ .op_byte = 0xC6, @@ -132,6 +150,11 @@ static const struct vie_op one_byte_opco .op_type = VIE_OP_TYPE_OR, .op_flags = VIE_OP_F_IMM8, }, + [0xFF] = { + /* XXX Group 5 extended opcode - not just PUSH */ + .op_byte = 0xFF, + .op_type = VIE_OP_TYPE_PUSH, + } }; /* struct vie.mod */ @@ -284,6 +307,53 @@ vie_update_register(void *vm, int vcpuid return (error); } +/* + * Return the status flags that would result from doing (x - y). + */ +static u_long +getcc16(uint16_t x, uint16_t y) +{ + u_long rflags; + + __asm __volatile("sub %1,%2; pushfq; popq %0" : + "=r" (rflags) : "m" (y), "r" (x)); + return (rflags); +} + +static u_long +getcc32(uint32_t x, uint32_t y) +{ + u_long rflags; + + __asm __volatile("sub %1,%2; pushfq; popq %0" : + "=r" (rflags) : "m" (y), "r" (x)); + return (rflags); +} + +static u_long +getcc64(uint64_t x, uint64_t y) +{ + u_long rflags; + + __asm __volatile("sub %1,%2; pushfq; popq %0" : + "=r" (rflags) : "m" (y), "r" (x)); + return (rflags); +} + +static u_long +getcc(int opsize, uint64_t x, uint64_t y) +{ + KASSERT(opsize == 2 || opsize == 4 || opsize == 8, + ("getcc: invalid operand size %d", opsize)); + + if (opsize == 2) + return (getcc16(x, y)); + else if (opsize == 4) + return (getcc32(x, y)); + else + return (getcc64(x, y)); +} + static int emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, mem_region_read_t memread, mem_region_write_t memwrite, void *arg) @@ -346,6 +416,32 @@ emulate_mov(void *vm, int vcpuid, uint64 error = vie_update_register(vm, vcpuid, reg, val, size); } break; + case 0xA1: + /* + * MOV from seg:moffset to AX/EAX/RAX + * A1: mov AX, moffs16 + * A1: mov EAX, moffs32 + * REX.W + A1: mov RAX, moffs64 + */ + error = memread(vm, vcpuid, gpa, &val, size, arg); + if (error == 0) { + reg = VM_REG_GUEST_RAX; + error = vie_update_register(vm, vcpuid, reg, val, size); + } + break; + case 0xA3: + /* + * MOV from AX/EAX/RAX to seg:moffset + * A3: mov moffs16, AX + * A3: mov moffs32, EAX + * REX.W + A3: mov moffs64, RAX + */ + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RAX, &val); + if (error == 0) { + val &= size2mask[size]; + error = memwrite(vm, vcpuid, gpa, val, size, arg); + } + break; case 0xC6: /* * MOV from imm8 to mem (ModRM:r/m) @@ -553,10 +649,150 @@ emulate_or(void *vm, int vcpuid, uint64_ return (error); } +#define RFLAGS_STATUS_BITS (PSL_C | PSL_PF | PSL_AF | PSL_Z | PSL_N | PSL_V) + +static int +emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, + mem_region_read_t memread, mem_region_write_t memwrite, void *arg) +{ + int error, size; + uint64_t op1, op2, rflags, rflags2; + enum vm_reg_name reg; + + size = vie->opsize; + switch (vie->op.op_byte) { + case 0x3B: + /* + * 3B/r CMP r16, r/m16 + * 3B/r CMP r32, r/m32 + * REX.W + 3B/r CMP r64, r/m64 + * + * Compare first operand (reg) with second operand (r/m) and + * set status flags in EFLAGS register. The comparison is + * performed by subtracting the second operand from the first + * operand and then setting the status flags. + */ + + /* Get the first operand */ + reg = gpr_map[vie->reg]; + error = vie_read_register(vm, vcpuid, reg, &op1); + if (error) + return (error); + + /* Get the second operand */ + error = memread(vm, vcpuid, gpa, &op2, size, arg); + if (error) + return (error); + + break; + default: + return (EINVAL); + } + rflags2 = getcc(size, op1, op2); + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, &rflags); + if (error) + return (error); + rflags &= ~RFLAGS_STATUS_BITS; + rflags |= rflags2 & RFLAGS_STATUS_BITS; + + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, rflags, 8); + return (error); +} + +static int +emulate_push(void *vm, int vcpuid, uint64_t mmio_gpa, struct vie *vie, + struct vm_guest_paging *paging, mem_region_read_t memread, + mem_region_write_t memwrite, void *arg) +{ +#ifdef _KERNEL + struct vm_copyinfo copyinfo[2]; +#else + struct iovec copyinfo[2]; +#endif + struct seg_desc ss_desc; + uint64_t cr0, rflags, rsp, stack_gla, val; + int error, size, stackaddrsize; + + /* + * Table A-6, "Opcode Extensions", Intel SDM, Vol 2. + * + * PUSH is part of the group 5 extended opcodes and is identified + * by ModRM:reg = b110. + */ + if ((vie->reg & 7) != 6) + return (EINVAL); + + size = vie->opsize; + /* + * From "Address-Size Attributes for Stack Accesses", Intel SDL, Vol 1 + */ + if (paging->cpu_mode == CPU_MODE_REAL) + stackaddrsize = 2; + else if (paging->cpu_mode == CPU_MODE_64BIT) + stackaddrsize = 8; + else { + /* + * In protected or compability mode the 'B' flag in the + * stack-segment descriptor determines the size of the + * stack pointer. + */ + error = vm_get_seg_desc(vm, vcpuid, VM_REG_GUEST_SS, &ss_desc); + KASSERT(error == 0, ("%s: error %d getting SS descriptor", + __func__, error)); + if (SEG_DESC_DEF32(ss_desc.access)) + stackaddrsize = 4; + else + stackaddrsize = 2; + } + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_CR0, &cr0); + KASSERT(error == 0, ("%s: error %d getting cr0", __func__, error)); + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RFLAGS, &rflags); + KASSERT(error == 0, ("%s: error %d getting rflags", __func__, error)); + + error = vie_read_register(vm, vcpuid, VM_REG_GUEST_RSP, &rsp); + KASSERT(error == 0, ("%s: error %d getting rsp", __func__, error)); + + rsp -= size; + if (vie_calculate_gla(paging->cpu_mode, VM_REG_GUEST_SS, &ss_desc, + rsp, size, stackaddrsize, PROT_WRITE, &stack_gla)) { + vm_inject_ss(vm, vcpuid, 0); + return (0); + } + + if (vie_canonical_check(paging->cpu_mode, stack_gla)) { + vm_inject_ss(vm, vcpuid, 0); + return (0); + } + + if (vie_alignment_check(paging->cpl, size, cr0, rflags, stack_gla)) { + vm_inject_ac(vm, vcpuid, 0); + return (0); + } + + error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, PROT_WRITE, + copyinfo, nitems(copyinfo)); + if (error) + return (error); + + error = memread(vm, vcpuid, mmio_gpa, &val, size, arg); + if (error == 0) { + vm_copyout(vm, vcpuid, &val, copyinfo, size); + error = vie_update_register(vm, vcpuid, VM_REG_GUEST_RSP, rsp, + stackaddrsize); + KASSERT(error == 0, ("error %d updating rsp", error)); + } +#ifdef _KERNEL + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); +#endif + return (error); +} + int vmm_emulate_instruction(void *vm, int vcpuid, uint64_t gpa, struct vie *vie, - mem_region_read_t memread, mem_region_write_t memwrite, - void *memarg) + struct vm_guest_paging *paging, mem_region_read_t memread, + mem_region_write_t memwrite, void *memarg) { int error; @@ -564,6 +800,14 @@ vmm_emulate_instruction(void *vm, int vc return (EINVAL); switch (vie->op.op_type) { + case VIE_OP_TYPE_PUSH: + error = emulate_push(vm, vcpuid, gpa, vie, paging, memread, + memwrite, memarg); + break; + case VIE_OP_TYPE_CMP: + error = emulate_cmp(vm, vcpuid, gpa, vie, + memread, memwrite, memarg); + break; case VIE_OP_TYPE_MOV: error = emulate_mov(vm, vcpuid, gpa, vie, memread, memwrite, memarg); @@ -970,45 +1214,24 @@ fault: } int -vmm_fetch_instruction(struct vm *vm, int cpuid, struct vm_guest_paging *paging, +vmm_fetch_instruction(struct vm *vm, int vcpuid, struct vm_guest_paging *paging, uint64_t rip, int inst_length, struct vie *vie) { - int n, error, prot; - uint64_t gpa, off; - void *hpa, *cookie; + struct vm_copyinfo copyinfo[2]; + int error, prot; - /* - * XXX cache previously fetched instructions using 'rip' as the tag - */ - - prot = VM_PROT_READ | VM_PROT_EXECUTE; if (inst_length > VIE_INST_SIZE) panic("vmm_fetch_instruction: invalid length %d", inst_length); - /* Copy the instruction into 'vie' */ - while (vie->num_valid < inst_length) { - error = vmm_gla2gpa(vm, cpuid, paging, rip, prot, &gpa); - if (error) - return (error); - - off = gpa & PAGE_MASK; - n = min(inst_length - vie->num_valid, PAGE_SIZE - off); - - if ((hpa = vm_gpa_hold(vm, gpa, n, prot, &cookie)) == NULL) - break; - - bcopy(hpa, &vie->inst[vie->num_valid], n); - - vm_gpa_release(cookie); - - rip += n; - vie->num_valid += n; + prot = PROT_READ | PROT_EXEC; + error = vm_copy_setup(vm, vcpuid, paging, rip, inst_length, prot, + copyinfo, nitems(copyinfo)); + if (error == 0) { + vm_copyin(vm, vcpuid, copyinfo, vie->inst, inst_length); + vm_copy_teardown(vm, vcpuid, copyinfo, nitems(copyinfo)); + vie->num_valid = inst_length; } - - if (vie->num_valid == inst_length) - return (0); - else - return (-1); + return (error); } static int @@ -1138,6 +1361,9 @@ decode_modrm(struct vie *vie, enum vm_cp if (cpu_mode == CPU_MODE_REAL) return (-1); + if (vie->op.op_flags & VIE_OP_F_NO_MODRM) + return (0); + if (vie_peek(vie, &x)) return (-1); @@ -1314,24 +1540,14 @@ decode_immediate(struct vie *vie) int i, n; uint8_t x; union { - char buf[8]; + char buf[4]; int8_t signed8; int16_t signed16; int32_t signed32; - int64_t signed64; } u; /* Figure out immediate operand size (if any) */ - if (vie->op.op_flags & VIE_OP_F_MOFFSET) { - /* - * Section 2.2.1.4, "Direct Memory-Offset MOVs", Intel SDM: - * The memory offset size follows the address-size of the - * instruction. Although this is treated as an immediate - * value during instruction decoding it is interpreted as - * a segment offset by the instruction emulation. - */ - vie->imm_bytes = vie->addrsize; - } else if (vie->op.op_flags & VIE_OP_F_IMM) { + if (vie->op.op_flags & VIE_OP_F_IMM) { /* * Section 2.2.1.5 "Immediates", Intel SDM: * In 64-bit mode the typical size of immediate operands @@ -1350,7 +1566,7 @@ decode_immediate(struct vie *vie) if ((n = vie->imm_bytes) == 0) return (0); - KASSERT(n == 1 || n == 2 || n == 4 || n == 8, + KASSERT(n == 1 || n == 2 || n == 4, ("%s: invalid number of immediate bytes: %d", __func__, n)); for (i = 0; i < n; i++) { @@ -1366,20 +1582,41 @@ decode_immediate(struct vie *vie) vie->immediate = u.signed8; else if (n == 2) vie->immediate = u.signed16; - else if (n == 4) - vie->immediate = u.signed32; else - vie->immediate = u.signed64; + vie->immediate = u.signed32; + return (0); +} - if (vie->op.op_flags & VIE_OP_F_MOFFSET) { - /* - * If the immediate value is going to be interpreted as a - * segment offset then undo the sign-extension above. - */ - vie->immediate &= size2mask[n]; - } +static int +decode_moffset(struct vie *vie) +{ + int i, n; + uint8_t x; + union { + char buf[8]; + uint64_t u64; + } u; + + if ((vie->op.op_flags & VIE_OP_F_MOFFSET) == 0) + return (0); + /* + * Section 2.2.1.4, "Direct Memory-Offset MOVs", Intel SDM: + * The memory offset size follows the address-size of the instruction. + */ + n = vie->addrsize; + KASSERT(n == 2 || n == 4 || n == 8, ("invalid moffset bytes: %d", n)); + + u.u64 = 0; + for (i = 0; i < n; i++) { + if (vie_peek(vie, &x)) + return (-1); + + u.buf[i] = x; + vie_advance(vie); + } + vie->displacement = u.u64; return (0); } @@ -1470,10 +1707,13 @@ vmm_decode_instruction(struct vm *vm, in if (decode_displacement(vie)) return (-1); - + if (decode_immediate(vie)) return (-1); + if (decode_moffset(vie)) + return (-1); + if (verify_inst_length(vie)) return (-1); Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/usr.sbin/bhyve/bhyverun.c Wed Jul 23 04:28:51 2014 (r269008) @@ -347,8 +347,7 @@ vmexit_rdmsr(struct vmctx *ctx, struct v fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", vme->u.msr.code, *pvcpu); if (strictmsr) { - error = vm_inject_exception2(ctx, *pvcpu, IDT_GP, 0); - assert(error == 0); + vm_inject_gp(ctx, *pvcpu, 0); return (VMEXIT_RESTART); } } @@ -374,8 +373,7 @@ vmexit_wrmsr(struct vmctx *ctx, struct v fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", vme->u.msr.code, vme->u.msr.wval, *pvcpu); if (strictmsr) { - error = vm_inject_exception2(ctx, *pvcpu, IDT_GP, 0); - assert(error == 0); + vm_inject_gp(ctx, *pvcpu, 0); return (VMEXIT_RESTART); } } @@ -484,7 +482,7 @@ vmexit_inst_emul(struct vmctx *ctx, stru stats.vmexit_inst_emul++; err = emulate_mem(ctx, *pvcpu, vmexit->u.inst_emul.gpa, - &vmexit->u.inst_emul.vie); + &vmexit->u.inst_emul.vie, &vmexit->u.inst_emul.paging); if (err) { if (err == EINVAL) { Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/usr.sbin/bhyve/inout.c Wed Jul 23 04:28:51 2014 (r269008) @@ -157,15 +157,13 @@ emulate_inout(struct vmctx *ctx, int vcp if (vie_calculate_gla(vis->paging.cpu_mode, vis->seg_name, &vis->seg_desc, index, bytes, addrsize, prot, &gla)) { - error = vm_inject_exception2(ctx, vcpu, - IDT_GP, 0); - assert(error == 0); + vm_inject_gp(ctx, vcpu, 0); retval = INOUT_RESTART; break; } - error = vm_gla2gpa(ctx, vcpu, &vis->paging, gla, bytes, - prot, iov, nitems(iov)); + error = vm_copy_setup(ctx, vcpu, &vis->paging, gla, + bytes, prot, iov, nitems(iov)); assert(error == 0 || error == 1 || error == -1); if (error) { retval = (error == 1) ? INOUT_RESTART : @@ -175,9 +173,7 @@ emulate_inout(struct vmctx *ctx, int vcp if (vie_alignment_check(vis->paging.cpl, bytes, vis->cr0, vis->rflags, gla)) { - error = vm_inject_exception2(ctx, vcpu, - IDT_AC, 0); - assert(error == 0); + vm_inject_ac(ctx, vcpu, 0); return (INOUT_RESTART); } Modified: head/usr.sbin/bhyve/mem.c ============================================================================== --- head/usr.sbin/bhyve/mem.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/usr.sbin/bhyve/mem.c Wed Jul 23 04:28:51 2014 (r269008) @@ -157,7 +157,9 @@ mem_write(void *ctx, int vcpu, uint64_t } int -emulate_mem(struct vmctx *ctx, int vcpu, uint64_t paddr, struct vie *vie) +emulate_mem(struct vmctx *ctx, int vcpu, uint64_t paddr, struct vie *vie, + struct vm_guest_paging *paging) + { struct mmio_rb_range *entry; int err; @@ -184,10 +186,10 @@ emulate_mem(struct vmctx *ctx, int vcpu, } assert(entry != NULL); - err = vmm_emulate_instruction(ctx, vcpu, paddr, vie, + err = vmm_emulate_instruction(ctx, vcpu, paddr, vie, paging, mem_read, mem_write, &entry->mr_param); pthread_rwlock_unlock(&mmio_rwlock); - + return (err); } Modified: head/usr.sbin/bhyve/mem.h ============================================================================== --- head/usr.sbin/bhyve/mem.h Wed Jul 23 02:55:03 2014 (r269007) +++ head/usr.sbin/bhyve/mem.h Wed Jul 23 04:28:51 2014 (r269008) @@ -50,7 +50,8 @@ struct mem_range { #define MEM_F_RW 0x3 void init_mem(void); -int emulate_mem(struct vmctx *, int vcpu, uint64_t paddr, struct vie *vie); +int emulate_mem(struct vmctx *, int vcpu, uint64_t paddr, struct vie *vie, + struct vm_guest_paging *paging); int register_mem(struct mem_range *memp); int register_mem_fallback(struct mem_range *memp); Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Wed Jul 23 02:55:03 2014 (r269007) +++ head/usr.sbin/bhyve/task_switch.c Wed Jul 23 04:28:51 2014 (r269008) @@ -214,7 +214,7 @@ desc_table_rw(struct vmctx *ctx, int vcp assert(error == 0); assert(limit >= SEL_LIMIT(sel)); - error = vm_gla2gpa(ctx, vcpu, paging, base + SEL_START(sel), + error = vm_copy_setup(ctx, vcpu, paging, base + SEL_START(sel), sizeof(*desc), doread ? PROT_READ : PROT_WRITE, iov, nitems(iov)); if (error == 0) { if (doread) @@ -508,9 +508,7 @@ tss32_restore(struct vmctx *ctx, int vcp */ reserved = ~maxphyaddr | 0x1E6; if (pdpte[i] & reserved) { - error = vm_inject_exception2(ctx, vcpu, - IDT_GP, 0); - assert(error == 0); + vm_inject_gp(ctx, vcpu, 0); return (VMEXIT_RESTART); } } @@ -649,12 +647,11 @@ push_errcode(struct vmctx *ctx, int vcpu } if (vie_alignment_check(paging->cpl, bytes, cr0, rflags, gla)) { - error = vm_inject_exception2(ctx, vcpu, IDT_AC, 1); - assert(error == 0); + vm_inject_ac(ctx, vcpu, 1); return (VMEXIT_RESTART); } - error = vm_gla2gpa(ctx, vcpu, paging, gla, bytes, PROT_WRITE, + error = vm_copy_setup(ctx, vcpu, paging, gla, bytes, PROT_WRITE, iov, nitems(iov)); assert(error == 0 || error == 1 || error == -1); if (error) { @@ -753,7 +750,7 @@ vmexit_task_switch(struct vmctx *ctx, st } /* Fetch the new TSS */ - error = vm_gla2gpa(ctx, vcpu, &sup_paging, nt.base, minlimit + 1, + error = vm_copy_setup(ctx, vcpu, &sup_paging, nt.base, minlimit + 1, PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov)); if (error == 1) { /* Restart vcpu execution to handle the page fault */ @@ -793,7 +790,7 @@ vmexit_task_switch(struct vmctx *ctx, st return (error); /* Get the old TSS */ - error = vm_gla2gpa(ctx, vcpu, &sup_paging, ot_base, minlimit + 1, + error = vm_copy_setup(ctx, vcpu, &sup_paging, ot_base, minlimit + 1, PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov)); if (error == 1) { /* Restart vcpu execution to handle the page fault */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 05:40:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5223E5DA; Wed, 23 Jul 2014 05:40:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F10920D5; Wed, 23 Jul 2014 05:40:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6N5eTiW040877; Wed, 23 Jul 2014 05:40:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6N5eTDS040876; Wed, 23 Jul 2014 05:40:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407230540.s6N5eTDS040876@svn.freebsd.org> From: Adrian Chadd Date: Wed, 23 Jul 2014 05:40:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269009 - 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.18 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, 23 Jul 2014 05:40:29 -0000 Author: adrian Date: Wed Jul 23 05:40:28 2014 New Revision: 269009 URL: http://svnweb.freebsd.org/changeset/base/269009 Log: Fix the igb(4) redirection table to correctly populate. This is similar to the ixgbe(4) fix. Tested: * Intel I350 gigabit adapter Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Wed Jul 23 04:28:51 2014 (r269008) +++ head/sys/dev/e1000/if_igb.c Wed Jul 23 05:40:28 2014 (r269009) @@ -4569,12 +4569,8 @@ igb_initialise_rss_mapping(struct adapte struct e1000_hw *hw = &adapter->hw; int i; int queue_id; - + u32 reta; u32 rss_key[10], mrqc, shift = 0; - union igb_reta { - u32 dword; - u8 bytes[4]; - } reta; /* XXX? */ if (adapter->hw.mac.type == e1000_82575) @@ -4594,6 +4590,7 @@ igb_initialise_rss_mapping(struct adapte */ /* Warning FM follows */ + reta = 0; for (i = 0; i < 128; i++) { #ifdef RSS queue_id = rss_get_indirection_to_bucket(i); @@ -4614,14 +4611,21 @@ igb_initialise_rss_mapping(struct adapte #else queue_id = (i % adapter->num_queues); #endif - reta.bytes[i & 3] = queue_id << shift; + /* Adjust if required */ + queue_id = queue_id << shift; - if ((i & 3) == 3) - E1000_WRITE_REG(hw, - E1000_RETA(i >> 2), reta.dword); + /* + * The low 8 bits are for hash value (n+0); + * The next 8 bits are for hash value (n+1), etc. + */ + reta = reta >> 8; + reta = reta | ( ((uint32_t) queue_id) << 24); + if ((i & 3) == 3) { + E1000_WRITE_REG(hw, E1000_RETA(i >> 2), reta); + reta = 0; + } } - /* Now fill in hash table */ /* XXX This means RSS enable + 8 queues for my igb (82580.) */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 14:57:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FB0EE37; Wed, 23 Jul 2014 14:57:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CFC62633; Wed, 23 Jul 2014 14:57:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NEvFE9003235; Wed, 23 Jul 2014 14:57:15 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NEvFDZ003234; Wed, 23 Jul 2014 14:57:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407231457.s6NEvFDZ003234@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 23 Jul 2014 14:57:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269015 - head/lib/libutil 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.18 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, 23 Jul 2014 14:57:15 -0000 Author: pfg Date: Wed Jul 23 14:57:15 2014 New Revision: 269015 URL: http://svnweb.freebsd.org/changeset/base/269015 Log: fparseln(3): Update from NetBSD sources. -fix a condition so that fparseln() doesn't report spurious empty lines eg after 2 comment lines, or on EOF after a single comment line -no escape character means no escaped characters modify the previous fix so that no pointless realloc()s are done in the case of multiple empty continuation lines, and comment the code to make the logics obvious fparseln is now part of libc in NetBSD so this changes the previous revision numbering. Obtained from: NetBSD (CVS Rev. 1.6-1.7) MFC after: 2 weeks Modified: head/lib/libutil/fparseln.c Modified: head/lib/libutil/fparseln.c ============================================================================== --- head/lib/libutil/fparseln.c Wed Jul 23 14:30:58 2014 (r269014) +++ head/lib/libutil/fparseln.c Wed Jul 23 14:57:15 2014 (r269015) @@ -1,4 +1,4 @@ -/* $NetBSD: fparseln.c,v 1.9 1999/09/20 04:48:06 lukem Exp $ */ +/* $NetBSD: fparseln.c,v 1.7 2007/03/08 19:57:53 drochner Exp $ */ /* * Copyright (c) 1997 Christos Zoulas. All rights reserved. @@ -59,7 +59,7 @@ isescaped(const char *sp, const char *p, /* No escape character */ if (esc == '\0') - return 1; + return 0; /* Count the number of escape characters that precede ours */ for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++) @@ -135,13 +135,19 @@ fparseln(FILE *fp, size_t *size, size_t cp = &ptr[s - 1]; if (*cp == con && !isescaped(ptr, cp, esc)) { - s--; /* forget escape */ + s--; /* forget continuation char */ cnt = 1; } } - if (s == 0 && buf != NULL) - continue; + if (s == 0) { + /* + * nothing to add, skip realloc except in case + * we need a minimal buf to return an empty line + */ + if (cnt || buf != NULL) + continue; + } if ((cp = realloc(buf, len + s + 1)) == NULL) { free(buf); From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 15:12:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 136812F1; Wed, 23 Jul 2014 15:12:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00C552844; Wed, 23 Jul 2014 15:12:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NFCHIE012088; Wed, 23 Jul 2014 15:12:17 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NFCHo9012087; Wed, 23 Jul 2014 15:12:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407231512.s6NFCHo9012087@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 23 Jul 2014 15:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269016 - head/lib/libedit/TEST 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.18 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, 23 Jul 2014 15:12:18 -0000 Author: pfg Date: Wed Jul 23 15:12:17 2014 New Revision: 269016 URL: http://svnweb.freebsd.org/changeset/base/269016 Log: Fix mismatch. MFC after: 3 days Modified: head/lib/libedit/TEST/tc1.c Modified: head/lib/libedit/TEST/tc1.c ============================================================================== --- head/lib/libedit/TEST/tc1.c Wed Jul 23 14:57:15 2014 (r269015) +++ head/lib/libedit/TEST/tc1.c Wed Jul 23 15:12:17 2014 (r269016) @@ -269,7 +269,7 @@ main(int argc, char *argv[]) } else if (el_parse(el, ac, av) == -1) { switch (fork()) { case 0: - execvp(av[0], __DECONST(char *const *, av)); + execvp(av[0], __DECONST(char **, av)); perror(av[0]); _exit(1); /*NOTREACHED*/ From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 15:53:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D932C14; Wed, 23 Jul 2014 15:53:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 702C02C17; Wed, 23 Jul 2014 15:53:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NFrU6F030177; Wed, 23 Jul 2014 15:53:30 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NFrTeJ030173; Wed, 23 Jul 2014 15:53:29 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201407231553.s6NFrTeJ030173@svn.freebsd.org> From: Roger Pau Monné Date: Wed, 23 Jul 2014 15:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269017 - in head/sys: amd64/acpica amd64/amd64 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.18 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, 23 Jul 2014 15:53:30 -0000 Author: royger Date: Wed Jul 23 15:53:29 2014 New Revision: 269017 URL: http://svnweb.freebsd.org/changeset/base/269017 Log: don't set CR4 PSE bit on amd64 Setting PSE together with PAE or in long mode just makes the PSE bit completely ignored, so don't set it. Sponsored by: Citrix Systems R&D Reviewed by: kib Modified: head/sys/amd64/acpica/acpi_wakecode.S head/sys/amd64/amd64/mpboot.S head/sys/amd64/amd64/pmap.c head/sys/boot/i386/libi386/amd64_tramp.S Modified: head/sys/amd64/acpica/acpi_wakecode.S ============================================================================== --- head/sys/amd64/acpica/acpi_wakecode.S Wed Jul 23 15:12:17 2014 (r269016) +++ head/sys/amd64/acpica/acpi_wakecode.S Wed Jul 23 15:53:29 2014 (r269017) @@ -148,9 +148,9 @@ wakeup_32: mov $bootdata32 - bootgdt, %eax mov %ax, %ds - /* Turn on the PAE and PSE bits for when paging is enabled */ + /* Turn on the PAE bit for when paging is enabled */ mov %cr4, %eax - orl $(CR4_PAE | CR4_PSE), %eax + orl $CR4_PAE, %eax mov %eax, %cr4 /* Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Wed Jul 23 15:12:17 2014 (r269016) +++ head/sys/amd64/amd64/mpboot.S Wed Jul 23 15:53:29 2014 (r269017) @@ -90,9 +90,9 @@ protmode: mov $bootdata-gdt, %eax mov %ax, %ds - /* Turn on the PAE, PSE and PGE bits for when paging is enabled */ + /* Turn on the PAE bit for when paging is enabled */ mov %cr4, %eax - orl $(CR4_PAE | CR4_PSE), %eax + orl $CR4_PAE, %eax mov %eax, %cr4 /* Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jul 23 15:12:17 2014 (r269016) +++ head/sys/amd64/amd64/pmap.c Wed Jul 23 15:53:29 2014 (r269017) @@ -831,7 +831,7 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* XXX do %cr0 as well */ - load_cr4(rcr4() | CR4_PGE | CR4_PSE); + load_cr4(rcr4() | CR4_PGE); load_cr3(KPML4phys); if (cpu_stdext_feature & CPUID_STDEXT_SMEP) load_cr4(rcr4() | CR4_SMEP); Modified: head/sys/boot/i386/libi386/amd64_tramp.S ============================================================================== --- head/sys/boot/i386/libi386/amd64_tramp.S Wed Jul 23 15:12:17 2014 (r269016) +++ head/sys/boot/i386/libi386/amd64_tramp.S Wed Jul 23 15:53:29 2014 (r269017) @@ -84,7 +84,7 @@ amd64_tramp: /* Turn on PAE */ movl %cr4, %eax - orl $(CR4_PAE | CR4_PSE), %eax + orl $CR4_PAE, %eax movl %eax, %cr4 /* Set %cr3 for PT4 */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 16:18:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87CE3216; Wed, 23 Jul 2014 16:18:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 755C12E61; Wed, 23 Jul 2014 16:18:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NGIqn7040341; Wed, 23 Jul 2014 16:18:52 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NGIqwL040340; Wed, 23 Jul 2014 16:18:52 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407231618.s6NGIqwL040340@svn.freebsd.org> From: Warner Losh Date: Wed, 23 Jul 2014 16:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269018 - head/sys/fs/nandfs 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.18 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, 23 Jul 2014 16:18:52 -0000 Author: imp Date: Wed Jul 23 16:18:51 2014 New Revision: 269018 URL: http://svnweb.freebsd.org/changeset/base/269018 Log: Fix typo in comment: noone -> no one. Fix minor style(9) nits. Modified: head/sys/fs/nandfs/nandfs_vnops.c Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Wed Jul 23 15:53:29 2014 (r269017) +++ head/sys/fs/nandfs/nandfs_vnops.c Wed Jul 23 16:18:51 2014 (r269018) @@ -405,8 +405,7 @@ nandfs_lookup(struct vop_cachedlookup_ar error = ENOENT; if ((nameiop == CREATE || nameiop == RENAME) && islastcn) { - error = VOP_ACCESS(dvp, VWRITE, cred, - td); + error = VOP_ACCESS(dvp, VWRITE, cred, td); if (!error) { /* keep the component name */ cnp->cn_flags |= SAVENAME; @@ -787,9 +786,8 @@ nandfs_chown(struct vnode *vp, uid_t uid node->nn_flags |= IN_CHANGE; if ((inode->i_mode & (ISUID | ISGID)) && (ouid != uid || ogid != gid)) { - if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID, 0)) { + if (priv_check_cred(cred, PRIV_VFS_RETAINSUGID, 0)) inode->i_mode &= ~(ISUID | ISGID); - } } DPRINTF(VNCALL, ("%s: vp %p, cred %p, td %p - ret OK\n", __func__, vp, cred, td)); @@ -1006,7 +1004,7 @@ nandfs_check_possible(struct vnode *vp, return (EINVAL); } - /* Noone may write immutable files */ + /* No one may write immutable files */ if ((mode & VWRITE) && (VTON(vp)->nn_inode.i_flags & IMMUTABLE)) return (EPERM); @@ -1049,9 +1047,8 @@ nandfs_access(struct vop_access_args *ap return (error); error = nandfs_check_possible(vp, &vap, accmode); - if (error) { + if (error) return (error); - } error = nandfs_check_permitted(vp, &vap, accmode, cred); From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 16:18:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 126822EE; Wed, 23 Jul 2014 16:18:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F40C72E62; Wed, 23 Jul 2014 16:18:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NGIsec040396; Wed, 23 Jul 2014 16:18:54 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NGIsMg040395; Wed, 23 Jul 2014 16:18:54 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407231618.s6NGIsMg040395@svn.freebsd.org> From: Warner Losh Date: Wed, 23 Jul 2014 16:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269019 - head/sys/ufs/ufs 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.18 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, 23 Jul 2014 16:18:55 -0000 Author: imp Date: Wed Jul 23 16:18:54 2014 New Revision: 269019 URL: http://svnweb.freebsd.org/changeset/base/269019 Log: Simplify comment to remove multiple negative and passive voice. Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Jul 23 16:18:51 2014 (r269018) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Jul 23 16:18:54 2014 (r269019) @@ -382,8 +382,7 @@ relock: /* * If immutable bit set, nobody gets to write it. "& ~VADMIN_PERMS" - * is here, because without it, * it would be impossible for the owner - * to remove the IMMUTABLE flag. + * permits the owner of the file to remove the IMMUTABLE flag. */ if ((accmode & (VMODIFY_PERMS & ~VADMIN_PERMS)) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 16:34:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6543D66B; Wed, 23 Jul 2014 16:34:17 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 106E52FF4; Wed, 23 Jul 2014 16:34:16 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2FD4525D3A8F; Wed, 23 Jul 2014 16:34:13 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 12C3BC23E85; Wed, 23 Jul 2014 16:34:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id bBOrW0wo_-T5; Wed, 23 Jul 2014 16:34:09 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (unknown [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 18400C23E82; Wed, 23 Jul 2014 16:34:07 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r219177 - in head: . games release release/scripts From: "Bjoern A. Zeeb" In-Reply-To: <201103021439.p22EdQsU015424@svn.freebsd.org> Date: Wed, 23 Jul 2014 16:34:07 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <51E8489E-E93D-4415-8AAA-8D2BB4E4E33E@lists.zabbadoz.net> References: <201103021439.p22EdQsU015424@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 16:34:17 -0000 On 02 Mar 2011, at 14:39 , Nathan Whitehorn = wrote: > Author: nwhitehorn > Date: Wed Mar 2 14:39:26 2011 > New Revision: 219177 > URL: http://svn.freebsd.org/changeset/base/219177 >=20 > Log: > Improve the distributeworld target in Makefile.inc1 and update the = release > infrastructure to use it. make distributeworld can now be used = without > preparing its environment first and installs games into its = distribution > using the regular make distribute logic instead of post-processing = with > a script. >=20 > Also add two new targets, packageworld and packagekernel, that tar up = the > results of distributeworld and distributekernel (also new), = respectively. >=20 > Deleted: > head/release/scripts/games-make.sh > head/release/scripts/lib32-make.sh > Modified: > head/Makefile > head/Makefile.inc1 > head/games/Makefile.inc > head/release/Makefile .. > Modified: head/Makefile.inc1 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/Makefile.inc1 Wed Mar 2 13:06:47 2011 = (r219176) > +++ head/Makefile.inc1 Wed Mar 2 14:39:26 2011 = (r219177) > @@ -631,6 +631,13 @@ ITOOLS=3D [ awk cap_mkdb cat chflags chmod > =85 > @@ -653,8 +660,33 @@ distributeworld installworld: installche > done); \ > cp $$libs $$progs ${INSTALLTMP} > cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale > +.if make(distributeworld) > +.for dist in ${EXTRA_DISTRIBUTIONS} > + -mkdir ${DESTDIR}/${DISTDIR}/${dist} > + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ > + -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null > + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ > + -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null > + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ > + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null > +.endfor > + -mkdir ${DESTDIR}/${DISTDIR}/base > + ${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \ > + DESTDIR=3D${DESTDIR}/${DISTDIR}/base > +.endif > ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ > ${IMAKEENV} rm -rf ${INSTALLTMP} > +.if make(distributeworld) > +.for dist in ${EXTRA_DISTRIBUTIONS} > + find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete > +.endfor > +.endif > + > +packageworld: > +.for dist in base ${EXTRA_DISTRIBUTIONS} > + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ > + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . > +.endfor >=20 > # > # reinstall > @@ -840,6 +872,20 @@ reinstallkernel reinstallkernel.debug: i > ${CROSSENV} PATH=3D${TMPPATH} \ > ${MAKE} KERNEL=3D${INSTKERNNAME} ${.TARGET:S/kernel//} >=20 > +distributekernel distributekernel.debug: > +.if empty(INSTALLKERNEL) > + @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ > + false > +.endif > + cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ > + ${CROSSENV} PATH=3D${TMPPATH} ${MAKE} KERNEL=3D${INSTKERNNAME}= \ > + DESTDIR=3D${DESTDIR}/${DISTDIR}/kernel \ > + ${.TARGET:S/distributekernel/install/} > + > +packagekernel: > + ${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \ > + tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . > + > # > # doxygen > # This is where DISTDIR was introduced it seems. I guess it only became a = real issue for me with NO_ROOT changes I use. In addition it probably = doesn=92t help that (not on the currently observed system) I also build = world images from ports. Unfortunately this collides with: /usr/ports/Mk/bsd.port.mk:# DISTDIR - Where to search for = and store copies of original sources /usr/ports/Mk/bsd.port.mk:DISTDIR?=3D ${PORTSDIR}/distfiles That a lot of people I know have set in their environment, and done so = in a decade. Just wondering if it=92s worth avoiding the obvious by renaming it in = base? =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 16:53:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8162DF4C; Wed, 23 Jul 2014 16:53:44 +0000 (UTC) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F20521F2; Wed, 23 Jul 2014 16:53:44 +0000 (UTC) Received: from zeppelin.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s6NGe2Of010982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 23 Jul 2014 09:40:02 -0700 Message-ID: <53CFE562.1060501@freebsd.org> Date: Wed, 23 Jul 2014 09:40:02 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: "Bjoern A. Zeeb" Subject: Re: svn commit: r219177 - in head: . games release release/scripts References: <201103021439.p22EdQsU015424@svn.freebsd.org> <51E8489E-E93D-4415-8AAA-8D2BB4E4E33E@lists.zabbadoz.net> In-Reply-To: <51E8489E-E93D-4415-8AAA-8D2BB4E4E33E@lists.zabbadoz.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVb5zpU+DFAGc+6nDqNbvM87diJvl4TTgzL2lobXi9GqBfoOEH/qBY1yi8+FahM1NGVp9Yk6sPDl/FO7XSR4cloHmOyYvEu5vzk= X-Sonic-ID: C;UEVf/ocS5BGdfefV54E5FQ== M;BI6U/ocS5BGdfefV54E5FQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 16:53:44 -0000 On 07/23/14 09:34, Bjoern A. Zeeb wrote: > On 02 Mar 2011, at 14:39 , Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Wed Mar 2 14:39:26 2011 >> New Revision: 219177 >> URL: http://svn.freebsd.org/changeset/base/219177 >> >> Log: >> Improve the distributeworld target in Makefile.inc1 and update the release >> infrastructure to use it. make distributeworld can now be used without >> preparing its environment first and installs games into its distribution >> using the regular make distribute logic instead of post-processing with >> a script. >> >> Also add two new targets, packageworld and packagekernel, that tar up the >> results of distributeworld and distributekernel (also new), respectively. >> >> Deleted: >> head/release/scripts/games-make.sh >> head/release/scripts/lib32-make.sh >> Modified: >> head/Makefile >> head/Makefile.inc1 >> head/games/Makefile.inc >> head/release/Makefile > .. > >> Modified: head/Makefile.inc1 >> ============================================================================== >> --- head/Makefile.inc1 Wed Mar 2 13:06:47 2011 (r219176) >> +++ head/Makefile.inc1 Wed Mar 2 14:39:26 2011 (r219177) >> @@ -631,6 +631,13 @@ ITOOLS= [ awk cap_mkdb cat chflags chmod >> … > >> @@ -653,8 +660,33 @@ distributeworld installworld: installche >> done); \ >> cp $$libs $$progs ${INSTALLTMP} >> cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale >> +.if make(distributeworld) >> +.for dist in ${EXTRA_DISTRIBUTIONS} >> + -mkdir ${DESTDIR}/${DISTDIR}/${dist} >> + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \ >> + -p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null >> + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ >> + -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null >> + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ >> + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null >> +.endfor >> + -mkdir ${DESTDIR}/${DISTDIR}/base >> + ${_+_}cd ${.CURDIR}; ${IMAKE} distrib-dirs \ >> + DESTDIR=${DESTDIR}/${DISTDIR}/base >> +.endif >> ${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \ >> ${IMAKEENV} rm -rf ${INSTALLTMP} >> +.if make(distributeworld) >> +.for dist in ${EXTRA_DISTRIBUTIONS} >> + find ${DESTDIR}/${DISTDIR}/${dist} -empty -delete >> +.endfor >> +.endif >> + >> +packageworld: >> +.for dist in base ${EXTRA_DISTRIBUTIONS} >> + ${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \ >> + tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz . >> +.endfor >> >> # >> # reinstall >> @@ -840,6 +872,20 @@ reinstallkernel reinstallkernel.debug: i >> ${CROSSENV} PATH=${TMPPATH} \ >> ${MAKE} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//} >> >> +distributekernel distributekernel.debug: >> +.if empty(INSTALLKERNEL) >> + @echo "ERROR: No kernel \"${KERNCONF}\" to install."; \ >> + false >> +.endif >> + cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \ >> + ${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ >> + DESTDIR=${DESTDIR}/${DISTDIR}/kernel \ >> + ${.TARGET:S/distributekernel/install/} >> + >> +packagekernel: >> + ${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \ >> + tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . >> + >> # >> # doxygen >> # > This is where DISTDIR was introduced it seems. I guess it only became a real issue for me with NO_ROOT changes I use. In addition it probably doesn’t help that (not on the currently observed system) I also build world images from ports. > > Unfortunately this collides with: > > /usr/ports/Mk/bsd.port.mk:# DISTDIR - Where to search for and store copies of original sources > /usr/ports/Mk/bsd.port.mk:DISTDIR?= ${PORTSDIR}/distfiles > > That a lot of people I know have set in their environment, and done so in a decade. > > Just wondering if it’s worth avoiding the obvious by renaming it in base? > Yes, I think you're right. Could you rename it? It's used only in the scripts in this commit, so far as I know. -Nathan From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 17:22:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD440C95; Wed, 23 Jul 2014 17:22:55 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 30C9725A5; Wed, 23 Jul 2014 17:22:55 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s6NHMjrs074065 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Jul 2014 20:22:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s6NHMjrs074065 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s6NHMjAc074064; Wed, 23 Jul 2014 20:22:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Jul 2014 20:22:45 +0300 From: Konstantin Belousov To: "Pedro F. Giffuni" Subject: Re: svn commit: r268945 - in head: lib/libc/stdlib sys/sys Message-ID: <20140723172245.GJ93733@kib.kiev.ua> References: <201407211544.s6LFixKa093406@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bBEFi9hJwHdAKtec" Content-Disposition: inline In-Reply-To: <201407211544.s6LFixKa093406@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 17:22:55 -0000 --bBEFi9hJwHdAKtec Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 21, 2014 at 03:44:59PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Jul 21 15:44:59 2014 > New Revision: 268945 > URL: http://svnweb.freebsd.org/changeset/base/268945 >=20 > Log: > Fix hdestroy() compliance issue. > =20 > The hcreate(3) implementation and related functions we inherited > from NetBSD used to free() the key value, something that is not > supported by the standard implementation. > =20 > This would cause a segmentation fault when attempting to run > the examples from the opengroup and linux manpages. NetBSD > has added non-standard calls to provide the previous > behaviour but hdestroy is not very commonly used so at this > time it seems excessive to bring those to FreeBSD. > =20 > Bump the __FreeBSD_version as this is an ABI change. > =20 > Reference: > http://bugs.dragonflybsd.org/issues/1398 > =20 > MFC after: 2 weeks >=20 > Modified: > head/lib/libc/stdlib/hcreate.c > head/sys/sys/param.h >=20 > Modified: head/lib/libc/stdlib/hcreate.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/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 (r268944) > +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:44:59 2014 (r268945) > @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) > while (!SLIST_EMPTY(&table[idx])) { > ie =3D SLIST_FIRST(&table[idx]); > SLIST_REMOVE_HEAD(&table[idx], link); > - free(ie->ent.key); > free(ie); > } > } >=20 > Modified: head/sys/sys/param.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/param.h Mon Jul 21 15:26:52 2014 (r268944) > +++ head/sys/sys/param.h Mon Jul 21 15:44:59 2014 (r268945) > @@ -58,7 +58,7 @@ > * in the range 5 to 9. > */ > #undef __FreeBSD_version > -#define __FreeBSD_version 1100027 /* Master, propagated to newvers */ > +#define __FreeBSD_version 1100028 /* Master, propagated to newvers */ > =20 > /* > * __FreeBSD_kernel__ indicates that this system uses the kernel of Free= BSD, You broke the ABI. This is absolute stopper for the symversioned fundamental library. The right thing to do is to introduce a new version of hcreate() for FBSD_1= =2E4, and provide compat shims with the old behaviour for FBSD_1.0. --bBEFi9hJwHdAKtec Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTz+9kAAoJEJDCuSvBvK1BqFgP/1/mkMihsHfv5MLaU8jcTTdn x0T+tvMWSvnwSuGINHPaabBNjxCqUSmWtCqOOUXSGB/yWs8el93hRC5i6JoRdgPr z4RxEAtPW9F9P5ahKNIDdgBFi6WaxSlAWUJlz+mgXJMCSUcGkxANP3vW/zxcP9u3 PUG44pqv3BV7gM+0nxoqZkUEwh7a3fCzYO/jqYElonmIhpUJ+Dig1irXQ+AyDywD 6HEIMHgvobVrD7wr+Eb0y5MhVpznwGWOZzvbex7QWATt2Az7Sb72pmypDRiMG35Z AojAIOrGSQLOSv11t6rv++ksK9xEREjCHLDe+Sn6p1hnnDmn3CVWsKx8fNLF5yjp aa7P+j+3et5rgyeK9ZbD9BKZFXXGmo82f6wTFHPGNBnNHfFZtUSr1jjj8Z3hEF14 Q/hAtRZ2MTH7BYjJtCHxKYiJSgrvPvtJePX2fl9E2KSYpHY51xl4seb+OFMcn8V5 2DbQGryyiy6j/H1fQ9bVsjkgziXIQrSuTZkaVJKxCqrAG98UYLNsNaM+OSFsHjbV k8fkVCrfYj7IXRRflvXVxdallsM7rv4Hp9ZiLnolCjbQt5egx3PAfffsKe20Idei yKAOARPIHjEEwXzC+pHodwpf+SLiBExfxTS/0z3iF3DxdBMrIaoivgDGeFcC6Ggf Dh+qZhVj4h1GDabvac24 =BmN1 -----END PGP SIGNATURE----- --bBEFi9hJwHdAKtec-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 17:24:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A1848ED0; Wed, 23 Jul 2014 17:24:10 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 3D26425BA; Wed, 23 Jul 2014 17:24:10 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s6NHO1RW074088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Jul 2014 20:24:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s6NHO1RW074088 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s6NHO1MU074087; Wed, 23 Jul 2014 20:24:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Jul 2014 20:24:01 +0300 From: Konstantin Belousov To: Pietro Cerutti Subject: Re: svn commit: r268494 - in head: lib/libsbuf sys/kern sys/sys Message-ID: <20140723172401.GK93733@kib.kiev.ua> References: <201407101308.s6AD8pbR080041@svn.freebsd.org> <20140721090718.GC51328@ptrcrt.ch> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="v3W/iicSVFo10VrQ" Content-Disposition: inline In-Reply-To: <20140721090718.GC51328@ptrcrt.ch> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-src-committers@freebsd.org, Bryan Drewery X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 17:24:10 -0000 --v3W/iicSVFo10VrQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 21, 2014 at 11:07:18AM +0200, Pietro Cerutti wrote: > On 2014-Jul-18, 18:47, Bryan Drewery wrote: > > On 2014-07-10 08:08, Pietro Cerutti wrote: > > > Author: gahr (ports committer) > > > Date: Thu Jul 10 13:08:51 2014 > > > New Revision: 268494 > > > URL: http://svnweb.freebsd.org/changeset/base/268494 > > >=20 > > > Log: > > > Implement Short/Small String Optimization in SBUF(9) and change=20 > > > lengths and > > > positions in the API from ssize_t and int to size_t. > > >=20 > > > CR: D388 > > > Approved by: des, bapt > > >=20 > > > Modified: > > > head/lib/libsbuf/Makefile > > > head/sys/kern/subr_sbuf.c > > > head/sys/sys/sbuf.h > > >=20 > > > Modified: head/lib/libsbuf/Makefile > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/lib/libsbuf/Makefile Thu Jul 10 13:04:52 2014 (r268493) > > > +++ head/lib/libsbuf/Makefile Thu Jul 10 13:08:51 2014 (r268494) > > > @@ -4,7 +4,7 @@ LIB=3D sbuf > > > SHLIBDIR?=3D /lib > > > SRCS=3D subr_sbuf.c > > >=20 > > > -SHLIB_MAJOR =3D 6 > > > +SHLIB_MAJOR =3D 7 > > >=20 > > > SYMBOL_MAPS=3D ${.CURDIR}/Symbol.map > > > VERSION_DEF=3D ${.CURDIR}/Version.def > > >=20 > >=20 > > We have symbol versioning in libsbuf. Shouldn't need to bump the=20 > > version. Just need to add a compat function for everything. It would be= =20 > > a lot of work, but bumping for ssize_t->size_t seems gratuitous to me. >=20 > The bump was due mainly to the addition of the s_static_buf field to the > sbuf struct. So, how this invalidates the point of not breaking the ABI ? We do not bump .so version for versioned libraries. For all symbols (functions) which are affected by the change, the compat shims in the old namespace must be provided. --v3W/iicSVFo10VrQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTz++wAAoJEJDCuSvBvK1B/7IP/22/rvsIve8yhBQ/2nK6QCFI aziItiWb7HXrEQceyEGkfYzbY/ISSTQaZFvUatHwwTs+SRVr7HWsVgvmu27Jr6ne IVo+lhhNRUYWzwAmfrrdfTDQGAJMHymnp+zv0Zfi2vwZyBRcUk8BmkrKj/AQD3Mm goQBoVs6queTJ7jabD/t9kVl9xieg2p2VoD6/UZog03Kh/+oNyia9Xby9bHvEx2P 0nyeYSK8tru9nlXR5/oe7qcYN/WxneIvy8eSiN+o5cRNqP2l2okWQ1WziL00rlt+ t77DrWkJ2B1JWmpHRbRCjaPFzGxjehWC2qcvvEOZno8a6EiMsh/WOlay+GFRI+95 G/0ToY1ic/Xid5PDGvPj8k0PABPmaUyGGCs9xXjdWxedZv1tOzX5KjrH1vLZyPNw 7PSzzxDv2SYlqrcRz6lb3U7PWrhH5IufIa7mTXjT+J6IarQSCDsv75mVkhbwakob p5DCsWP75ck64PSPR/JzHVHvCJdL6u8/SPcmWB1gyvkQepIuJCUBVWQzo52y9NOS QOfNbHB69cAsQ2vXJLd0rpuHzA517colVPbYMnU2bfBw4HwsIhc2+XOy3AuxsCC3 fgX1d/jSP2TsXDrctlItShYKlN041droRSp1kcsl0/5aKru12VF2QLFfqs9Uo2Tn UQKGR0SFoIuCVwCrRyQi =edN7 -----END PGP SIGNATURE----- --v3W/iicSVFo10VrQ-- From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 17:54:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 314B5732 for ; Wed, 23 Jul 2014 17:54:51 +0000 (UTC) Received: from nm24-vm0.bullet.mail.bf1.yahoo.com (nm24-vm0.bullet.mail.bf1.yahoo.com [98.139.213.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6B4628A4 for ; Wed, 23 Jul 2014 17:54:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1406138083; bh=GAvgpswGNYsOLi5G/zYRHF1NhIK+ZaDadj0Ql0EBezE=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=a8xfiZzxCGD2ks3lLS19lZb3ylY+lxsLgyR5ln2kvnLBxLbNeTPqac3Bu0f1oOwtYVrqOUkMYrqIAq1bFf6KhRlswDg4ME4xdEw3SZZHAhgN5U9AbGZ0pveOuHJ9Lwp03XRRC3uu8+ilVztYcf0jLDo+RR0ngch/AoZNrPTXdKp0CPW0r3e/Gj/DcelIJA//qUS/QCxN5C7zHvbuDaxNBjAIifW+WQecp1Q9+ZdzjQ8M4W5ZAaa5wYz0CWfNwBmxZjiFHC80t/AtpOAF/FeCkrfJGYuG7rXbaY70/c+nMXE6xv0/OcEtGcXwNB3J+lA42KbUr7i8TRb+Dx6PgGSR7g== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=GTNP+UXiUXM6uL4W1OqlJbhuhLivBNKYPgKdPoD+mQAd5HvSVvXB796TGU1RelcY5URf8FSKBx1wjQlcKYr2uvliTGvB3VdMu0OiSb1x9YmWyJPpGsgOuugK62L4u7jwUiSQEKZ2GfQ/Qv+LmrmBynlTPOdzm+xBSJyA+qpAJSq/BLaq7vICK1mdKUBeyfPaMbSc0FTQow6BphD/ZRGmdBG7PUiEsfGQzjmjCoV0ebGPgfDO2tLQaGuMK0wXVn0EHP85lscX4uvUcfkh9EtJ1XLjUXR5k9ej11uqC3Z9njsfjRJajQp1CqvV3z+Z11AKs+36ZgVZrOZarQBEUftdrg==; Received: from [98.139.212.152] by nm24.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 17:54:43 -0000 Received: from [98.139.211.197] by tm9.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 17:54:43 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 17:54:43 -0000 X-Yahoo-Newman-Id: 591477.93540.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bOt.IYgVM1n16QhiTXGQd0hKvPvhRKn5lpPQE6cU_fbVtJD tBQ1gzbCrjCQfDb4IUP35EmWTay__F6wd0YtExvoD188AlrewFliAB3qwF7H jFteoq8oHh5cctBsCe97iAa.Ou3bSKJh0U7G3nbanRCSQjhXzW8w2jzipuwS eNnMBgPGb5W7XmN4C6JiX5xs0egQTb0di_kkjZSUmrDEiuvhX71pbVLuSEJx DrYnNrWj.FP7yllVyI0UTMplMyfApzNpXTxnowylBYdcvX7xkIB_YXrkgzKP HqyVoqHVbgzN9vDdRwB.1NPEBq1lVCDpc1rUvbDqvPCtCM0mr9r_GOwwKz_P 9xQTAfXbr1CpoJJ2vskkAc40T3JDQs65Fd8rBPAMykEd4O2gRvohXRpqfsxu dDtP_Q8EAYS4CEa8OK2FWDA37NvKQ4acme7i1UlIWFdcyru6qRB1T5gcoJIM b6BQZsr2KpG2GNScZYkF_HjyrJiKnuxPlamD9J7csjAZ0rHVWkDcW0JavyTW nbREqr8rrqP4aY9XKueYPHaQgFPIir0lGYkM28wnNTcqjvSvLHY4iXuiTbzs hO8CVEqx_lacHKYjMReCa5OUW8NSAwmajNqDUba2vwNFaXb3eZPZtRjqGz.k 4SLcZM.hYkF2NAa30BfmRwEZnyVKO1XiWuUCp3szDX6OgjvJgmicAYBiEXfp OZyss6hLU5z7s.g-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268945 - in head: lib/libc/stdlib sys/sys From: Pedro Giffuni In-Reply-To: <20140723172245.GJ93733@kib.kiev.ua> Date: Wed, 23 Jul 2014 12:54:39 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <4953747B-B2B3-4F24-A006-022AEC4DDA29@freebsd.org> References: <201407211544.s6LFixKa093406@svn.freebsd.org> <20140723172245.GJ93733@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 17:54:51 -0000 Il giorno 23/lug/2014, alle ore 12:22, Konstantin Belousov = ha scritto: > On Mon, Jul 21, 2014 at 03:44:59PM +0000, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Jul 21 15:44:59 2014 >> New Revision: 268945 >> URL: http://svnweb.freebsd.org/changeset/base/268945 >>=20 >> Log: >> Fix hdestroy() compliance issue. >>=20 >> The hcreate(3) implementation and related functions we inherited >> from NetBSD used to free() the key value, something that is not >> supported by the standard implementation. >>=20 >> This would cause a segmentation fault when attempting to run >> the examples from the opengroup and linux manpages. NetBSD >> has added non-standard calls to provide the previous >> behaviour but hdestroy is not very commonly used so at this >> time it seems excessive to bring those to FreeBSD. >>=20 >> Bump the __FreeBSD_version as this is an ABI change. >>=20 >> Reference: >> http://bugs.dragonflybsd.org/issues/1398 >>=20 >> MFC after: 2 weeks >>=20 >> Modified: >> head/lib/libc/stdlib/hcreate.c >> head/sys/sys/param.h >>=20 >> Modified: head/lib/libc/stdlib/hcreate.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/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 = (r268944) >> +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:44:59 2014 = (r268945) >> @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) >> while (!SLIST_EMPTY(&table[idx])) { >> ie =3D SLIST_FIRST(&table[idx]); >> SLIST_REMOVE_HEAD(&table[idx], link); >> - free(ie->ent.key); >> free(ie); >> } >> } >>=20 >> Modified: head/sys/sys/param.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/param.h Mon Jul 21 15:26:52 2014 = (r268944) >> +++ head/sys/sys/param.h Mon Jul 21 15:44:59 2014 = (r268945) >> @@ -58,7 +58,7 @@ >> * in the range 5 to 9. >> */ >> #undef __FreeBSD_version >> -#define __FreeBSD_version 1100027 /* Master, propagated to newvers = */ >> +#define __FreeBSD_version 1100028 /* Master, propagated to newvers = */ >>=20 >> /* >> * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, > You broke the ABI. This is absolute stopper for the symversioned > fundamental library. >=20 I thought about it for a while. Actually .. I didn=92t. The interface remains unchanged, I only fixed an = undocumented bug. I say undocumented because while he NetBSD man page did document the = bug, our man page has always claimed compliance . > The right thing to do is to introduce a new version of hcreate() for = FBSD_1.4, > and provide compat shims with the old behaviour for FBSD_1.0. hcreate() is not used in the base: all consumers (ports tree) are likely = to expect the standard behavior so this change saves them from a = segmentation fault. In the rare case of someone having developed their = code for the broken function, the worst they will see is a memory leak. A compat shim would be really ugly :(. Pedro. From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 18:04:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E72DC9F4; Wed, 23 Jul 2014 18:04:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D40BB298C; Wed, 23 Jul 2014 18:04:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NI4qCj092986; Wed, 23 Jul 2014 18:04:52 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NI4qjQ092985; Wed, 23 Jul 2014 18:04:52 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407231804.s6NI4qjQ092985@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 23 Jul 2014 18:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269020 - 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.18 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, 23 Jul 2014 18:04:53 -0000 Author: mjg Date: Wed Jul 23 18:04:52 2014 New Revision: 269020 URL: http://svnweb.freebsd.org/changeset/base/269020 Log: Cosmetic changes to unp_internalize Don't throw away the result of fget_unlocked. Move fdp increment to for loop to make it consistent with similar code elsewhere. MFC after: 1 week Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Wed Jul 23 16:18:54 2014 (r269019) +++ head/sys/kern/uipc_usrreq.c Wed Jul 23 18:04:52 2014 (r269020) @@ -1853,7 +1853,7 @@ unp_internalize(struct mbuf **controlp, struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; - int i, fd, *fdp; + int i, *fdp; void *data; socklen_t clen = control->m_len, datalen; int error, oldfds; @@ -1906,14 +1906,13 @@ unp_internalize(struct mbuf **controlp, */ fdp = data; FILEDESC_SLOCK(fdesc); - for (i = 0; i < oldfds; i++) { - fd = *fdp++; - if (fget_locked(fdesc, fd) == NULL) { + for (i = 0; i < oldfds; i++, fdp++) { + fp = fget_locked(fdesc, *fdp); + if (fp == NULL) { FILEDESC_SUNLOCK(fdesc); error = EBADF; goto out; } - fp = fdesc->fd_ofiles[fd].fde_file; if (!(fp->f_ops->fo_flags & DFLAG_PASSABLE)) { FILEDESC_SUNLOCK(fdesc); error = EOPNOTSUPP; From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 18:05:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01D18B40; Wed, 23 Jul 2014 18:05:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E31922997; Wed, 23 Jul 2014 18:05:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NI5dva093236; Wed, 23 Jul 2014 18:05:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NI5dne093235; Wed, 23 Jul 2014 18:05:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407231805.s6NI5dne093235@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 23 Jul 2014 18:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269021 - head/usr.bin/mkimg 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.18 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, 23 Jul 2014 18:05:40 -0000 Author: marcel Date: Wed Jul 23 18:05:39 2014 New Revision: 269021 URL: http://svnweb.freebsd.org/changeset/base/269021 Log: Fix builds on older FreeBSD versions and/or non-FreeBSD machines: don't use _Static_assert unconditionally. Modified: head/usr.bin/mkimg/vhd.c Modified: head/usr.bin/mkimg/vhd.c ============================================================================== --- head/usr.bin/mkimg/vhd.c Wed Jul 23 18:04:52 2014 (r269020) +++ head/usr.bin/mkimg/vhd.c Wed Jul 23 18:05:39 2014 (r269021) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include "format.h" #include "mkimg.h" +#ifndef __has_extension +#define __has_extension(x) 0 +#endif + /* * General notes: * o File is in network byte order. @@ -88,8 +92,10 @@ struct vhd_footer { uint8_t saved_state; uint8_t _reserved[427]; }; +#if __has_extension(c_static_assert) _Static_assert(sizeof(struct vhd_footer) == VHD_SECTOR_SIZE, "Wrong size for footer"); +#endif static uint32_t vhd_checksum(void *buf, size_t sz) @@ -250,8 +256,10 @@ struct vhd_dyn_header { } parent_locator[8]; char _reserved2[256]; }; +#if __has_extension(c_static_assert) _Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2, "Wrong size for header"); +#endif static int vhd_dyn_write(int fd) From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 18:54:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BA58550; Wed, 23 Jul 2014 18:54:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C8A12DCC; Wed, 23 Jul 2014 18:54:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NIsJuF015610; Wed, 23 Jul 2014 18:54:19 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NIsJfp015609; Wed, 23 Jul 2014 18:54:19 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201407231854.s6NIsJfp015609@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 23 Jul 2014 18:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269022 - 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.18 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, 23 Jul 2014 18:54:19 -0000 Author: pluknet Date: Wed Jul 23 18:54:18 2014 New Revision: 269022 URL: http://svnweb.freebsd.org/changeset/base/269022 Log: - Use Rs/Re mdoc macros. - Remove duplicate and/or redundant content. Modified: head/share/man/man9/PCBGROUP.9 Modified: head/share/man/man9/PCBGROUP.9 ============================================================================== --- head/share/man/man9/PCBGROUP.9 Wed Jul 23 18:05:39 2014 (r269021) +++ head/share/man/man9/PCBGROUP.9 Wed Jul 23 18:54:18 2014 (r269022) @@ -64,28 +64,9 @@ .Fa "struct inpcbinfo *pcbinfo" "u_int hashtype" "uint32_t hash" .Fc .Sh DESCRIPTION -PCBGROUP, or "connection groups", are based on Willman, Rixner, and Cox's -2006 USENIX paper, -.Qo -An Evaluation of Network Stack Parallelization Strategies in Modern -Operating Systems -.Qc . -.Pp -The PCBGROUP paper describes two main kind of connection groups. -The first, called ConnP-T, uses a pool of worker threads which -implement the network stack. -Serialization occurs when queuing work into and completing work from -the network stack. -No locking is required inside each worker thread. -.Pp -The second type of connection group, called ConnP-L, uses an array -of PCB groups rather than a single list. -Each PCB group is protected by its own lock. -.Pp -This implementation differs significantly from that described in the -paper, in that it attempts to introduce not just notions of affinity +This implementation introduces notions of affinity for connections and distribute work so as to reduce lock contention, -but also align those notions with hardware work distribution strategies +with hardware work distribution strategies such as RSS. In this construction, connection groups supplement, rather than replace, existing reservation tables for protocol 4-tuples, offering CPU-affine @@ -99,7 +80,7 @@ This indicates to the connection group c a particular group. This must be aligned with any hardware-offloaded distribution model, such as RSS or similar approaches taken in embedded network boards. -Wildcard sockets require special handling, as in Willman 2006, and +Wildcard sockets require special handling, as in Willmann 2006, and are shared between connection groups while being protected by group-local locks. Connection establishment and teardown can be signficantly more @@ -204,17 +185,18 @@ receive path in .Xr mbuf 9 , .Xr netisr 9 , .Xr RSS 9 +.Rs +.%A Paul Willmann +.%A Scott Rixner +.%A Alan L. Cox +.%T "An Evaluation of Network Stack Parallelization Strategies in Modern Operating Systems" +.%J "2006 USENIX Annual Technical Conference" +.%D 2006 +.%U http://www.ece.rice.edu/~willmann/pubs/paranet_usenix.pdf +.Re .Sh HISTORY PCBGROUP first appeared in .Fx 9.0 . -.Pp -The PCBGROUP implementation is inspired by Willman, Rixner, and Cox's -2006 USENIX paper, -.Qo -An Evaluation of Network Stack Parallelization Strategies in Modern -Operating Systems -.Qc : -.Li http://www.ece.rice.edu/~willmann/pubs/paranet_usenix.pdf .Sh AUTHORS .An -nosplit The PCBGROUP implementation was written by From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 19:33:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51F0F741; Wed, 23 Jul 2014 19:33:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E41E218C; Wed, 23 Jul 2014 19:33:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NJXobT034076; Wed, 23 Jul 2014 19:33:50 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NJXnNd034073; Wed, 23 Jul 2014 19:33:49 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201407231933.s6NJXnNd034073@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 23 Jul 2014 19:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269023 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 19:33:50 -0000 Author: mjg Date: Wed Jul 23 19:33:49 2014 New Revision: 269023 URL: http://svnweb.freebsd.org/changeset/base/269023 Log: Prepare fget_unlocked for reading fd table only once. Some capsicum functions accept fdp + fd and lookup fde based on that. Add variants which accept fde. Reviewed by: pjd MFC after: 1 week Modified: head/sys/kern/kern_descrip.c head/sys/kern/sys_capability.c head/sys/sys/capsicum.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jul 23 18:54:18 2014 (r269022) +++ head/sys/kern/kern_descrip.c Wed Jul 23 19:33:49 2014 (r269023) @@ -2301,6 +2301,9 @@ int fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, int needfcntl, struct file **fpp, cap_rights_t *haverightsp) { +#ifdef CAPABILITIES + struct filedescent fde; +#endif struct file *fp; u_int count; #ifdef CAPABILITIES @@ -2323,17 +2326,22 @@ fget_unlocked(struct filedesc *fdp, int * due to preemption. */ for (;;) { +#ifdef CAPABILITIES + fde = fdp->fd_ofiles[fd]; + fp = fde.fde_file; +#else fp = fdp->fd_ofiles[fd].fde_file; +#endif if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - haverights = *cap_rights(fdp, fd); + haverights = *cap_rights_fde(&fde); if (needrightsp != NULL) { error = cap_check(&haverights, needrightsp); if (error != 0) return (error); if (cap_rights_is_set(needrightsp, CAP_FCNTL)) { - error = cap_fcntl_check(fdp, fd, needfcntl); + error = cap_fcntl_check_fde(&fde, needfcntl); if (error != 0) return (error); } Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Wed Jul 23 18:54:18 2014 (r269022) +++ head/sys/kern/sys_capability.c Wed Jul 23 19:33:49 2014 (r269023) @@ -199,11 +199,19 @@ cap_rights_to_vmprot(cap_rights_t *havep * any other way, as we want to keep all capability permission evaluation in * this one file. */ + +cap_rights_t * +cap_rights_fde(struct filedescent *fde) +{ + + return (&fde->fde_rights); +} + cap_rights_t * cap_rights(struct filedesc *fdp, int fd) { - return (&fdp->fd_ofiles[fd].fde_rights); + return (cap_rights_fde(&fdp->fd_ofiles[fd])); } /* @@ -486,24 +494,31 @@ out: * Test whether a capability grants the given fcntl command. */ int -cap_fcntl_check(struct filedesc *fdp, int fd, int cmd) +cap_fcntl_check_fde(struct filedescent *fde, int cmd) { uint32_t fcntlcap; - KASSERT(fd >= 0 && fd < fdp->fd_nfiles, - ("%s: invalid fd=%d", __func__, fd)); - fcntlcap = (1 << cmd); KASSERT((CAP_FCNTL_ALL & fcntlcap) != 0, ("Unsupported fcntl=%d.", cmd)); - if ((fdp->fd_ofiles[fd].fde_fcntls & fcntlcap) != 0) + if ((fde->fde_fcntls & fcntlcap) != 0) return (0); return (ENOTCAPABLE); } int +cap_fcntl_check(struct filedesc *fdp, int fd, int cmd) +{ + + KASSERT(fd >= 0 && fd < fdp->fd_nfiles, + ("%s: invalid fd=%d", __func__, fd)); + + return (cap_fcntl_check_fde(&fdp->fd_ofiles[fd], cmd)); +} + +int sys_cap_fcntls_limit(struct thread *td, struct cap_fcntls_limit_args *uap) { struct filedesc *fdp; Modified: head/sys/sys/capsicum.h ============================================================================== --- head/sys/sys/capsicum.h Wed Jul 23 18:54:18 2014 (r269022) +++ head/sys/sys/capsicum.h Wed Jul 23 19:33:49 2014 (r269023) @@ -341,6 +341,7 @@ __END_DECLS #define IN_CAPABILITY_MODE(td) (((td)->td_ucred->cr_flags & CRED_FLAG_CAPMODE) != 0) struct filedesc; +struct filedescent; /* * Test whether a capability grants the requested rights. @@ -355,9 +356,11 @@ u_char cap_rights_to_vmprot(cap_rights_t * For the purposes of procstat(1) and similar tools, allow kern_descrip.c to * extract the rights from a capability. */ +cap_rights_t *cap_rights_fde(struct filedescent *fde); cap_rights_t *cap_rights(struct filedesc *fdp, int fd); int cap_ioctl_check(struct filedesc *fdp, int fd, u_long cmd); +int cap_fcntl_check_fde(struct filedescent *fde, int cmd); int cap_fcntl_check(struct filedesc *fdp, int fd, int cmd); #else /* !_KERNEL */ From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 19:42:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A383D06 for ; Wed, 23 Jul 2014 19:42:04 +0000 (UTC) Received: from nm9-vm0.bullet.mail.bf1.yahoo.com (nm9-vm0.bullet.mail.bf1.yahoo.com [98.139.213.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACFF52280 for ; Wed, 23 Jul 2014 19:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1406144515; bh=N8woO0UbTFbchTGYRGdH6Zoen50JiD7Ln2OydLQoSt4=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=Am8YmhmBtgZ8oH8EiKhIcDj16fnQ3SooCC7OKgVaTfnEAJcWbhssKjRlGmRoYORp04+CYA9WXG71HngzdRAvVvguNPJ9NVIc5d92GeltxVsSfIv+KPJlsZKEkj/kqQ6L+GwjzLFAEj5ZIGRnI6DPb4fZMkyHBbchFvZcdjglp3s/xBxCG28zoC88TMa+zq/U9t0nNv5MZ8iNBCWTf19m3tVHkgAsqYfBfKNgU6tQ7crOLSG6rQXHehF25E3paqHcNqn8HJgjEgQMA650he8Ju90o/zx2ZHPdQtnG2tW3439RDbB0kReX/bA/5D5ZQ5rqfgbljeL3daF8orsW5dWakA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=oeKuh0Jvi8gHsZAc8208bkXuiFWYbCF370QHIm+yhRbK2Wn2SJyctuQceQKa9UymVz3ILQna2Ygj4fKMwhSyeYmo3AU4DRnYBMD3mPVQd4cwXFOiVLYF9oYQPUL035i7kVGY6zGtYog5yEaY31MGUG3GuivvwOZ2zSZGEmF8UfLUrT+8v/5UEYwhKll4XPKeXuthDORNoNTFQtakWTM0ysO/GHr0OC/S+8Mp7KH5JjdF/G377iTDnlJfNrWMzHiP3i4h2CmmA/VzWdZaAOhWBeVyWvhjTx8NajWCgy0CjHTJkQOXUzL5AuFulARZ/toOW2hOTqDq904fZnX2iu8ICw==; Received: from [66.196.81.170] by nm9.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 19:41:55 -0000 Received: from [98.139.211.204] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 19:41:55 -0000 Received: from [127.0.0.1] by smtp213.mail.bf1.yahoo.com with NNFMP; 23 Jul 2014 19:41:55 -0000 X-Yahoo-Newman-Id: 219336.47473.bm@smtp213.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: eh0dzPEVM1mi9rCq_sR96C8xS77PQJrTXoEH.AD228n5Dg3 9YNJ4UGi763CcnadhjT6On1qfkwQXXc8pQQO0N1iw1ZYS8MANW9jkc5fy1cu b2JPL1GVr.yEz31kEipfswZzk8uHxPSsllQPyXv5bWB6tBnZe4D__hzPn.fy oqGHm0tYMW6SELJSx.4orq8k3cqGDVAm8lkXXHcliPcWzdHCKqk7ndRomral I1avbpwmfe_hDMCBTBxb2rMYzTuwQnfDyVbgwNQ7FxgJ6ABkKQuu_nk3bY2i Ji4Gy8GJMcmkXaw5jyVyE6qSmdQlR56Iw4whDBjUtE8tw.8aaD72cmQ0U7HT aCvRb1R7Q6S7_zu0mo.pvoAVpRnR.8ELYdXkaRu4X1g27rNigNI652QLB0PC _1obvblRAK0ZzvsOx3M15FmlQ2vhka.8jyIEtSWT7l_zM50WhrTDONGGlJD8 23Qbj1HnOlZF8_eRWLeB0CCa8YkYmOMOGTY_rSP0gqzadc_VkWoibIEDfDg7 kGJ_7314VVN2F2m2wMTDm1ZAxhMgsBKtRR5WDv.0yvvWIu2tJptuwnqwyHgh EAQgTxF.E78w2ZxBNVOuMu1dxcvhawInTj_eAGp1NcVn7nLHERRD4f8rGcvo - X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268945 - in head: lib/libc/stdlib sys/sys From: Pedro Giffuni In-Reply-To: <4953747B-B2B3-4F24-A006-022AEC4DDA29@freebsd.org> Date: Wed, 23 Jul 2014 14:41:52 -0500 Message-Id: References: <201407211544.s6LFixKa093406@svn.freebsd.org> <20140723172245.GJ93733@kib.kiev.ua> <4953747B-B2B3-4F24-A006-022AEC4DDA29@freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.6) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 19:42:04 -0000 Il giorno 23/lug/2014, alle ore 12:54, Pedro Giffuni = ha scritto: >=20 > Il giorno 23/lug/2014, alle ore 12:22, Konstantin Belousov = ha scritto: >=20 >> On Mon, Jul 21, 2014 at 03:44:59PM +0000, Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Mon Jul 21 15:44:59 2014 >>> New Revision: 268945 >>> URL: http://svnweb.freebsd.org/changeset/base/268945 >>>=20 >>> Log: >>> Fix hdestroy() compliance issue. >>>=20 >>> The hcreate(3) implementation and related functions we inherited >>> from NetBSD used to free() the key value, something that is not >>> supported by the standard implementation. >>>=20 >>> This would cause a segmentation fault when attempting to run >>> the examples from the opengroup and linux manpages. NetBSD >>> has added non-standard calls to provide the previous >>> behaviour but hdestroy is not very commonly used so at this >>> time it seems excessive to bring those to FreeBSD. >>>=20 >>> Bump the __FreeBSD_version as this is an ABI change. >>>=20 >>> Reference: >>> http://bugs.dragonflybsd.org/issues/1398 >>>=20 >>> MFC after: 2 weeks >>>=20 >>> Modified: >>> head/lib/libc/stdlib/hcreate.c >>> head/sys/sys/param.h >>>=20 >>> Modified: head/lib/libc/stdlib/hcreate.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/libc/stdlib/hcreate.c Mon Jul 21 15:26:52 2014 = (r268944) >>> +++ head/lib/libc/stdlib/hcreate.c Mon Jul 21 15:44:59 2014 = (r268945) >>> @@ -159,7 +159,6 @@ hdestroy_r(struct hsearch_data *head) >>> while (!SLIST_EMPTY(&table[idx])) { >>> ie =3D SLIST_FIRST(&table[idx]); >>> SLIST_REMOVE_HEAD(&table[idx], link); >>> - free(ie->ent.key); >>> free(ie); >>> } >>> } >>>=20 >>> Modified: head/sys/sys/param.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/param.h Mon Jul 21 15:26:52 2014 = (r268944) >>> +++ head/sys/sys/param.h Mon Jul 21 15:44:59 2014 = (r268945) >>> @@ -58,7 +58,7 @@ >>> * in the range 5 to 9. >>> */ >>> #undef __FreeBSD_version >>> -#define __FreeBSD_version 1100027 /* Master, propagated to newvers = */ >>> +#define __FreeBSD_version 1100028 /* Master, propagated to newvers = */ >>>=20 >>> /* >>> * __FreeBSD_kernel__ indicates that this system uses the kernel of = FreeBSD, >> You broke the ABI. This is absolute stopper for the symversioned >> fundamental library. >>=20 >=20 > I thought about it for a while. > Actually .. I didn=92t. The interface remains unchanged, I only fixed = an undocumented bug. >=20 As clarification .. I meant I didn=92t actually break the ABI ... It=92s just a bug fix and we shouldn=92t provide compatibility shims for = bugs. > I say undocumented because while he NetBSD man page did document the = bug, our man page has always claimed compliance . >=20 >> The right thing to do is to introduce a new version of hcreate() for = FBSD_1.4, >> and provide compat shims with the old behaviour for FBSD_1.0. >=20 > hcreate() is not used in the base: all consumers (ports tree) are = likely to expect the standard behavior so this change saves them from a = segmentation fault. In the rare case of someone having developed their = code for the broken function, the worst they will see is a memory leak. >=20 > A compat shim would be really ugly :(. >=20 FWIW, NetBSD provides new functions with the old behavior but hdestroy() = now conforms to standards. Things there got really ugly because they = also had that issue for the re-entrant versions. I am thinking of MFCing the fix, but not the re-entrant versions. Pedro.= From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 21:08:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44B8242D; Wed, 23 Jul 2014 21:08:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 257D52A78; Wed, 23 Jul 2014 21:08:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NL85d9077916; Wed, 23 Jul 2014 21:08:05 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NL84kW077914; Wed, 23 Jul 2014 21:08:04 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407232108.s6NL84kW077914@svn.freebsd.org> From: Devin Teske Date: Wed, 23 Jul 2014 21:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269027 - in head/usr.sbin/bsdconfig/dot: . 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.18 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, 23 Jul 2014 21:08:05 -0000 Author: dteske Date: Wed Jul 23 21:08:04 2014 New Revision: 269027 URL: http://svnweb.freebsd.org/changeset/base/269027 Log: Fix a bug where include file `networking/services.subr' was not being properly clustered. Change `fixedsize' to `fixedsize = true' to satisfy newer versions of dot(1) generating error "Warning: : syntax error in line 27 near ','". Remove bounding cluster surrounding various include-groupings, allowing groups of include files to float freely to the greatest consumer (reducing the density of rendered diagrams). While here, change the bgcolor of include clusters from white to X11 color `thistle' (a light purple). Also, add the word "Subroutines" after include cluster labels. Do not terminate the digraph definition with a semi-colon [;] after the ending brace to satisfy newer versions of dot(1) generating error "Warning: : syntax error in line 940 near ';'". MFC after: 3 days X-MFC-to: stable/10, stable/9 Modified: head/usr.sbin/bsdconfig/dot/dot head/usr.sbin/bsdconfig/dot/include/messages.subr Modified: head/usr.sbin/bsdconfig/dot/dot ============================================================================== --- head/usr.sbin/bsdconfig/dot/dot Wed Jul 23 19:38:29 2014 (r269026) +++ head/usr.sbin/bsdconfig/dot/dot Wed Jul 23 21:08:04 2014 (r269027) @@ -249,6 +249,7 @@ if [ "$SHOW_INCLUDES" ]; then $menu_program_list \ $submenu_program_list \ $cmd_program_list \ + $BSDCFG_SHARE/script.subr \ ; do [ -e "$file" ] && echo $file done | sort -u @@ -299,12 +300,6 @@ if [ "$SHOW_INCLUDES" ]; then fi # -# Add script.subr to includes if it exists -# -[ -f $BSDCFG_SHARE/script.subr ] && - include_file_list="$include_file_list script.subr" - -# # Start the directional-graph (digraph) output # printf 'strict digraph "" { // Empty name to prevent SVG Auto-Tooltip\n' @@ -352,7 +347,7 @@ printf '\tnode [\n' printf '\t\tfontname = "Times-Roman",\n' printf '\t\tfontsize = 12,\n' printf '\t\twidth = 2.5, // arbitrary minimum width for all nodes\n' -printf '\t\tfixedsize, // turn minimum width into exact width\n' +printf '\t\tfixedsize = true, // turn minimum width into exact width\n' printf '\t];\n' # @@ -546,34 +541,36 @@ printf '\t\tbgcolor = "%s";\n' "$bgcolor printf '\t\tlabel = "bsdconfig(8)";\n' printf '\t\ttooltip = "bsdconfig(8)";\n' print_node "bsdconfig" +end_nodelist if [ "$SHOW_INCLUDES" ]; then - printf '\t\tsubgraph "cluster_includes" {\n' - printf '\t\t\tbgcolor = "%s";\n' "$bgcolor_includes" - printf '\t\t\tlabel = "%s";\n' "$msg_includes" - for include_file in $include_file_list; do echo $include_file - done | awk -v bgcolor="$bgcolor_bsdconfig" ' - BEGIN { created = 0 } - function end_subgraph() { printf "\t\t\t};\n" } - ( $0 !~ "/" ) { - if ( ! created ) - { - printf "\t\t\tsubgraph \"%s\" {\n", - "cluster_bsdconfig_includes" - printf "\t\t\t\tbgcolor = \"%s\";\n", bgcolor - printf "\t\t\t\tlabel = \"bsdconfig\";\n" - created++ + done | awk \ + -v bgcolor="$bgcolor_bsdconfig" \ + -v msg_subroutines="$msg_subroutines" \ + ' + BEGIN { created = 0 } + function end_subgraph() { printf "\t};\n" } + ( $0 !~ "/" ) { + if ( ! created ) + { + printf "\tsubgraph \"%s\" {\n", + "cluster_bsdconfig_includes" + printf "\t\tbgcolor = \"%s\";\n", bgcolor + printf "\t\tlabel = \"bsdconfig %s\";\n", + msg_subroutines + created++ + } + printf "\t\t\"%s\";\n", $1 } - printf "\t\t\t\t\"%s\";\n", $1 - } - END { created && end_subgraph() }' + END { created && end_subgraph() } + ' # END-QUOTE for include_file in $include_file_list; do echo $include_file - done | awk ' + done | awk -v msg_subroutines="$msg_subroutines" ' BEGIN { created = 0 } - function end_subgraph() { printf "\t\t\t};\n" } + function end_subgraph() { printf "\t};\n" } ( $0 ~ "/" ) { include_dir_tmp = $1 sub("/[^/]*$", "", include_dir_tmp) @@ -588,20 +585,18 @@ if [ "$SHOW_INCLUDES" ]; then if ( ! created ) { include_dir = include_dir_tmp - printf "\t\t\tsubgraph \"cluster_%s_includes\" {\n", + printf "\tsubgraph \"cluster_%s_includes\" {\n", include_dir - printf "\t\t\t\tbgcolor = \"white\";\n" - printf "\t\t\t\tlabel = \"%s\";\n", include_dir + printf "\t\tbgcolor = \"thistle\";\n" + printf "\t\tlabel = \"%s %s\";\n", include_dir, + msg_subroutines created++ } - printf "\t\t\t\t\"%s\";\n", $1 + printf "\t\t\"%s\";\n", $1 } END { created && end_subgraph() }' - - printf '\t\t};\n' fi -end_nodelist for INDEX in */INDEX; do menu_title= menu_help= @@ -676,7 +671,7 @@ for INDEX in */INDEX; do end_nodelist done -printf '\n};\n' +printf '\n}\n' ################################################################################ # END Modified: head/usr.sbin/bsdconfig/dot/include/messages.subr ============================================================================== --- head/usr.sbin/bsdconfig/dot/include/messages.subr Wed Jul 23 19:38:29 2014 (r269026) +++ head/usr.sbin/bsdconfig/dot/include/messages.subr Wed Jul 23 21:08:04 2014 (r269027) @@ -28,3 +28,4 @@ msg_graph_label_with_command="bsdconfig( msg_graph_label_with_command_and_date="bsdconfig(8)\\\ndot(1) output generated by \`\`%s'' on\\\n%s" msg_includes="Includes" msg_shortcuts="Shortcuts" +msg_subroutines="Subroutines" From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 22:11:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3BF5C5B; Wed, 23 Jul 2014 22:11:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0F2A2FFB; Wed, 23 Jul 2014 22:11:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NMB4OD016231; Wed, 23 Jul 2014 22:11:04 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NMB4Bk016230; Wed, 23 Jul 2014 22:11:04 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407232211.s6NMB4Bk016230@svn.freebsd.org> From: Sean Bruno Date: Wed, 23 Jul 2014 22:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269029 - head/sys/boot/libstand32 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.18 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, 23 Jul 2014 22:11:05 -0000 Author: sbruno Date: Wed Jul 23 22:11:04 2014 New Revision: 269029 URL: http://svnweb.freebsd.org/changeset/base/269029 Log: Update so that clean target in sys/boot will delete the symlink created for machine Reviewed by: emaste Modified: head/sys/boot/libstand32/Makefile Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Wed Jul 23 22:10:34 2014 (r269028) +++ head/sys/boot/libstand32/Makefile Wed Jul 23 22:11:04 2014 (r269029) @@ -173,11 +173,9 @@ SRCS+= nandfs.c .include .if ${MACHINE_CPUARCH} == "amd64" +CLEANFILES+= machine beforedepend ${OBJS}: machine cleandepend: cleanmachine -cleanmachine: - rm -f machine - machine: - ln -s ${.CURDIR}/../../i386/include machine + ln -fs ${.CURDIR}/../../i386/include machine .endif From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 22:12:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C695FDC2; Wed, 23 Jul 2014 22:12:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3F0F2087; Wed, 23 Jul 2014 22:12:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NMC5XY017381; Wed, 23 Jul 2014 22:12:05 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NMC5Ym017380; Wed, 23 Jul 2014 22:12:05 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407232212.s6NMC5Ym017380@svn.freebsd.org> From: Sean Bruno Date: Wed, 23 Jul 2014 22:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269030 - head/sys/boot/i386/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.18 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, 23 Jul 2014 22:12:05 -0000 Author: sbruno Date: Wed Jul 23 22:12:05 2014 New Revision: 269030 URL: http://svnweb.freebsd.org/changeset/base/269030 Log: Add .NOPATH to the machine target so that builds in sys/boot work and don't error out building zfs loader. Submitted by: sjg@freebsd.org Modified: head/sys/boot/i386/loader/Makefile Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Wed Jul 23 22:11:04 2014 (r269029) +++ head/sys/boot/i386/loader/Makefile Wed Jul 23 22:12:05 2014 (r269030) @@ -134,6 +134,6 @@ LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZF beforedepend ${OBJS}: machine CLEANFILES+= machine CFLAGS+= -DLOADER_PREFER_AMD64 -machine: +machine: .NOPATH ln -sf ${.CURDIR}/../../../i386/include machine .endif From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 22:18:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5897BF9A; Wed, 23 Jul 2014 22:18:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39C6C20C8; Wed, 23 Jul 2014 22:18:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NMIiSN019516; Wed, 23 Jul 2014 22:18:44 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NMIi29019515; Wed, 23 Jul 2014 22:18:44 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407232218.s6NMIi29019515@svn.freebsd.org> From: Sean Bruno Date: Wed, 23 Jul 2014 22:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269031 - 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.18 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, 23 Jul 2014 22:18:44 -0000 Author: sbruno Date: Wed Jul 23 22:18:43 2014 New Revision: 269031 URL: http://svnweb.freebsd.org/changeset/base/269031 Log: Deprecate the use of XDEV and XDEV_ARCH and just use TARGET/TARGET_ARCH for the xdev build target, which is awesome and totally works. Reapply svn R268377 with correct name of libsupc++ here as this does resolve one dependancy race when building the xdev target. the xdev target builds for amd64, i386, mips, mips64 and armv6 with this commit, must be built as root, must be built from /usr/src, must not have a /usr/obj and places the xdev tools in /usr/$TARGET_ARCH-freebsd the xdev target still leaves some assorted files strewn about your /usr/src when this is done and needs to be investigated further. Phabric: https://phabric.freebsd.org/D385 Submitted by: bsdimp Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jul 23 22:12:05 2014 (r269030) +++ head/Makefile.inc1 Wed Jul 23 22:18:43 2014 (r269031) @@ -1366,9 +1366,6 @@ kernel-tools: .MAKE # # cross-tools: Build cross-building tools # -.if !defined(TARGET_ARCH) && defined(XDEV_ARCH) -TARGET_ARCH= ${XDEV_ARCH} -.endif .if ${TARGET_ARCH} != ${MACHINE_ARCH} .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386" _btxld= usr.sbin/btxld @@ -1497,6 +1494,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 .if ${MK_GNUCXX} != "no" _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L +gnu/lib/libsupc++__L: gnu/lib/libstdc++__L .endif .if defined(WITH_ATF) || ${MK_TESTS} != "no" @@ -1853,9 +1851,9 @@ builddtb: ############### -.if defined(XDEV) && defined(XDEV_ARCH) +.if defined(TARGET) && defined(TARGET_ARCH) -.if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH} +.if ${TARGET} == ${MACHINE} && ${TARGET_ARCH} == ${MACHINE_ARCH} XDEV_CPUTYPE?=${CPUTYPE} .else XDEV_CPUTYPE?=${TARGET_CPUTYPE} @@ -1864,10 +1862,10 @@ XDEV_CPUTYPE?=${TARGET_CPUTYPE} NOFUN=-DNO_FSCHG MK_HTML=no MK_INFO=no -DNO_LINT \ MK_MAN=no MK_NLS=no MK_PROFILE=no \ MK_KERBEROS=no MK_RESCUE=no MK_TESTS=no MK_WARNS=no \ - TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ + TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ CPUTYPE=${XDEV_CPUTYPE} -XDDIR=${XDEV_ARCH}-freebsd +XDDIR=${TARGET_ARCH}-freebsd XDTP?=/usr/${XDDIR} .if ${XDTP:N/*} .error XDTP variable should be an absolute path @@ -1883,7 +1881,7 @@ CD2CFLAGS=-isystem ${XDDESTDIR}/usr/incl -B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \ CPP="${CPP} ${CD2CFLAGS}" \ - MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH} + MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN} @@ -1982,5 +1980,5 @@ xdev-links: done .else xdev xdev-build xdev-install xdev-links: - @echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target" + @echo "*** Error: Both TARGET and TARGET_ARCH must be defined for \"${.TARGET}\" target" .endif From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 22:29:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0A1AE42D; Wed, 23 Jul 2014 22:29:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB39721B1; Wed, 23 Jul 2014 22:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NMTMbd024929; Wed, 23 Jul 2014 22:29:22 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NMTMIN024923; Wed, 23 Jul 2014 22:29:22 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407232229.s6NMTMIN024923@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 23 Jul 2014 22:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269032 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 23 Jul 2014 22:29:23 -0000 Author: np Date: Wed Jul 23 22:29:22 2014 New Revision: 269032 URL: http://svnweb.freebsd.org/changeset/base/269032 Log: cxgbe(4): Keep track of the clusters that have to be freed by the custom free routine (rxb_free) in the driver. Fail MOD_UNLOAD with EBUSY if any such cluster has been handed up to the kernel but hasn't been freed yet. This prevents a panic later when the cluster finally needs to be freed but rxb_free is gone from the kernel. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Wed Jul 23 22:18:43 2014 (r269031) +++ head/sys/dev/cxgbe/adapter.h Wed Jul 23 22:29:22 2014 (r269032) @@ -985,6 +985,8 @@ void t4_nm_intr(void *); /* t4_sge.c */ void t4_sge_modload(void); +void t4_sge_modunload(void); +uint64_t t4_sge_extfree_refs(void); void t4_init_sge_cpl_handlers(struct adapter *); void t4_tweak_chip_settings(struct adapter *); int t4_read_chip_settings(struct adapter *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Jul 23 22:18:43 2014 (r269031) +++ head/sys/dev/cxgbe/t4_main.c Wed Jul 23 22:29:22 2014 (r269032) @@ -8259,6 +8259,9 @@ tweak_tunables(void) t4_intr_types &= INTR_MSIX | INTR_MSI | INTR_INTX; } +static struct sx mlu; /* mod load unload */ +SX_SYSINIT(cxgbe_mlu, &mlu, "cxgbe mod load/unload"); + static int mod_event(module_t mod, int cmd, void *arg) { @@ -8267,41 +8270,67 @@ mod_event(module_t mod, int cmd, void *a switch (cmd) { case MOD_LOAD: - if (atomic_fetchadd_int(&loaded, 1)) - break; - t4_sge_modload(); - sx_init(&t4_list_lock, "T4/T5 adapters"); - SLIST_INIT(&t4_list); + sx_xlock(&mlu); + if (loaded++ == 0) { + t4_sge_modload(); + sx_init(&t4_list_lock, "T4/T5 adapters"); + SLIST_INIT(&t4_list); #ifdef TCP_OFFLOAD - sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); - SLIST_INIT(&t4_uld_list); + sx_init(&t4_uld_list_lock, "T4/T5 ULDs"); + SLIST_INIT(&t4_uld_list); #endif - t4_tracer_modload(); - tweak_tunables(); + t4_tracer_modload(); + tweak_tunables(); + } + sx_xunlock(&mlu); break; case MOD_UNLOAD: - if (atomic_fetchadd_int(&loaded, -1) > 1) - break; - t4_tracer_modunload(); + sx_xlock(&mlu); + if (--loaded == 0) { + int tries; + + sx_slock(&t4_list_lock); + if (!SLIST_EMPTY(&t4_list)) { + rc = EBUSY; + sx_sunlock(&t4_list_lock); + goto done_unload; + } +#ifdef TCP_OFFLOAD + sx_slock(&t4_uld_list_lock); + if (!SLIST_EMPTY(&t4_uld_list)) { + rc = EBUSY; + sx_sunlock(&t4_uld_list_lock); + sx_sunlock(&t4_list_lock); + goto done_unload; + } +#endif + tries = 0; + while (tries++ < 5 && t4_sge_extfree_refs() != 0) { + uprintf("%ju clusters with custom free routine " + "still is use.\n", t4_sge_extfree_refs()); + pause("t4unload", 2 * hz); + } #ifdef TCP_OFFLOAD - sx_slock(&t4_uld_list_lock); - if (!SLIST_EMPTY(&t4_uld_list)) { - rc = EBUSY; sx_sunlock(&t4_uld_list_lock); - break; - } - sx_sunlock(&t4_uld_list_lock); - sx_destroy(&t4_uld_list_lock); #endif - sx_slock(&t4_list_lock); - if (!SLIST_EMPTY(&t4_list)) { - rc = EBUSY; sx_sunlock(&t4_list_lock); - break; + + if (t4_sge_extfree_refs() == 0) { + t4_tracer_modunload(); +#ifdef TCP_OFFLOAD + sx_destroy(&t4_uld_list_lock); +#endif + sx_destroy(&t4_list_lock); + t4_sge_modunload(); + loaded = 0; + } else { + rc = EBUSY; + loaded++; /* undo earlier decrement */ + } } - sx_sunlock(&t4_list_lock); - sx_destroy(&t4_list_lock); +done_unload: + sx_xunlock(&mlu); break; } Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Wed Jul 23 22:18:43 2014 (r269031) +++ head/sys/dev/cxgbe/t4_sge.c Wed Jul 23 22:29:22 2014 (r269032) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -258,6 +259,9 @@ static int handle_fw_msg(struct sge_iq * static int sysctl_uint16(SYSCTL_HANDLER_ARGS); static int sysctl_bufsizes(SYSCTL_HANDLER_ARGS); +static counter_u64_t extfree_refs; +static counter_u64_t extfree_rels; + /* * Called on MOD_LOAD. Validates and calculates the SGE tunables. */ @@ -329,6 +333,30 @@ t4_sge_modload(void) " using 0 instead.\n", cong_drop); cong_drop = 0; } + + extfree_refs = counter_u64_alloc(M_WAITOK); + extfree_rels = counter_u64_alloc(M_WAITOK); + counter_u64_zero(extfree_refs); + counter_u64_zero(extfree_rels); +} + +void +t4_sge_modunload(void) +{ + + counter_u64_free(extfree_refs); + counter_u64_free(extfree_rels); +} + +uint64_t +t4_sge_extfree_refs(void) +{ + uint64_t refs, rels; + + rels = counter_u64_fetch(extfree_rels); + refs = counter_u64_fetch(extfree_refs); + + return (refs - rels); } void @@ -1513,6 +1541,7 @@ rxb_free(struct mbuf *m, void *arg1, voi caddr_t cl = arg2; uma_zfree(zone, cl); + counter_u64_add(extfree_rels, 1); } /* @@ -1574,7 +1603,8 @@ get_scatter_segment(struct adapter *sc, fl->mbuf_inlined++; m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nmbuf++; + if (sd->nmbuf++ == 0) + counter_u64_add(extfree_refs, 1); } else { @@ -1591,7 +1621,8 @@ get_scatter_segment(struct adapter *sc, if (clm != NULL) { m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, swz->zone, sd->cl); - sd->nmbuf++; + if (sd->nmbuf++ == 0) + counter_u64_add(extfree_refs, 1); } else { m_cljset(m, sd->cl, swz->type); sd->cl = NULL; /* consumed, not a recycle candidate */ @@ -3280,6 +3311,7 @@ refill_fl(struct adapter *sc, struct sge if (atomic_fetchadd_int(&clm->refcount, -1) == 1) { fl->cl_recycled++; + counter_u64_add(extfree_rels, 1); goto recycled; } sd->cl = NULL; /* gave up my reference */ @@ -3381,9 +3413,11 @@ free_fl_sdesc(struct adapter *sc, struct cll = &sd->cll; clm = cl_metadata(sc, fl, cll, sd->cl); - if (sd->nmbuf == 0 || - (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) { + if (sd->nmbuf == 0) + uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); + else if (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1) { uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl); + counter_u64_add(extfree_rels, 1); } sd->cl = NULL; } From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 22:35:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77B8ACFE; Wed, 23 Jul 2014 22:35:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 655E52270; Wed, 23 Jul 2014 22:35:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NMZOdL029902; Wed, 23 Jul 2014 22:35:24 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NMZOEN029901; Wed, 23 Jul 2014 22:35:24 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201407232235.s6NMZOEN029901@svn.freebsd.org> From: Glen Barber Date: Wed, 23 Jul 2014 22:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269033 - head/release/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.18 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, 23 Jul 2014 22:35:24 -0000 Author: gjb Date: Wed Jul 23 22:35:23 2014 New Revision: 269033 URL: http://svnweb.freebsd.org/changeset/base/269033 Log: Fake out the deprecation of XDEV and XDEV_ARCH by continuing to use the variables in the configuration file, but switch XDEV= and XDEV_ARCH= to TARGET= and TARGET_ARCH= appropriately. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/release.sh Modified: head/release/arm/release.sh ============================================================================== --- head/release/arm/release.sh Wed Jul 23 22:29:22 2014 (r269032) +++ head/release/arm/release.sh Wed Jul 23 22:35:23 2014 (r269033) @@ -94,7 +94,7 @@ install_uboot() { main() { # Build the 'xdev' target for crochet. eval chroot ${CHROOTDIR} make -C /usr/src \ - ${XDEV_FLAGS} XDEV=${XDEV} XDEV_ARCH=${XDEV_ARCH} \ + ${XDEV_FLAGS} TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \ ${WORLD_FLAGS} xdev # Run the ldconfig(8) startup script so /var/run/ld-elf*.so.hints From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 22:58:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 38613794; Wed, 23 Jul 2014 22:58:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 262162463; Wed, 23 Jul 2014 22:58:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NMw0Fv039842; Wed, 23 Jul 2014 22:58:00 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NMw0CW039841; Wed, 23 Jul 2014 22:58:00 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407232258.s6NMw0CW039841@svn.freebsd.org> From: Sean Bruno Date: Wed, 23 Jul 2014 22:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269036 - head/sys/boot/libstand32 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.18 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, 23 Jul 2014 22:58:01 -0000 Author: sbruno Date: Wed Jul 23 22:58:00 2014 New Revision: 269036 URL: http://svnweb.freebsd.org/changeset/base/269036 Log: Delete the entire cleandepend/cleanmachine target thing now that its been cleared out in r269029 Reviewed by: emaste@freebsd.org Modified: head/sys/boot/libstand32/Makefile Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Wed Jul 23 22:47:00 2014 (r269035) +++ head/sys/boot/libstand32/Makefile Wed Jul 23 22:58:00 2014 (r269036) @@ -175,7 +175,6 @@ SRCS+= nandfs.c .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine beforedepend ${OBJS}: machine -cleandepend: cleanmachine machine: ln -fs ${.CURDIR}/../../i386/include machine .endif From owner-svn-src-head@FreeBSD.ORG Wed Jul 23 23:01:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB9CFB02; Wed, 23 Jul 2014 23:01:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A93542496; Wed, 23 Jul 2014 23:01:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6NN1scu043835; Wed, 23 Jul 2014 23:01:54 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6NN1sZb043834; Wed, 23 Jul 2014 23:01:54 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407232301.s6NN1sZb043834@svn.freebsd.org> From: Devin Teske Date: Wed, 23 Jul 2014 23:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269037 - head/usr.bin/make 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.18 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, 23 Jul 2014 23:01:54 -0000 Author: dteske Date: Wed Jul 23 23:01:54 2014 New Revision: 269037 URL: http://svnweb.freebsd.org/changeset/base/269037 Log: When producing fmake(1), `make clean' should remove fmake.1 (a copy of make.1). Introduced initially via SVN r250699 (sjg). Reviewed by: sjg, gjb MFC after: 3 days X-MFC-to: stable/10 Modified: head/usr.bin/make/Makefile Modified: head/usr.bin/make/Makefile ============================================================================== --- head/usr.bin/make/Makefile Wed Jul 23 22:58:00 2014 (r269036) +++ head/usr.bin/make/Makefile Wed Jul 23 23:01:54 2014 (r269037) @@ -113,6 +113,7 @@ CFLAGS+= -DDEFSHELLNAME=\"${MAKE_SHELL}\ # if we are here we don't want this called 'make' PROG= fmake +CLEANFILES+= fmake.1 fmake.1: make.1 cp ${.ALLSRC} ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 00:25:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7972C72B; Thu, 24 Jul 2014 00:25:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66FB62BD3; Thu, 24 Jul 2014 00:25:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6O0PQL8082297; Thu, 24 Jul 2014 00:25:26 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6O0PQwR082296; Thu, 24 Jul 2014 00:25:26 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407240025.s6O0PQwR082296@svn.freebsd.org> From: Sean Bruno Date: Thu, 24 Jul 2014 00:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269039 - 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.18 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, 24 Jul 2014 00:25:26 -0000 Author: sbruno Date: Thu Jul 24 00:25:25 2014 New Revision: 269039 URL: http://svnweb.freebsd.org/changeset/base/269039 Log: Clean symlinks created in sys/modules dirs when a make clean is invoked. Phabric: https://phabric.freebsd.org/D474 Reviewed by: grehan sjg Modified: head/sys/conf/kmod.mk Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Jul 24 00:02:39 2014 (r269038) +++ head/sys/conf/kmod.mk Thu Jul 24 00:25:25 2014 (r269039) @@ -222,6 +222,7 @@ _ILINKS+=${MACHINE_CPUARCH} .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _ILINKS+=x86 .endif +CLEANFILES+=${_ILINKS} all: objwarn ${PROG} From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 01:38:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DF5358E; Thu, 24 Jul 2014 01:38:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69A482189; Thu, 24 Jul 2014 01:38:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6O1cD2n014574; Thu, 24 Jul 2014 01:38:13 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6O1cCaT014560; Thu, 24 Jul 2014 01:38:12 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407240138.s6O1cCaT014560@svn.freebsd.org> From: Neel Natu Date: Thu, 24 Jul 2014 01:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269042 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm 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.18 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, 24 Jul 2014 01:38:13 -0000 Author: neel Date: Thu Jul 24 01:38:11 2014 New Revision: 269042 URL: http://svnweb.freebsd.org/changeset/base/269042 Log: Fix fault injection in bhyve. The faulting instruction needs to be restarted when the exception handler is done handling the fault. bhyve now does this correctly by setting 'vmexit[vcpu].inst_length' to zero so the %rip is not advanced. A minor complication is that the fault injection APIs are used by instruction emulation code that is shared by vmm.ko and bhyve. Thus the argument that refers to 'struct vm *' in kernel or 'struct vmctx *' in userspace needs to be loosely typed as a 'void *'. Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/vmm/vmm.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/task_switch.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Thu Jul 24 01:35:41 2014 (r269041) +++ head/lib/libvmmapi/vmmapi.c Thu Jul 24 01:38:11 2014 (r269042) @@ -1146,30 +1146,3 @@ vm_set_intinfo(struct vmctx *ctx, int vc error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); return (error); } - -void -vm_inject_ss(struct vmctx *ctx, int vcpu, int errcode) -{ - int error; - - error = vm_inject_exception2(ctx, vcpu, IDT_SS, errcode); - assert(error == 0); -} - -void -vm_inject_ac(struct vmctx *ctx, int vcpu, int errcode) -{ - int error; - - error = vm_inject_exception2(ctx, vcpu, IDT_AC, errcode); - assert(error == 0); -} - -void -vm_inject_gp(struct vmctx *ctx, int vcpu, int errcode) -{ - int error; - - error = vm_inject_exception2(ctx, vcpu, IDT_GP, errcode); - assert(error == 0); -} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Thu Jul 24 01:35:41 2014 (r269041) +++ head/lib/libvmmapi/vmmapi.h Thu Jul 24 01:38:11 2014 (r269042) @@ -133,11 +133,6 @@ void vm_copyin(struct vmctx *ctx, int vc void vm_copyout(struct vmctx *ctx, int vcpu, const void *host_src, struct iovec *guest_iov, size_t len); -/* Helper functions to inject exceptions */ -void vm_inject_ss(struct vmctx *ctx, int vcpu, int errcode); -void vm_inject_ac(struct vmctx *ctx, int vcpu, int errcode); -void vm_inject_gp(struct vmctx *ctx, int vcpu, int errcode); - /* Reset vcpu register state */ int vcpu_reset(struct vmctx *ctx, int vcpu); Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Thu Jul 24 01:35:41 2014 (r269041) +++ head/sys/amd64/include/vmm.h Thu Jul 24 01:38:11 2014 (r269042) @@ -29,6 +29,8 @@ #ifndef _VMM_H_ #define _VMM_H_ +#include + enum vm_suspend_how { VM_SUSPEND_NONE, VM_SUSPEND_RESET, @@ -316,12 +318,6 @@ int vm_entry_intinfo(struct vm *vm, int int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); -void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ -void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ -void vm_inject_ac(struct vm *vm, int vcpuid, int errcode); /* #AC */ -void vm_inject_ss(struct vm *vm, int vcpuid, int errcode); /* #SS */ -void vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2); - enum vm_reg_name vm_segment_name(int seg_encoding); struct vm_copyinfo { @@ -579,4 +575,34 @@ struct vm_exit { } u; }; +/* APIs to inject faults into the guest */ +void vm_inject_fault(void *vm, int vcpuid, int vector, int errcode_valid, + int errcode); + +static void __inline +vm_inject_ud(void *vm, int vcpuid) +{ + vm_inject_fault(vm, vcpuid, IDT_UD, 0, 0); +} + +static void __inline +vm_inject_gp(void *vm, int vcpuid) +{ + vm_inject_fault(vm, vcpuid, IDT_GP, 1, 0); +} + +static void __inline +vm_inject_ac(void *vm, int vcpuid, int errcode) +{ + vm_inject_fault(vm, vcpuid, IDT_AC, 1, errcode); +} + +static void __inline +vm_inject_ss(void *vm, int vcpuid, int errcode) +{ + vm_inject_fault(vm, vcpuid, IDT_SS, 1, errcode); +} + +void vm_inject_pf(void *vm, int vcpuid, int error_code, uint64_t cr2); + #endif /* _VMM_H_ */ Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Thu Jul 24 01:35:41 2014 (r269041) +++ head/sys/amd64/vmm/vmm.c Thu Jul 24 01:38:11 2014 (r269042) @@ -1689,13 +1689,21 @@ vm_inject_exception(struct vm *vm, int v return (0); } -static void -vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) +void +vm_inject_fault(void *vmarg, int vcpuid, int vector, int errcode_valid, + int errcode) { + struct vm_exception exception; struct vm_exit *vmexit; + struct vm *vm; int error; - error = vm_inject_exception(vm, vcpuid, exception); + vm = vmarg; + + exception.vector = vector; + exception.error_code = errcode; + exception.error_code_valid = errcode_valid; + error = vm_inject_exception(vm, vcpuid, &exception); KASSERT(error == 0, ("vm_inject_exception error %d", error)); /* @@ -1710,69 +1718,19 @@ vm_inject_fault(struct vm *vm, int vcpui } void -vm_inject_pf(struct vm *vm, int vcpuid, int error_code, uint64_t cr2) +vm_inject_pf(void *vmarg, int vcpuid, int error_code, uint64_t cr2) { - struct vm_exception pf = { - .vector = IDT_PF, - .error_code_valid = 1, - .error_code = error_code - }; + struct vm *vm; int error; + vm = vmarg; VCPU_CTR2(vm, vcpuid, "Injecting page fault: error_code %#x, cr2 %#lx", error_code, cr2); error = vm_set_register(vm, vcpuid, VM_REG_GUEST_CR2, cr2); KASSERT(error == 0, ("vm_set_register(cr2) error %d", error)); - vm_inject_fault(vm, vcpuid, &pf); -} - -void -vm_inject_gp(struct vm *vm, int vcpuid) -{ - struct vm_exception gpf = { - .vector = IDT_GP, - .error_code_valid = 1, - .error_code = 0 - }; - - vm_inject_fault(vm, vcpuid, &gpf); -} - -void -vm_inject_ud(struct vm *vm, int vcpuid) -{ - struct vm_exception udf = { - .vector = IDT_UD, - .error_code_valid = 0 - }; - - vm_inject_fault(vm, vcpuid, &udf); -} - -void -vm_inject_ac(struct vm *vm, int vcpuid, int error_code) -{ - struct vm_exception acf = { - .vector = IDT_AC, - .error_code_valid = 1, - .error_code = error_code - }; - - vm_inject_fault(vm, vcpuid, &acf); -} - -void -vm_inject_ss(struct vm *vm, int vcpuid, int error_code) -{ - struct vm_exception ssf = { - .vector = IDT_SS, - .error_code_valid = 1, - .error_code = error_code - }; - - vm_inject_fault(vm, vcpuid, &ssf); + vm_inject_fault(vm, vcpuid, IDT_PF, 1, error_code); } static VMM_STAT(VCPU_NMI_COUNT, "number of NMIs delivered to vcpu"); Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Thu Jul 24 01:35:41 2014 (r269041) +++ head/usr.sbin/bhyve/bhyverun.c Thu Jul 24 01:38:11 2014 (r269042) @@ -96,7 +96,7 @@ static cpuset_t cpumask; static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip); -struct vm_exit vmexit[VM_MAXCPU]; +static struct vm_exit vmexit[VM_MAXCPU]; struct bhyvestats { uint64_t vmexit_bogus; @@ -182,6 +182,27 @@ pincpu_parse(const char *opt) return (0); } +void +vm_inject_fault(void *arg, int vcpu, int vector, int errcode_valid, + int errcode) +{ + struct vmctx *ctx; + int error; + + ctx = arg; + if (errcode_valid) + error = vm_inject_exception2(ctx, vcpu, vector, errcode); + else + error = vm_inject_exception(ctx, vcpu, vector); + assert(error == 0); + + /* + * Set the instruction length to 0 to ensure that the instruction is + * restarted when the fault handler returns. + */ + vmexit[vcpu].inst_length = 0; +} + void * paddr_guest2host(struct vmctx *ctx, uintptr_t gaddr, size_t len) { @@ -347,7 +368,7 @@ vmexit_rdmsr(struct vmctx *ctx, struct v fprintf(stderr, "rdmsr to register %#x on vcpu %d\n", vme->u.msr.code, *pvcpu); if (strictmsr) { - vm_inject_gp(ctx, *pvcpu, 0); + vm_inject_gp(ctx, *pvcpu); return (VMEXIT_RESTART); } } @@ -373,7 +394,7 @@ vmexit_wrmsr(struct vmctx *ctx, struct v fprintf(stderr, "wrmsr to register %#x(%#lx) on vcpu %d\n", vme->u.msr.code, vme->u.msr.wval, *pvcpu); if (strictmsr) { - vm_inject_gp(ctx, *pvcpu, 0); + vm_inject_gp(ctx, *pvcpu); return (VMEXIT_RESTART); } } Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Thu Jul 24 01:35:41 2014 (r269041) +++ head/usr.sbin/bhyve/inout.c Thu Jul 24 01:38:11 2014 (r269042) @@ -157,7 +157,7 @@ emulate_inout(struct vmctx *ctx, int vcp if (vie_calculate_gla(vis->paging.cpu_mode, vis->seg_name, &vis->seg_desc, index, bytes, addrsize, prot, &gla)) { - vm_inject_gp(ctx, vcpu, 0); + vm_inject_gp(ctx, vcpu); retval = INOUT_RESTART; break; } Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Thu Jul 24 01:35:41 2014 (r269041) +++ head/usr.sbin/bhyve/task_switch.c Thu Jul 24 01:38:11 2014 (r269042) @@ -160,8 +160,6 @@ usd_to_seg_desc(struct user_segment_desc static void sel_exception(struct vmctx *ctx, int vcpu, int vector, uint16_t sel, int ext) { - int error; - /* * Bit 2 from the selector is retained as-is in the error code. * @@ -174,8 +172,7 @@ sel_exception(struct vmctx *ctx, int vcp sel &= ~0x3; if (ext) sel |= 0x1; - error = vm_inject_exception2(ctx, vcpu, vector, sel); - assert(error == 0); + vm_inject_fault(ctx, vcpu, vector, 1, sel); } static int @@ -508,7 +505,7 @@ tss32_restore(struct vmctx *ctx, int vcp */ reserved = ~maxphyaddr | 0x1E6; if (pdpte[i] & reserved) { - vm_inject_gp(ctx, vcpu, 0); + vm_inject_gp(ctx, vcpu); return (VMEXIT_RESTART); } } From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 05:31:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9B674B00; Thu, 24 Jul 2014 05:31:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87EC22560; Thu, 24 Jul 2014 05:31:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6O5VvVP020239; Thu, 24 Jul 2014 05:31:57 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6O5VvYG020238; Thu, 24 Jul 2014 05:31:57 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407240531.s6O5VvYG020238@svn.freebsd.org> From: Neel Natu Date: Thu, 24 Jul 2014 05:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269043 - 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.18 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, 24 Jul 2014 05:31:57 -0000 Author: neel Date: Thu Jul 24 05:31:57 2014 New Revision: 269043 URL: http://svnweb.freebsd.org/changeset/base/269043 Log: Reduce the proliferation of VMEXIT_RESTART in task_switch.c. This is in preparation for further simplification of the return values from VM exit handlers in bhyve(8). Modified: head/usr.sbin/bhyve/task_switch.c Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Thu Jul 24 01:38:11 2014 (r269042) +++ head/usr.sbin/bhyve/task_switch.c Thu Jul 24 05:31:57 2014 (r269043) @@ -48,15 +48,6 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" /* - * Various functions in this file use 0 to denote success and VMEXIT_ABORT - * or VMEXIT_RESTART to denote failure. This assumes that the VMEXIT_xyz - * macros expand to non-zero values. Enforce this with a compile-time - * assertion. - */ -CTASSERT(VMEXIT_ABORT != 0); -CTASSERT(VMEXIT_RESTART != 0); - -/* * Using 'struct i386tss' is tempting but causes myriad sign extension * issues because all of its fields are defined as signed integers. */ @@ -175,6 +166,10 @@ sel_exception(struct vmctx *ctx, int vcp vm_inject_fault(ctx, vcpu, vector, 1, sel); } +/* + * Return 0 if the selector 'sel' in within the limits of the GDT/LDT + * and non-zero otherwise. + */ static int desc_table_limit_check(struct vmctx *ctx, int vcpu, uint16_t sel) { @@ -197,6 +192,14 @@ desc_table_limit_check(struct vmctx *ctx return (0); } +/* + * Read/write the segment descriptor 'desc' into the GDT/LDT slot referenced + * by the selector 'sel'. + * + * Returns 0 on success. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + */ static int desc_table_rw(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, uint16_t sel, struct user_segment_descriptor *desc, bool doread) @@ -236,6 +239,13 @@ desc_table_write(struct vmctx *ctx, int return (desc_table_rw(ctx, vcpu, paging, sel, desc, false)); } +/* + * Read the TSS descriptor referenced by 'sel' into 'desc'. + * + * Returns 0 on success. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + */ static int read_tss_descriptor(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, uint16_t sel, struct user_segment_descriptor *desc) @@ -252,18 +262,13 @@ read_tss_descriptor(struct vmctx *ctx, i sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); else sel_exception(ctx, vcpu, IDT_GP, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ error = desc_table_read(ctx, vcpu, &sup_paging, sel, desc); - if (error < 0) - return (VMEXIT_ABORT); - else if (error > 0) - return (VMEXIT_RESTART); - else - return (0); + return (error); } static bool @@ -294,6 +299,13 @@ ldt_desc(int sd_type) return (sd_type == SDT_SYSLDT); } +/* + * Validate the descriptor 'seg_desc' associated with 'segment'. + * + * Returns 0 on success. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + */ static int validate_seg_desc(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, int segment, struct seg_desc *seg_desc) @@ -332,13 +344,13 @@ validate_seg_desc(struct vmctx *ctx, int /* LDT selector must point into the GDT */ if (ldtseg && ISLDT(sel)) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } /* Descriptor table limit check */ if (desc_table_limit_check(ctx, vcpu, sel)) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } /* NULL selector */ @@ -346,7 +358,7 @@ validate_seg_desc(struct vmctx *ctx, int /* Code and stack segment selectors cannot be NULL */ if (codeseg || stackseg) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } seg_desc->base = 0; seg_desc->limit = 0; @@ -358,10 +370,8 @@ validate_seg_desc(struct vmctx *ctx, int sup_paging = ts->paging; sup_paging.cpl = 0; /* implicit supervisor mode */ error = desc_table_read(ctx, vcpu, &sup_paging, sel, &usd); - if (error < 0) - return (VMEXIT_ABORT); - else if (error > 0) - return (VMEXIT_RESTART); + if (error) + return (error); /* Verify that the descriptor type is compatible with the segment */ if ((ldtseg && !ldt_desc(usd.sd_type)) || @@ -369,7 +379,7 @@ validate_seg_desc(struct vmctx *ctx, int (dataseg && !data_desc(usd.sd_type)) || (stackseg && !stack_desc(usd.sd_type))) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } /* Segment must be marked present */ @@ -381,7 +391,7 @@ validate_seg_desc(struct vmctx *ctx, int else idtvec = IDT_NP; sel_exception(ctx, vcpu, idtvec, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } cs = GETREG(ctx, vcpu, VM_REG_GUEST_CS); @@ -391,7 +401,7 @@ validate_seg_desc(struct vmctx *ctx, int if (stackseg && (rpl != cpl || dpl != cpl)) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } if (codeseg) { @@ -399,7 +409,7 @@ validate_seg_desc(struct vmctx *ctx, int if ((conforming && (cpl < dpl)) || (!conforming && (cpl != dpl))) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } } @@ -415,7 +425,7 @@ validate_seg_desc(struct vmctx *ctx, int if (!conforming && (rpl > dpl || cpl > dpl)) { sel_exception(ctx, vcpu, IDT_TS, sel, ts->ext); - return (VMEXIT_RESTART); + return (1); } } *seg_desc = usd_to_seg_desc(&usd); @@ -464,6 +474,13 @@ update_seg_desc(struct vmctx *ctx, int v assert(error == 0); } +/* + * Update the vcpu registers to reflect the state of the new task. + * + * Returns 0 on success. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + */ static int tss32_restore(struct vmctx *ctx, int vcpu, struct vm_task_switch *ts, uint16_t ot_sel, struct tss32 *tss, struct iovec *iov) @@ -506,7 +523,7 @@ tss32_restore(struct vmctx *ctx, int vcp reserved = ~maxphyaddr | 0x1E6; if (pdpte[i] & reserved) { vm_inject_gp(ctx, vcpu); - return (VMEXIT_RESTART); + return (1); } } SETREG(ctx, vcpu, VM_REG_GUEST_PDPTE0, pdpte[0]); @@ -595,6 +612,15 @@ tss32_restore(struct vmctx *ctx, int vcp return (0); } +/* + * Push an error code on the stack of the new task. This is needed if the + * task switch was triggered by a hardware exception that causes an error + * code to be saved (e.g. #PF). + * + * Returns 0 on success. + * Returns 1 if an exception was injected into the guest. + * Returns -1 otherwise. + */ static int push_errcode(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging, int task_type, uint32_t errcode) @@ -640,26 +666,40 @@ push_errcode(struct vmctx *ctx, int vcpu if (vie_calculate_gla(paging->cpu_mode, VM_REG_GUEST_SS, &seg_desc, esp, bytes, stacksize, PROT_WRITE, &gla)) { sel_exception(ctx, vcpu, IDT_SS, stacksel, 1); - return (VMEXIT_RESTART); + return (1); } if (vie_alignment_check(paging->cpl, bytes, cr0, rflags, gla)) { vm_inject_ac(ctx, vcpu, 1); - return (VMEXIT_RESTART); + return (1); } error = vm_copy_setup(ctx, vcpu, paging, gla, bytes, PROT_WRITE, iov, nitems(iov)); - assert(error == 0 || error == 1 || error == -1); - if (error) { - return ((error == 1) ? VMEXIT_RESTART : VMEXIT_ABORT); - } + if (error) + return (error); vm_copyout(ctx, vcpu, &errcode, iov, bytes); SETREG(ctx, vcpu, VM_REG_GUEST_RSP, esp); return (0); } +/* + * Evaluate return value from helper functions and potentially return to + * the VM run loop. + * 0: success + * +1: an exception was injected into the guest vcpu + * -1: unrecoverable/programming error + */ +#define CHKERR(x) \ + do { \ + assert(((x) == 0) || ((x) == 1) || ((x) == -1)); \ + if ((x) == -1) \ + return (VMEXIT_ABORT); \ + else if ((x) == 1) \ + return (VMEXIT_CONTINUE); \ + } while (0) + int vmexit_task_switch(struct vmctx *ctx, struct vm_exit *vmexit, int *pvcpu) { @@ -695,8 +735,7 @@ vmexit_task_switch(struct vmctx *ctx, st /* Fetch the new TSS descriptor */ error = read_tss_descriptor(ctx, vcpu, task_switch, nt_sel, &nt_desc); - if (error) - return (error); + CHKERR(error); nt = usd_to_seg_desc(&nt_desc); @@ -705,13 +744,13 @@ vmexit_task_switch(struct vmctx *ctx, st if (nt_type != SDT_SYS386BSY && nt_type != SDT_SYS386TSS && nt_type != SDT_SYS286BSY && nt_type != SDT_SYS286TSS) { sel_exception(ctx, vcpu, IDT_TS, nt_sel, ext); - return (VMEXIT_RESTART); + goto done; } /* TSS descriptor must have present bit set */ if (!SEG_DESC_PRESENT(nt.access)) { sel_exception(ctx, vcpu, IDT_NP, nt_sel, ext); - return (VMEXIT_RESTART); + goto done; } /* @@ -728,13 +767,13 @@ vmexit_task_switch(struct vmctx *ctx, st assert(minlimit > 0); if (nt.limit < minlimit) { sel_exception(ctx, vcpu, IDT_TS, nt_sel, ext); - return (VMEXIT_RESTART); + goto done; } /* TSS must be busy if task switch is due to IRET */ if (reason == TSR_IRET && !TSS_BUSY(nt_type)) { sel_exception(ctx, vcpu, IDT_TS, nt_sel, ext); - return (VMEXIT_RESTART); + goto done; } /* @@ -743,21 +782,14 @@ vmexit_task_switch(struct vmctx *ctx, st */ if (reason != TSR_IRET && TSS_BUSY(nt_type)) { sel_exception(ctx, vcpu, IDT_GP, nt_sel, ext); - return (VMEXIT_RESTART); + goto done; } /* Fetch the new TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, nt.base, minlimit + 1, PROT_READ | PROT_WRITE, nt_iov, nitems(nt_iov)); - if (error == 1) { - /* Restart vcpu execution to handle the page fault */ - return (VMEXIT_RESTART); - } else if (error == -1) { - return (VMEXIT_ABORT); - } else { - assert(error == 0); - vm_copyin(ctx, vcpu, nt_iov, &newtss, minlimit + 1); - } + CHKERR(error); + vm_copyin(ctx, vcpu, nt_iov, &newtss, minlimit + 1); /* Get the old TSS selector from the guest's task register */ ot_sel = GETREG(ctx, vcpu, VM_REG_GUEST_TR); @@ -769,7 +801,7 @@ vmexit_task_switch(struct vmctx *ctx, st * (sel = 0, base = 0, limit = 0xffff). */ sel_exception(ctx, vcpu, IDT_TS, ot_sel, task_switch->ext); - return (VMEXIT_RESTART); + goto done; } /* Get the old TSS base and limit from the guest's task register */ @@ -781,24 +813,14 @@ vmexit_task_switch(struct vmctx *ctx, st assert(ot_type == SDT_SYS386BSY || ot_type == SDT_SYS286BSY); /* Fetch the old TSS descriptor */ - error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, - &ot_desc); - if (error) - return (error); + error = read_tss_descriptor(ctx, vcpu, task_switch, ot_sel, &ot_desc); + CHKERR(error); /* Get the old TSS */ error = vm_copy_setup(ctx, vcpu, &sup_paging, ot_base, minlimit + 1, PROT_READ | PROT_WRITE, ot_iov, nitems(ot_iov)); - if (error == 1) { - /* Restart vcpu execution to handle the page fault */ - return (VMEXIT_RESTART); - } else if (error == -1) { - fprintf(stderr, "Error copying in old TSS: %d\n", errno); - return (VMEXIT_ABORT); - } else { - assert(error == 0); - vm_copyin(ctx, vcpu, ot_iov, &oldtss, minlimit + 1); - } + CHKERR(error); + vm_copyin(ctx, vcpu, ot_iov, &oldtss, minlimit + 1); /* * Clear the busy bit in the old TSS descriptor if the task switch @@ -808,8 +830,7 @@ vmexit_task_switch(struct vmctx *ctx, st ot_desc.sd_type &= ~0x2; error = desc_table_write(ctx, vcpu, &sup_paging, ot_sel, &ot_desc); - if (error) - return (error); + CHKERR(error); } if (nt_type == SDT_SYS286BSY || nt_type == SDT_SYS286TSS) { @@ -829,8 +850,7 @@ vmexit_task_switch(struct vmctx *ctx, st nt_desc.sd_type |= 0x2; error = desc_table_write(ctx, vcpu, &sup_paging, nt_sel, &nt_desc); - if (error) - return (error); + CHKERR(error); } /* Update task register to point at the new TSS */ @@ -854,8 +874,7 @@ vmexit_task_switch(struct vmctx *ctx, st /* Load processor state from new TSS */ error = tss32_restore(ctx, vcpu, task_switch, ot_sel, &newtss, nt_iov); - if (error) - return (error); + CHKERR(error); /* * Section "Interrupt Tasks" in Intel SDM, Vol 3: if an exception @@ -867,9 +886,7 @@ vmexit_task_switch(struct vmctx *ctx, st assert(task_switch->reason == TSR_IDT_GATE); error = push_errcode(ctx, vcpu, &task_switch->paging, nt_type, task_switch->errcode); - if (error) { - return (error); - } + CHKERR(error); } /* @@ -910,5 +927,6 @@ vmexit_task_switch(struct vmctx *ctx, st /* * XXX should inject debug exception if 'T' bit is 1 */ - return (VMEXIT_RESTART); +done: + return (VMEXIT_CONTINUE); } From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 06:16:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D980E8D7; Thu, 24 Jul 2014 06:16:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C73F428F9; Thu, 24 Jul 2014 06:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6O6Gp4h040091; Thu, 24 Jul 2014 06:16:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6O6Gpq2040089; Thu, 24 Jul 2014 06:16:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407240616.s6O6Gpq2040089@svn.freebsd.org> From: Warner Losh Date: Thu, 24 Jul 2014 06:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269048 - 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.18 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, 24 Jul 2014 06:16:51 -0000 Author: imp Date: Thu Jul 24 06:16:51 2014 New Revision: 269048 URL: http://svnweb.freebsd.org/changeset/base/269048 Log: Add compat shims for XDEV and XDEV_ARCH so we don't break all the users of them. Also, add a note to updating. We'll keep these shims at least until the 12 branch. Modified: head/Makefile head/UPDATING Modified: head/Makefile ============================================================================== --- head/Makefile Thu Jul 24 06:03:45 2014 (r269047) +++ head/Makefile Thu Jul 24 06:16:51 2014 (r269048) @@ -174,6 +174,13 @@ _TARGET=${TARGET} .if defined(TARGET_ARCH) && !defined(_TARGET_ARCH) _TARGET_ARCH=${TARGET_ARCH} .endif +# for historical compatibility for xdev targets +.if defined(XDEV) +_TARGET= ${XDEV} +.endif +.if defined(XDEV_ARCH) +_TARGET_ARCH= ${XDEV_ARCH} +.endif # Otherwise, default to current machine type and architecture. _TARGET?= ${MACHINE} _TARGET_ARCH?= ${MACHINE_ARCH} Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jul 24 06:03:45 2014 (r269047) +++ head/UPDATING Thu Jul 24 06:16:51 2014 (r269048) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140723: + The xdev targets have been converted to using TARGET and + TARGET_ARCH instead of XDEV and XDEV_ARCH. + 20140719: The default unbound configuration has been modified to address issues with reverse lookups on networks that use private From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 10:08:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE61A507; Thu, 24 Jul 2014 10:08:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB46B2DAF; Thu, 24 Jul 2014 10:08:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OA82A2043864; Thu, 24 Jul 2014 10:08:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OA82AQ043863; Thu, 24 Jul 2014 10:08:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201407241008.s6OA82AQ043863@svn.freebsd.org> From: Marius Strobl Date: Thu, 24 Jul 2014 10:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269050 - head/sys/i386/i386 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.18 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, 24 Jul 2014 10:08:02 -0000 Author: marius Date: Thu Jul 24 10:08:02 2014 New Revision: 269050 URL: http://svnweb.freebsd.org/changeset/base/269050 Log: - Copying and zeroing pages via temporary mappings involves updating the corresponding page tables followed by accesses to the pages in question. This sequence is subject to the situation exactly described in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore, issuing the INVLPG right after modifying the PTE bits is crucial. For pmap_copy_page(), this has been broken in r124956 and later on carried over to pmap_copy_pages() derived from the former, while all other places in the i386 PMAP code use the correct order of instructions in this regard. Fixing the latter breakage solves the problem of data corruption seen with unmapped I/O enabled when running at least bare metal on AMD R-268D APUs. However, this might also fix similar corruption reported for virtualized environments. - In pmap_copy_pages(), correctly set the cache bits on the source page being copied. This change is thought to be a NOP for the real world, though. [2] 1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf Submitted by: kib [2] Reviewed by: alc, kib MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jul 24 09:40:31 2014 (r269049) +++ head/sys/i386/i386/pmap.c Thu Jul 24 10:08:02 2014 (r269050) @@ -1286,6 +1286,13 @@ pmap_pte_release(pt_entry_t *pte) mtx_unlock(&PMAP2mutex); } +/* + * NB: The sequence of updating a page table followed by accesses to the + * corresponding pages is subject to the situation described in the "AMD64 + * Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23, + * "7.3.1 Special Coherency Considerations". Therefore, issuing the INVLPG + * right after modifying the PTE bits is crucial. + */ static __inline void invlcaddr(void *caddr) { @@ -4333,12 +4340,12 @@ pmap_copy_page(vm_page_t src, vm_page_t if (*sysmaps->CMAP2) panic("pmap_copy_page: CMAP2 busy"); sched_pin(); - invlpg((u_int)sysmaps->CADDR1); - invlpg((u_int)sysmaps->CADDR2); *sysmaps->CMAP1 = PG_V | VM_PAGE_TO_PHYS(src) | PG_A | pmap_cache_bits(src->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR1); *sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(dst) | PG_A | PG_M | pmap_cache_bits(dst->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR2); bcopy(sysmaps->CADDR1, sysmaps->CADDR2, PAGE_SIZE); *sysmaps->CMAP1 = 0; *sysmaps->CMAP2 = 0; @@ -4366,8 +4373,6 @@ pmap_copy_pages(vm_page_t ma[], vm_offse panic("pmap_copy_pages: CMAP2 busy"); sched_pin(); while (xfersize > 0) { - invlpg((u_int)sysmaps->CADDR1); - invlpg((u_int)sysmaps->CADDR2); a_pg = ma[a_offset >> PAGE_SHIFT]; a_pg_offset = a_offset & PAGE_MASK; cnt = min(xfersize, PAGE_SIZE - a_pg_offset); @@ -4375,9 +4380,11 @@ pmap_copy_pages(vm_page_t ma[], vm_offse b_pg_offset = b_offset & PAGE_MASK; cnt = min(cnt, PAGE_SIZE - b_pg_offset); *sysmaps->CMAP1 = PG_V | VM_PAGE_TO_PHYS(a_pg) | PG_A | - pmap_cache_bits(b_pg->md.pat_mode, 0); + pmap_cache_bits(a_pg->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR1); *sysmaps->CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(b_pg) | PG_A | PG_M | pmap_cache_bits(b_pg->md.pat_mode, 0); + invlcaddr(sysmaps->CADDR2); a_cp = sysmaps->CADDR1 + a_pg_offset; b_cp = sysmaps->CADDR2 + b_pg_offset; bcopy(a_cp, b_cp, cnt); From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 10:12:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2CB270F; Thu, 24 Jul 2014 10:12:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFE922E5F; Thu, 24 Jul 2014 10:12:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OACMUi047790; Thu, 24 Jul 2014 10:12:22 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OACM2J047789; Thu, 24 Jul 2014 10:12:22 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201407241012.s6OACM2J047789@svn.freebsd.org> From: Marius Strobl Date: Thu, 24 Jul 2014 10:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269051 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 24 Jul 2014 10:12:22 -0000 Author: marius Date: Thu Jul 24 10:12:22 2014 New Revision: 269051 URL: http://svnweb.freebsd.org/changeset/base/269051 Log: Copying pages via temporary mappings in the !DMAP case of pmap_copy_pages() involves updating the corresponding page tables followed by accesses to the pages in question. This sequence is subject to the situation exactly described in the "AMD64 Architecture Programmer's Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special Coherency Considerations" [1, p. 171 f.]. Therefore, issuing the INVLPG right after modifying the PTE bits is crucial (see also r269050). For the amd64 PMAP code, the order of instructions was already correct. The above fact still is worth documenting, though. 1: http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/24593_APM_v21.pdf Reviewed by: alc Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Jul 24 10:08:02 2014 (r269050) +++ head/sys/amd64/amd64/pmap.c Thu Jul 24 10:12:22 2014 (r269051) @@ -5080,6 +5080,14 @@ pmap_copy_pages(vm_page_t ma[], vm_offse int cnt; boolean_t pinned; + /* + * NB: The sequence of updating a page table followed by accesses + * to the corresponding pages used in the !DMAP case is subject to + * the situation described in the "AMD64 Architecture Programmer's + * Manual Volume 2: System Programming" rev. 3.23, "7.3.1 Special + * Coherency Considerations". Therefore, issuing the INVLPG right + * after modifying the PTE bits is crucial. + */ pinned = FALSE; while (xfersize > 0) { a_pg_offset = a_offset & PAGE_MASK; From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 10:14:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8052D895; Thu, 24 Jul 2014 10:14:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 617E82E78; Thu, 24 Jul 2014 10:14:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OAEq7I048268; Thu, 24 Jul 2014 10:14:52 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OAEqKE048267; Thu, 24 Jul 2014 10:14:52 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201407241014.s6OAEqKE048267@svn.freebsd.org> From: Marius Strobl Date: Thu, 24 Jul 2014 10:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269052 - 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.18 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, 24 Jul 2014 10:14:52 -0000 Author: marius Date: Thu Jul 24 10:14:51 2014 New Revision: 269052 URL: http://svnweb.freebsd.org/changeset/base/269052 Log: Intel desktop Haswell CPUs may report benign corrected parity errors (see HSD131 erratum in [1]) at a considerable rate. So filter these (default), unless logging is enabled. Unfortunately, there really is no better way to reasonably implement suppressing these errors than to just skipping them in mca_log(). Given that they are reported for bank 0, they'd need to be masked in MSR_MC0_CTL. However, P6 family processors require that register to be set to either all 0s or all 1s, disabling way more than the one error in question when using all 0s there. Alternatively, it could be masked for the corresponding CMCI, but that still wouldn't keep the periodic scanner from detecting these spurious errors. Apart from that, register contents of MSR_MC0_CTL{,2} don't seem to be publicly documented, neither in the Intel Architectures Developer's Manual nor in the Haswell datasheets. Note that while HSD131 actually is only about C0-stepping as of revision 014 of the Intel desktop 4th generation processor family specification update, these corrected errors also have been observed with D0-stepping aka "Haswell Refresh". 1: http://www.intel.de/content/dam/www/public/us/en/documents/specification-updates/4th-gen-core-family-desktop-specification-update.pdf Reviewed by: jhb MFC after: 3 days Sponsored by: Bally Wulff Games & Entertainment GmbH Modified: head/sys/x86/x86/mca.c Modified: head/sys/x86/x86/mca.c ============================================================================== --- head/sys/x86/x86/mca.c Thu Jul 24 10:12:22 2014 (r269051) +++ head/sys/x86/x86/mca.c Thu Jul 24 10:14:51 2014 (r269052) @@ -99,6 +99,10 @@ static int amd10h_L1TP = 1; SYSCTL_INT(_hw_mca, OID_AUTO, amd10h_L1TP, CTLFLAG_RDTUN, &amd10h_L1TP, 0, "Administrative toggle for logging of level one TLB parity (L1TP) errors"); +static int intel6h_HSD131; +SYSCTL_INT(_hw_mca, OID_AUTO, intel6h_HSD131, CTLFLAG_RDTUN, &intel6h_HSD131, 0, + "Administrative toggle for logging of spurious corrected errors"); + int workaround_erratum383; SYSCTL_INT(_hw_mca, OID_AUTO, erratum383, CTLFLAG_RD, &workaround_erratum383, 0, "Is the workaround for Erratum 383 on AMD Family 10h processors enabled?"); @@ -242,12 +246,34 @@ mca_error_mmtype(uint16_t mca_error) return ("???"); } +static int __nonnull(1) +mca_mute(const struct mca_record *rec) +{ + + /* + * Skip spurious corrected parity errors generated by desktop Haswell + * (see HSD131 erratum) unless reporting is enabled. + * Note that these errors also have been observed with DO-stepping, + * while the revision 014 desktop Haswell specification update only + * talks about CO-stepping. + */ + if (rec->mr_cpu_vendor_id == CPU_VENDOR_INTEL && + rec->mr_cpu_id == 0x306c3 && rec->mr_bank == 0 && + rec->mr_status == 0x90000040000f0005 && !intel6h_HSD131) + return (1); + + return (0); +} + /* Dump details about a single machine check. */ static void __nonnull(1) mca_log(const struct mca_record *rec) { uint16_t mca_error; + if (mca_mute(rec)) + return; + printf("MCA: Bank %d, Status 0x%016llx\n", rec->mr_bank, (long long)rec->mr_status); printf("MCA: Global Cap 0x%016llx, Status 0x%016llx\n", From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 10:25:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06E8ABEE; Thu, 24 Jul 2014 10:25:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E86DE2F6F; Thu, 24 Jul 2014 10:25:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OAPgZL053075; Thu, 24 Jul 2014 10:25:42 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OAPgYq053074; Thu, 24 Jul 2014 10:25:42 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407241025.s6OAPgYq053074@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Jul 2014 10:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269053 - head/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.18 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, 24 Jul 2014 10:25:43 -0000 Author: kib Date: Thu Jul 24 10:25:42 2014 New Revision: 269053 URL: http://svnweb.freebsd.org/changeset/base/269053 Log: Correct assertion. The shadowing object cannot be tmpfs vm object, and tmpfs object cannot shadow. In other words, tmpfs vm object is always at the bottom of the shadow chain. Reported and tested by: bdrewery Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Jul 24 10:14:51 2014 (r269052) +++ head/sys/vm/vm_object.c Thu Jul 24 10:25:42 2014 (r269053) @@ -559,8 +559,6 @@ vm_object_deallocate(vm_object_t object) (object->handle == NULL) && (object->type == OBJT_DEFAULT || object->type == OBJT_SWAP)) { - KASSERT((object->flags & OBJ_TMPFS_NODE) == 0, - ("shadowed tmpfs v_object %p", object)); vm_object_t robject; robject = LIST_FIRST(&object->shadow_head); @@ -568,6 +566,8 @@ vm_object_deallocate(vm_object_t object) ("vm_object_deallocate: ref_count: %d, shadow_count: %d", object->ref_count, object->shadow_count)); + KASSERT((robject->flags & OBJ_TMPFS_NODE) == 0, + ("shadowed tmpfs v_object %p", object)); if (!VM_OBJECT_TRYWLOCK(robject)) { /* * Avoid a potential deadlock. @@ -637,6 +637,8 @@ retry: doterm: temp = object->backing_object; if (temp != NULL) { + KASSERT((object->flags & OBJ_TMPFS_NODE) == 0, + ("shadowed tmpfs v_object 2 %p", object)); VM_OBJECT_WLOCK(temp); LIST_REMOVE(object, shadow_list); temp->shadow_count--; From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 10:42:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7465CF26; Thu, 24 Jul 2014 10:42:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 616EE2136; Thu, 24 Jul 2014 10:42:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OAgmJw061555; Thu, 24 Jul 2014 10:42:48 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OAgmf4061553; Thu, 24 Jul 2014 10:42:48 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201407241042.s6OAgmf4061553@svn.freebsd.org> From: Hiroki Sato Date: Thu, 24 Jul 2014 10:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269054 - in head/sys: netinet 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.18 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, 24 Jul 2014 10:42:48 -0000 Author: hrs Date: Thu Jul 24 10:42:47 2014 New Revision: 269054 URL: http://svnweb.freebsd.org/changeset/base/269054 Log: Fix EtherIP. TOS field must be initialized when the inner protocol is PF_LINK, and multicast/broadcast flag should always be dropped because the outer protocol uses unicast even when the inner address is not for unicast. It had been broken since r236951 when gif_output() started to use IFQ_HANDOFF(). Modified: head/sys/netinet/in_gif.c head/sys/netinet6/in6_gif.c Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Thu Jul 24 10:25:42 2014 (r269053) +++ head/sys/netinet/in_gif.c Thu Jul 24 10:42:47 2014 (r269054) @@ -170,6 +170,7 @@ in_gif_output(struct ifnet *ifp, int fam return ENOBUFS; bcopy(&eiphdr, mtod(m, struct etherip_header *), sizeof(struct etherip_header)); + tos = 0; break; default: @@ -257,6 +258,7 @@ in_gif_output(struct ifnet *ifp, int fam #endif } + m->m_flags &= ~(M_BCAST|M_MCAST); error = ip_output(m, NULL, &sc->gif_ro, 0, NULL, NULL); if (!(GIF2IFP(sc)->if_flags & IFF_LINK0) && Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Thu Jul 24 10:25:42 2014 (r269053) +++ head/sys/netinet6/in6_gif.c Thu Jul 24 10:42:47 2014 (r269054) @@ -176,6 +176,7 @@ in6_gif_output(struct ifnet *ifp, return ENOBUFS; bcopy(&eiphdr, mtod(m, struct etherip_header *), sizeof(struct etherip_header)); + itos = 0; break; default: @@ -266,6 +267,7 @@ in6_gif_output(struct ifnet *ifp, #endif } + m->m_flags &= ~(M_BCAST|M_MCAST); #ifdef IPV6_MINMTU /* * force fragmentation to minimum MTU, to avoid path MTU discovery. From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 14:10:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C1A9209; Thu, 24 Jul 2014 14:10:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 198BF2422; Thu, 24 Jul 2014 14:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OEAwCp060125; Thu, 24 Jul 2014 14:10:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OEAwhM060124; Thu, 24 Jul 2014 14:10:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407241410.s6OEAwhM060124@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Jul 2014 14:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269058 - head/sys/cam/ctl 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.18 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, 24 Jul 2014 14:10:59 -0000 Author: mav Date: Thu Jul 24 14:10:58 2014 New Revision: 269058 URL: http://svnweb.freebsd.org/changeset/base/269058 Log: Fix build with QUEUE_MACRO_DEBUG. Submitted by: benno@ MFC after: 3 days Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Jul 24 11:17:26 2014 (r269057) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Jul 24 14:10:58 2014 (r269058) @@ -815,7 +815,7 @@ ctl_backend_ramdisk_lun_shutdown(void *b if (lun->flags & CTL_BE_RAMDISK_LUN_WAITING) { wakeup(lun); } else { - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_ramdisk_lun, + STAILQ_REMOVE(&softc->lun_list, lun, ctl_be_ramdisk_lun, links); softc->num_luns--; do_free = 1; From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 14:11:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32817352; Thu, 24 Jul 2014 14:11:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 200B22432; Thu, 24 Jul 2014 14:11:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OEBXxP062994; Thu, 24 Jul 2014 14:11:33 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OEBXZJ062992; Thu, 24 Jul 2014 14:11:33 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407241411.s6OEBXZJ062992@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 24 Jul 2014 14:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269059 - 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.18 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, 24 Jul 2014 14:11:34 -0000 Author: bapt Date: Thu Jul 24 14:11:33 2014 New Revision: 269059 URL: http://svnweb.freebsd.org/changeset/base/269059 Log: Fix a typo in a comment Reported by: jhb Modified: head/sys/sys/event.h Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Thu Jul 24 14:10:58 2014 (r269058) +++ head/sys/sys/event.h Thu Jul 24 14:11:33 2014 (r269059) @@ -133,7 +133,7 @@ struct kevent { #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ -/* additional flags for EVFILE_TIMER */ +/* additional flags for EVFILT_TIMER */ #define NOTE_SECONDS 0x00000001 /* data is seconds */ #define NOTE_MSECONDS 0x00000002 /* data is milliseconds */ #define NOTE_USECONDS 0x00000004 /* data is microseconds */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 15:16:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 056498B8; Thu, 24 Jul 2014 15:16:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD00B2A3C; Thu, 24 Jul 2014 15:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OFG306092037; Thu, 24 Jul 2014 15:16:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OFG3MC092036; Thu, 24 Jul 2014 15:16:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407241516.s6OFG3MC092036@svn.freebsd.org> From: Ed Maste Date: Thu, 24 Jul 2014 15:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269063 - head/usr.bin/vtfontcvt 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.18 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, 24 Jul 2014 15:16:04 -0000 Author: emaste Date: Thu Jul 24 15:16:03 2014 New Revision: 269063 URL: http://svnweb.freebsd.org/changeset/base/269063 Log: vtfontcvt will first ship in FreeBSD 10.1 Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.8 Thu Jul 24 14:57:58 2014 (r269062) +++ head/usr.bin/vtfontcvt/vtfontcvt.8 Thu Jul 24 15:16:03 2014 (r269063) @@ -71,4 +71,4 @@ comment before any font data. The .Nm utility first appeared in -.Fx 11.0 . +.Fx 10.1 . From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 17:43:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4EAE55E; Thu, 24 Jul 2014 17:43:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1FFC2966; Thu, 24 Jul 2014 17:43:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OHhgkL066433; Thu, 24 Jul 2014 17:43:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OHhgcD066432; Thu, 24 Jul 2014 17:43:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407241743.s6OHhgcD066432@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 24 Jul 2014 17:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269074 - head/usr.sbin/bsdinstall/scripts 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.18 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, 24 Jul 2014 17:43:42 -0000 Author: des Date: Thu Jul 24 17:43:42 2014 New Revision: 269074 URL: http://svnweb.freebsd.org/changeset/base/269074 Log: Strip the patch level from the release name before trying to fetch the distribution. PR: 170264 Approved by: nathanw MFC after: 1 week Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect Modified: head/usr.sbin/bsdinstall/scripts/mirrorselect ============================================================================== --- head/usr.sbin/bsdinstall/scripts/mirrorselect Thu Jul 24 16:33:29 2014 (r269073) +++ head/usr.sbin/bsdinstall/scripts/mirrorselect Thu Jul 24 17:43:42 2014 (r269074) @@ -158,6 +158,7 @@ MIRROR_BUTTON=$? exec 3>&- _UNAME_R=`uname -r` +_UNAME_R=${_UNAME_R%-p*} case ${_UNAME_R} in *-CURRENT|*-STABLE|*-PRERELEASE) From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 18:06:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C35A4CCE; Thu, 24 Jul 2014 18:06:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B029F2B70; Thu, 24 Jul 2014 18:06:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OI6IUP076499; Thu, 24 Jul 2014 18:06:18 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OI6IRo076498; Thu, 24 Jul 2014 18:06:18 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201407241806.s6OI6IRo076498@svn.freebsd.org> From: Michael Tuexen Date: Thu, 24 Jul 2014 18:06:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269075 - 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.18 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, 24 Jul 2014 18:06:18 -0000 Author: tuexen Date: Thu Jul 24 18:06:18 2014 New Revision: 269075 URL: http://svnweb.freebsd.org/changeset/base/269075 Log: Initialize notification strucuture. This was missed in an earlier commit MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Jul 24 17:43:42 2014 (r269074) +++ head/sys/netinet/sctputil.c Thu Jul 24 18:06:18 2014 (r269075) @@ -2746,6 +2746,7 @@ sctp_notify_peer_addr_change(struct sctp return; SCTP_BUF_LEN(m_notify) = 0; spc = mtod(m_notify, struct sctp_paddr_change *); + memset(spc, 0, sizeof(struct sctp_paddr_change)); spc->spc_type = SCTP_PEER_ADDR_CHANGE; spc->spc_flags = 0; spc->spc_length = sizeof(struct sctp_paddr_change); @@ -3488,6 +3489,7 @@ sctp_notify_remote_error(struct sctp_tcb } SCTP_BUF_NEXT(m_notify) = NULL; sre = mtod(m_notify, struct sctp_remote_error *); + memset(sre, 0, notif_len); sre->sre_type = SCTP_REMOTE_ERROR; sre->sre_flags = 0; sre->sre_length = sizeof(struct sctp_remote_error); From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 18:39:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1306AC; Thu, 24 Jul 2014 18:39:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACFF42952; Thu, 24 Jul 2014 18:39:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OId9FV096780; Thu, 24 Jul 2014 18:39:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OId89b096774; Thu, 24 Jul 2014 18:39:08 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407241839.s6OId89b096774@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 24 Jul 2014 18:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269076 - in head/sys/dev/cxgbe: . tom 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.18 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, 24 Jul 2014 18:39:09 -0000 Author: np Date: Thu Jul 24 18:39:08 2014 New Revision: 269076 URL: http://svnweb.freebsd.org/changeset/base/269076 Log: Some hooks in cxgbe(4) for the offloaded iSCSI driver. (I'm committing this on behalf of my colleagues in the Storage team at Chelsio). Submitted by: Sreenivasa Honnur Sponsored by: Chelsio Communications. Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Jul 24 18:06:18 2014 (r269075) +++ head/sys/dev/cxgbe/offload.h Thu Jul 24 18:39:08 2014 (r269076) @@ -153,6 +153,6 @@ int t4_register_uld(struct uld_info *); int t4_unregister_uld(struct uld_info *); int t4_activate_uld(struct adapter *, int); int t4_deactivate_uld(struct adapter *, int); +void t4_iscsi_init(struct ifnet *, unsigned int, const unsigned int *); #endif - #endif Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jul 24 18:06:18 2014 (r269075) +++ head/sys/dev/cxgbe/t4_main.c Thu Jul 24 18:39:08 2014 (r269076) @@ -8034,6 +8034,19 @@ t4_ioctl(struct cdev *dev, unsigned long } #ifdef TCP_OFFLOAD +void +t4_iscsi_init(struct ifnet *ifp, unsigned int tag_mask, + const unsigned int *pgsz_order) +{ + struct port_info *pi = ifp->if_softc; + struct adapter *sc = pi->adapter; + + t4_write_reg(sc, A_ULP_RX_ISCSI_TAGMASK, tag_mask); + t4_write_reg(sc, A_ULP_RX_ISCSI_PSZ, V_HPZ0(pgsz_order[0]) | + V_HPZ1(pgsz_order[1]) | V_HPZ2(pgsz_order[2]) | + V_HPZ3(pgsz_order[3])); +} + static int toe_capability(struct port_info *pi, int enable) { Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Jul 24 18:06:18 2014 (r269075) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Thu Jul 24 18:39:08 2014 (r269076) @@ -70,6 +70,33 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) +/* + * For ULP connections HW may add headers, e.g., for digests, that aren't part + * of the messages sent by the host but that are part of the TCP payload and + * therefore consume TCP sequence space. Tx connection parameters that + * operate in TCP sequence space are affected by the HW additions and need to + * compensate for them to accurately track TCP sequence numbers. This array + * contains the compensating extra lengths for ULP packets. It is indexed by + * a packet's ULP submode. + */ +const unsigned int t4_ulp_extra_len[] = {0, 4, 4, 8}; + +/* + * Return the length of any HW additions that will be made to a Tx packet. + * Such additions can happen for some types of ULP packets. + */ +static inline unsigned int +ulp_extra_len(struct mbuf *m, int *ulp_mode) +{ + struct m_tag *mtag; + + if ((mtag = m_tag_find(m, CXGBE_ISCSI_MBUF_TAG, NULL)) == NULL) + return (0); + *ulp_mode = *((int *)(mtag + 1)); + + return (t4_ulp_extra_len[*ulp_mode & 3]); +} + void send_flowc_wr(struct toepcb *toep, struct flowc_tx_params *ftxp) { @@ -341,8 +368,13 @@ t4_rcvd(struct toedev *tod, struct tcpcb KASSERT(toep->sb_cc >= sb->sb_cc, ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sb->sb_cc, toep->sb_cc)); - toep->rx_credits += toep->sb_cc - sb->sb_cc; - toep->sb_cc = sb->sb_cc; + if (toep->ulp_mode == ULP_MODE_ISCSI) { + toep->rx_credits += toep->sb_cc; + toep->sb_cc = 0; + } else { + toep->rx_credits += toep->sb_cc - sb->sb_cc; + toep->sb_cc = sb->sb_cc; + } credits = toep->rx_credits; SOCKBUF_UNLOCK(sb); @@ -444,16 +476,25 @@ max_dsgl_nsegs(int tx_credits) static inline void write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, - unsigned int plen, uint8_t credits, int shove) + unsigned int plen, uint8_t credits, int shove, int ulp_mode) { struct fw_ofld_tx_data_wr *txwr = dst; + unsigned int wr_ulp_mode; txwr->op_to_immdlen = htobe32(V_WR_OP(FW_OFLD_TX_DATA_WR) | V_FW_WR_IMMDLEN(immdlen)); txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) | V_FW_WR_LEN16(credits)); + + /* for iscsi, the mode & submode setting is per-packet */ + if (toep->ulp_mode == ULP_MODE_ISCSI) + wr_ulp_mode = V_FW_OFLD_TX_DATA_WR_ULPMODE(ulp_mode >> 4) | + V_FW_OFLD_TX_DATA_WR_ULPSUBMODE(ulp_mode & 3); + else + wr_ulp_mode = V_FW_OFLD_TX_DATA_WR_ULPMODE(toep->ulp_mode); + txwr->lsodisable_to_proxy = - htobe32(V_FW_OFLD_TX_DATA_WR_ULPMODE(toep->ulp_mode) | + htobe32(wr_ulp_mode | V_FW_OFLD_TX_DATA_WR_URGENT(0) | /* XXX */ V_FW_OFLD_TX_DATA_WR_SHOVE(shove)); txwr->plen = htobe32(plen); @@ -527,7 +568,7 @@ write_tx_sgl(void *dst, struct mbuf *sta * stalls). When drop is set this function MUST drop the bytes and wake up any * writers. */ -static void +void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop) { struct mbuf *sndptr, *m, *sb_sndptr; @@ -660,7 +701,7 @@ t4_push_frames(struct adapter *sc, struc } txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, plen, credits, shove); + write_tx_wr(txwr, toep, plen, plen, credits, shove, 0); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); nsegs = 0; } else { @@ -678,7 +719,7 @@ t4_push_frames(struct adapter *sc, struc } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, plen, credits, shove); + write_tx_wr(txwr, toep, 0, plen, credits, shove, 0); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -734,6 +775,177 @@ t4_push_frames(struct adapter *sc, struc close_conn(sc, toep); } +/* Send ULP data over TOE using TX_DATA_WR. We send whole mbuf at once */ +void +t4_ulp_push_frames(struct adapter *sc, struct toepcb *toep, int drop) +{ + struct mbuf *sndptr, *m = NULL; + struct fw_ofld_tx_data_wr *txwr; + struct wrqe *wr; + unsigned int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf; + struct inpcb *inp = toep->inp; + struct tcpcb *tp; + struct socket *so; + struct sockbuf *sb; + int tx_credits, ulp_len = 0, ulp_mode = 0, qlen = 0; + int shove, compl; + struct ofld_tx_sdesc *txsd; + + INP_WLOCK_ASSERT(inp); + if (toep->flags & TPF_ABORT_SHUTDOWN) + return; + + tp = intotcpcb(inp); + so = inp->inp_socket; + sb = &so->so_snd; + txsd = &toep->txsd[toep->txsd_pidx]; + + KASSERT(toep->flags & TPF_FLOWC_WR_SENT, + ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); + + /* + * This function doesn't resume by itself. Someone else must clear the + * flag and call this function. + */ + if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) + return; + + sndptr = t4_queue_iscsi_callback(so, toep, 1, &qlen); + if (!qlen) + return; + + do { + tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); + max_imm = max_imm_payload(tx_credits); + max_nsegs = max_dsgl_nsegs(tx_credits); + + if (drop) { + t4_cpl_iscsi_callback(toep->td, toep, &drop, + CPL_FW4_ACK); + drop = 0; + } + + plen = 0; + nsegs = 0; + max_nsegs_1mbuf = 0; /* max # of SGL segments in any one mbuf */ + for (m = sndptr; m != NULL; m = m->m_next) { + int n = sglist_count(mtod(m, void *), m->m_len); + + nsegs += n; + plen += m->m_len; + + /* This mbuf sent us _over_ the nsegs limit, return */ + if (plen > max_imm && nsegs > max_nsegs) { + toep->flags |= TPF_TX_SUSPENDED; + return; + } + + if (max_nsegs_1mbuf < n) + max_nsegs_1mbuf = n; + + /* This mbuf put us right at the max_nsegs limit */ + if (plen > max_imm && nsegs == max_nsegs) { + toep->flags |= TPF_TX_SUSPENDED; + return; + } + } + + shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); + /* nothing to send */ + if (plen == 0) { + KASSERT(m == NULL, + ("%s: nothing to send, but m != NULL", __func__)); + break; + } + + if (__predict_false(toep->flags & TPF_FIN_SENT)) + panic("%s: excess tx.", __func__); + + ulp_len = plen + ulp_extra_len(sndptr, &ulp_mode); + if (plen <= max_imm) { + + /* Immediate data tx */ + wr = alloc_wrqe(roundup(sizeof(*txwr) + plen, 16), + toep->ofld_txq); + if (wr == NULL) { + /* XXX: how will we recover from this? */ + toep->flags |= TPF_TX_SUSPENDED; + return; + } + txwr = wrtod(wr); + credits = howmany(wr->wr_len, 16); + write_tx_wr(txwr, toep, plen, ulp_len, credits, shove, + ulp_mode); + m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); + } else { + int wr_len; + + /* DSGL tx */ + wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; + wr = alloc_wrqe(roundup(wr_len, 16), toep->ofld_txq); + if (wr == NULL) { + /* XXX: how will we recover from this? */ + toep->flags |= TPF_TX_SUSPENDED; + return; + } + txwr = wrtod(wr); + credits = howmany(wr_len, 16); + write_tx_wr(txwr, toep, 0, ulp_len, credits, shove, + ulp_mode); + write_tx_sgl(txwr + 1, sndptr, m, nsegs, + max_nsegs_1mbuf); + if (wr_len & 0xf) { + uint64_t *pad = (uint64_t *) + ((uintptr_t)txwr + wr_len); + *pad = 0; + } + } + + KASSERT(toep->tx_credits >= credits, + ("%s: not enough credits", __func__)); + + toep->tx_credits -= credits; + toep->tx_nocompl += credits; + toep->plen_nocompl += plen; + if (toep->tx_credits <= toep->tx_total * 3 / 8 && + toep->tx_nocompl >= toep->tx_total / 4) + compl = 1; + + if (compl) { + txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL); + toep->tx_nocompl = 0; + toep->plen_nocompl = 0; + } + tp->snd_nxt += ulp_len; + tp->snd_max += ulp_len; + + /* goto next mbuf */ + sndptr = m = t4_queue_iscsi_callback(so, toep, 2, &qlen); + + toep->flags |= TPF_TX_DATA_SENT; + if (toep->tx_credits < MIN_OFLD_TX_CREDITS) { + toep->flags |= TPF_TX_SUSPENDED; + } + + KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); + txsd->plen = plen; + txsd->tx_credits = credits; + txsd++; + if (__predict_false(++toep->txsd_pidx == toep->txsd_total)) { + toep->txsd_pidx = 0; + txsd = &toep->txsd[0]; + } + toep->txsd_avail--; + + t4_l2t_send(sc, wr, toep->l2te); + } while (m != NULL); + + /* Send a FIN if requested, but only if there's no more data to send */ + if (m == NULL && toep->flags & TPF_SEND_FIN) + close_conn(sc, toep); +} + int t4_tod_output(struct toedev *tod, struct tcpcb *tp) { @@ -768,8 +980,12 @@ t4_send_fin(struct toedev *tod, struct t KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); toep->flags |= TPF_SEND_FIN; - if (tp->t_state >= TCPS_ESTABLISHED) - t4_push_frames(sc, toep, 0); + if (tp->t_state >= TCPS_ESTABLISHED) { + if (toep->ulp_mode == ULP_MODE_ISCSI) + t4_ulp_push_frames(sc, toep, 0); + else + t4_push_frames(sc, toep, 0); + } return (0); } @@ -1019,6 +1235,91 @@ abort_status_to_errno(struct tcpcb *tp, } } +int +cpl_not_handled(struct sge_iq *, const struct rss_header *, struct mbuf *); +/* + * tom_cpl_iscsi_callback - + * iscsi and tom would share the following cpl messages, so when any of these + * message is received, after tom is done with processing it, the messages + * needs to be forwarded to iscsi for further processing: + * - CPL_SET_TCB_RPL + * - CPL_RX_DATA_DDP + */ +void (*tom_cpl_iscsi_callback)(struct tom_data *, struct socket *, void *, + unsigned int); + +struct mbuf *(*tom_queue_iscsi_callback)(struct socket *, unsigned int, int *); +/* + * Check if the handler function is set for a given CPL + * return 0 if the function is NULL or cpl_not_handled, 1 otherwise. + */ +int +t4tom_cpl_handler_registered(struct adapter *sc, unsigned int opcode) +{ + + MPASS(opcode < nitems(sc->cpl_handler)); + + return (sc->cpl_handler[opcode] && + sc->cpl_handler[opcode] != cpl_not_handled); +} + +/* + * set the tom_cpl_iscsi_callback function, this function should be used + * whenever both toe and iscsi need to process the same cpl msg. + */ +void +t4tom_register_cpl_iscsi_callback(void (*fp)(struct tom_data *, struct socket *, + void *, unsigned int)) +{ + + tom_cpl_iscsi_callback = fp; +} + +void +t4tom_register_queue_iscsi_callback(struct mbuf *(*fp)(struct socket *, + unsigned int, int *qlen)) +{ + + tom_queue_iscsi_callback = fp; +} + +int +t4_cpl_iscsi_callback(struct tom_data *td, struct toepcb *toep, void *m, + unsigned int opcode) +{ + struct socket *so; + + if (opcode == CPL_FW4_ACK) + so = toep->inp->inp_socket; + else { + INP_WLOCK(toep->inp); + so = toep->inp->inp_socket; + INP_WUNLOCK(toep->inp); + } + + if (tom_cpl_iscsi_callback && so) { + if (toep->ulp_mode == ULP_MODE_ISCSI) { + tom_cpl_iscsi_callback(td, so, m, opcode); + return (0); + } + } + + return (1); +} + +struct mbuf * +t4_queue_iscsi_callback(struct socket *so, struct toepcb *toep, + unsigned int cmd, int *qlen) +{ + + if (tom_queue_iscsi_callback && so) { + if (toep->ulp_mode == ULP_MODE_ISCSI) + return (tom_queue_iscsi_callback(so, cmd, qlen)); + } + + return (NULL); +} + /* * TCP RST from the peer, timeout, or some other such critical error. */ @@ -1408,14 +1709,22 @@ do_fw4_ack(struct sge_iq *iq, const stru if (toep->flags & TPF_TX_SUSPENDED && toep->tx_credits >= toep->tx_total / 4) { toep->flags &= ~TPF_TX_SUSPENDED; - t4_push_frames(sc, toep, plen); + if (toep->ulp_mode == ULP_MODE_ISCSI) + t4_ulp_push_frames(sc, toep, plen); + else + t4_push_frames(sc, toep, plen); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; - SOCKBUF_LOCK(sb); - sbdrop_locked(sb, plen); - sowwakeup_locked(so); - SOCKBUF_UNLOCK_ASSERT(sb); + if (toep->ulp_mode == ULP_MODE_ISCSI) + t4_cpl_iscsi_callback(toep->td, toep, &plen, + CPL_FW4_ACK); + else { + SOCKBUF_LOCK(sb); + sbdrop_locked(sb, plen); + sowwakeup_locked(so); + SOCKBUF_UNLOCK_ASSERT(sb); + } } INP_WUNLOCK(inp); @@ -1439,6 +1748,12 @@ do_set_tcb_rpl(struct sge_iq *iq, const if (is_ftid(sc, tid)) return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ + else { + struct toepcb *toep = lookup_tid(sc, tid); + + t4_cpl_iscsi_callback(toep->td, toep, m, CPL_SET_TCB_RPL); + return (0); + } CXGBE_UNIMPLEMENTED(__func__); } Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Thu Jul 24 18:06:18 2014 (r269075) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Thu Jul 24 18:39:08 2014 (r269076) @@ -493,6 +493,7 @@ do_rx_data_ddp(struct sge_iq *iq, const unsigned int tid = GET_TID(cpl); uint32_t vld; struct toepcb *toep = lookup_tid(sc, tid); + struct tom_data *td = toep->td; KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); @@ -504,6 +505,16 @@ do_rx_data_ddp(struct sge_iq *iq, const panic("%s: DDP error 0x%x (tid %d, toep %p)", __func__, vld, tid, toep); } + if (toep->ulp_mode == ULP_MODE_ISCSI) { + m = m_get(M_NOWAIT, MT_DATA); + if (m == NULL) + CXGBE_UNIMPLEMENTED("mbuf alloc failure"); + memcpy(mtod(m, unsigned char *), cpl, + sizeof(struct cpl_rx_data_ddp)); + if (!t4_cpl_iscsi_callback(td, toep, m, CPL_RX_DATA_DDP)) + return (0); + m_freem(m); + } handle_ddp_data(toep, cpl->u.ddp_report, cpl->seq, be16toh(cpl->len)); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Thu Jul 24 18:06:18 2014 (r269075) +++ head/sys/dev/cxgbe/tom/t4_tom.h Thu Jul 24 18:39:08 2014 (r269076) @@ -279,6 +279,7 @@ int t4_send_fin(struct toedev *, struct int t4_send_rst(struct toedev *, struct tcpcb *); void t4_set_tcb_field(struct adapter *, struct toepcb *, int, uint16_t, uint64_t, uint64_t); +void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop); /* t4_ddp.c */ void t4_init_ddp(struct adapter *, struct tom_data *); @@ -289,4 +290,20 @@ struct mbuf *get_ddp_mbuf(int); void enable_ddp(struct adapter *, struct toepcb *toep); void release_ddp_resources(struct toepcb *toep); void insert_ddp_data(struct toepcb *, uint32_t); + +/* ULP related */ +#define CXGBE_ISCSI_MBUF_TAG 50 +int t4tom_cpl_handler_registered(struct adapter *, unsigned int); +void t4tom_register_cpl_iscsi_callback(void (*fp)(struct tom_data *, + struct socket *, void *, unsigned int)); +void t4tom_register_queue_iscsi_callback(struct mbuf *(*fp)(struct socket *, + unsigned int, int *)); +void t4_ulp_push_frames(struct adapter *sc, struct toepcb *toep, int); +int t4_cpl_iscsi_callback(struct tom_data *, struct toepcb *, void *, uint32_t); +struct mbuf *t4_queue_iscsi_callback(struct socket *, struct toepcb *, uint32_t, + int *); +extern void (*tom_cpl_iscsi_callback)(struct tom_data *, struct socket *, + void *, unsigned int); +extern struct mbuf *(*tom_queue_iscsi_callback)(struct socket*, unsigned int, + int *); #endif From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 19:06:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4C3FB2D; Thu, 24 Jul 2014 19:06:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D1F572CDF; Thu, 24 Jul 2014 19:06:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OJ6FF1020184; Thu, 24 Jul 2014 19:06:15 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OJ6FkI020182; Thu, 24 Jul 2014 19:06:15 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201407241906.s6OJ6FkI020182@svn.freebsd.org> From: Sean Bruno Date: Thu, 24 Jul 2014 19:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269077 - head/lib/libstand 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.18 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, 24 Jul 2014 19:06:16 -0000 Author: sbruno Date: Thu Jul 24 19:06:15 2014 New Revision: 269077 URL: http://svnweb.freebsd.org/changeset/base/269077 Log: libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not true on amd64 I'm not quite positive this is the "correct" solution for this but it does seem to compile and shut up the spew of warnings when compiling libstand for userboot. Add two _Static_asserts() so that in the future somebody will get a compile failure if an architecture develops that violates the assumptions of this code. (strongly suggested by jmg) Change commetns to indicate int types instead of long. (noted by ian in phabric review) Phabric: https://phabric.freebsd.org/D443 Modified: head/lib/libstand/qdivrem.c head/lib/libstand/quad.h Modified: head/lib/libstand/qdivrem.c ============================================================================== --- head/lib/libstand/qdivrem.c Thu Jul 24 18:39:08 2014 (r269076) +++ head/lib/libstand/qdivrem.c Thu Jul 24 19:06:15 2014 (r269077) @@ -46,14 +46,13 @@ __FBSDID("$FreeBSD$"); #define B (1 << HALF_BITS) /* digit base */ /* Combine two `digits' to make a single two-digit number. */ -#define COMBINE(a, b) (((u_long)(a) << HALF_BITS) | (b)) +#define COMBINE(a, b) (((u_int)(a) << HALF_BITS) | (b)) + +_Static_assert(sizeof(int) / 2 == sizeof(short), + "Bitwise functions in libstand are broken on this architecture\n"); /* select a type for digits in base B: use unsigned short if they fit */ -#if ULONG_MAX == 0xffffffff && USHRT_MAX >= 0xffff typedef unsigned short digit; -#else -typedef u_long digit; -#endif /* * Shift p[0]..p[len] left `sh' bits, ignoring any bits that @@ -74,7 +73,7 @@ shl(digit *p, int len, int sh) * __qdivrem(u, v, rem) returns u/v and, optionally, sets *rem to u%v. * * We do this in base 2-sup-HALF_BITS, so that all intermediate products - * fit within u_long. As a consequence, the maximum length dividend and + * fit within u_int. As a consequence, the maximum length dividend and * divisor are 4 `digits' in this base (they are shorter if they have * leading zeros). */ @@ -85,7 +84,7 @@ __qdivrem(uq, vq, arq) union uu tmp; digit *u, *v, *q; digit v1, v2; - u_long qhat, rhat, t; + u_int qhat, rhat, t; int m, n, d, j, i; digit uspace[5], vspace[5], qspace[5]; @@ -136,7 +135,7 @@ __qdivrem(uq, vq, arq) v[4] = LHALF(tmp.ul[L]); for (n = 4; v[1] == 0; v++) { if (--n == 1) { - u_long rbj; /* r*B+u[j] (not root boy jim) */ + u_int rbj; /* r*B+u[j] (not root boy jim) */ digit q1, q2, q3, q4; /* @@ -212,7 +211,7 @@ __qdivrem(uq, vq, arq) rhat = uj1; goto qhat_too_big; } else { - u_long nn = COMBINE(uj0, uj1); + u_int nn = COMBINE(uj0, uj1); qhat = nn / v1; rhat = nn % v1; } Modified: head/lib/libstand/quad.h ============================================================================== --- head/lib/libstand/quad.h Thu Jul 24 18:39:08 2014 (r269076) +++ head/lib/libstand/quad.h Thu Jul 24 19:06:15 2014 (r269077) @@ -54,6 +54,9 @@ #include #include +_Static_assert(sizeof(quad_t) == sizeof(int) * 2, + "Bitwise function in libstand are broken on this architecture\n"); + /* * Depending on the desired operation, we view a `long long' (aka quad_t) in * one or more of the following formats. @@ -61,8 +64,8 @@ union uu { quad_t q; /* as a (signed) quad */ quad_t uq; /* as an unsigned quad */ - long sl[2]; /* as two signed longs */ - u_long ul[2]; /* as two unsigned longs */ + int sl[2]; /* as two signed ints */ + u_int ul[2]; /* as two unsigned ints */ }; /* @@ -77,8 +80,7 @@ union uu { * and assembly. */ #define QUAD_BITS (sizeof(quad_t) * CHAR_BIT) -#define LONG_BITS (sizeof(long) * CHAR_BIT) -#define HALF_BITS (sizeof(long) * CHAR_BIT / 2) +#define HALF_BITS (sizeof(int) * CHAR_BIT / 2) /* * Extract high and low shortwords from longword, and move low shortword of From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 19:30:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 61662193 for ; Thu, 24 Jul 2014 19:30:23 +0000 (UTC) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 070ED2F4E for ; Thu, 24 Jul 2014 19:30:22 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i13so3479003qae.34 for ; Thu, 24 Jul 2014 12:30:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=ofR3fN/ezMekZAIkozwk17YpjraqpPG+Z7yEXUlJ8+Q=; b=Ys0YB+zieEe6CW+I9wJguss9hyG6StZ27qITDpcO3MKqtRa03vuEjqmFTdthYIwA4s eyXYOH7j+65anA8JmPXaPn149Oejz4FQwZWcLca6EICkSBUr1ayOk79ukFsbVM6fr+qK Y997cpZBRsNXlNNSMlWS1ZRMgLC+8COQm5NvF6BJQA+q2njTZRVhlsJzLm6AHnEv5O3p wbyeYLFP0hCepExPEqz8WQSpcu316/TSndKMj9p3oJ1ZT9bSWFnhdLDXABk6Zery1Hvo DWgtOnseK0I6wLzED/VtrGtDpeRPBEHfBKObkx1wHJK9IopXDwZJL0IF5nsGG0gEROA0 Oc4w== X-Gm-Message-State: ALoCoQl9KBF0o8+Xo4vufCOxRZ5BtiCfp/dFKknrNfcFyIB1Svk+mDbc8BdpXym3y3NfWhUmCpBC X-Received: by 10.224.152.5 with SMTP id e5mr18635684qaw.65.1406230216495; Thu, 24 Jul 2014 12:30:16 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Thu, 24 Jul 2014 12:29:56 -0700 (PDT) X-Originating-IP: [2620:0:1003:1007:ac3e:4bce:435e:6e80] In-Reply-To: <201407172226.s6HMQO0a035641@svn.freebsd.org> References: <201407172226.s6HMQO0a035641@svn.freebsd.org> From: Julio Merino Date: Thu, 24 Jul 2014 15:29:56 -0400 X-Google-Sender-Auth: vQnU4CP8ebti22Rad5e8JsrL-5k Message-ID: Subject: Re: svn commit: r268812 - head/etc/mtree To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 24 Jul 2014 19:30:23 -0000 On Thu, Jul 17, 2014 at 6:26 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Thu Jul 17 22:26:24 2014 > New Revision: 268812 > URL: http://svnweb.freebsd.org/changeset/base/268812 > > Log: > Add the mtree entry for yacc tests > > Modified: > head/etc/mtree/BSD.tests.dist > > Modified: head/etc/mtree/BSD.tests.dist > ============================================================================== > --- head/etc/mtree/BSD.tests.dist Thu Jul 17 22:22:38 2014 (r268811) > +++ head/etc/mtree/BSD.tests.dist Thu Jul 17 22:26:24 2014 (r268812) > @@ -266,6 +266,8 @@ > xargs > .. > yacc > + yacc > + .. > .. yacc within yacc? Something smells wrong. From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 19:35:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A368E670 for ; Thu, 24 Jul 2014 19:35:37 +0000 (UTC) Received: from mail-qa0-f51.google.com (mail-qa0-f51.google.com [209.85.216.51]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63672201C for ; Thu, 24 Jul 2014 19:35:37 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id k15so3470657qaq.10 for ; Thu, 24 Jul 2014 12:35:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=G7SblMrJWiJqxZEocawhl95FfVLH7QTLAgHzu+wFOSw=; b=Uxz9JrjLecOP0JlkobkHrSp+eqcdmZ7eEYN/n8q96hdDqSOxSZOsX+87WKvs9fzIJV Dg8JE7O9d0HxmnV+nl9CMtCdkdPIGBmVpQxgoJ7RT4hDHwY2ahoPM7fmJDatQ76uTlxW YQ306lM2Qs9kZ8IXoUiuaLYPLMHF/1DEfai4KRkhYxcZSBD9xkPXNq20k0hium1+Fiu+ 0FGOQCSJ4aJQDekJGNVQFzP5+A4WvlqyoqpB7q+844wLyIwyMt+vpdSslBjJfMme3R2v m0uL9sOIyAxxP8gy6ycwpjCJMgMB53HEWLqffA1D0zSw4xy2DvhcSRAcfxQ70Y4ApwjI NFgg== X-Gm-Message-State: ALoCoQmtcFtuN8pDsq9OFzWHhLN2svvXoInXpCLAxbqIeol12DlHgdXxhCJmGcCCQSFoVX0Mofvt X-Received: by 10.224.160.134 with SMTP id n6mr4620313qax.84.1406230536094; Thu, 24 Jul 2014 12:35:36 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Thu, 24 Jul 2014 12:35:15 -0700 (PDT) X-Originating-IP: [2620:0:1003:1007:ac3e:4bce:435e:6e80] In-Reply-To: <201407170712.s6H7CCdw096979@svn.freebsd.org> References: <201407170712.s6H7CCdw096979@svn.freebsd.org> From: Julio Merino Date: Thu, 24 Jul 2014 15:35:15 -0400 X-Google-Sender-Auth: curNF5G8ryDoiTic9s0r0hXN17w Message-ID: Subject: Re: svn commit: r268794 - in head: etc/mtree usr.bin/units usr.bin/units/tests To: Eitan Adler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 24 Jul 2014 19:35:37 -0000 On Thu, Jul 17, 2014 at 3:12 AM, Eitan Adler wrote: > Author: eadler > Date: Thu Jul 17 07:12:12 2014 > New Revision: 268794 > URL: http://svnweb.freebsd.org/changeset/base/268794 > > Log: > units(1): Add basic tests > Add some tests to help avoid breaking units > > Added: > head/usr.bin/units/tests/ > head/usr.bin/units/tests/Makefile (contents, props changed) > head/usr.bin/units/tests/units_basics.sh (contents, props changed) The convention says that this file should be called basics_test.sh. From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 19:55:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5C66EC5 for ; Thu, 24 Jul 2014 19:55:56 +0000 (UTC) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99E6421CB for ; Thu, 24 Jul 2014 19:55:56 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id i13so3482338qae.6 for ; Thu, 24 Jul 2014 12:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=mGgN64nnQyCjo74EC6eTDPAl2I+opXQBs16yyknb15o=; b=rFyOF2DGAtxTQD0m/MLymtyM0cinmoKEDwYshtx2bAuTrnWESE5KrZ0BZEUyD6Gi8g xqwMT87XzoJDOch/lk9ybr4TX2camwLjaz28u+T4G4CY7skATO+i/YJ1ciyJ7IPZo3Lu 55Otdx9xslb0Y/dyNb5+eWSHd/p81AG21AVeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=mGgN64nnQyCjo74EC6eTDPAl2I+opXQBs16yyknb15o=; b=MaQFT+BoXLUSCfkweIeYXhs3r1Cc+o1mB/2FxbMbpLgJO08QbvGE53kBS68nlUZbbl +52AAuQygzZbz674LxR9DAmZqScDnIUKqFLcBn/Tm0vIgMH+Ucmr6bHLjPQp+s/56aqS +fPTqwO9KPJ1qjhP082t5sX0f0QqhV0eVZYbmrJfTh6uvxgOLvUFzo/oq+bJx2/RiiDn BvLP53rFg6kn9oJ0SKlBajc1NU4y8OjM9g3oPJEcrLguzZTaFfshnyrw7+Z77oetkhQi 4ms82oKnOFKyQrAGaC6Hsdvnhvfv3/Q54DV7QQlAQ8i01QXmXo2QhBBtdBbAvsBuJi4X VeUA== X-Gm-Message-State: ALoCoQkuN4nVpd/bGe9qbj4SCYTiL+iFRi2klJmBCihTOSboROGs1Qf0/nM4RMHUSvf3B6OcouXb X-Received: by 10.140.23.37 with SMTP id 34mr18275311qgo.2.1406231755515; Thu, 24 Jul 2014 12:55:55 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.96.88.132 with HTTP; Thu, 24 Jul 2014 12:55:25 -0700 (PDT) In-Reply-To: References: <201407170712.s6H7CCdw096979@svn.freebsd.org> From: Eitan Adler Date: Thu, 24 Jul 2014 12:55:25 -0700 X-Google-Sender-Auth: EUz0riwrSG03j6UsRAuvciMnwz8 Message-ID: Subject: Re: svn commit: r268794 - in head: etc/mtree usr.bin/units usr.bin/units/tests To: Julio Merino Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 24 Jul 2014 19:55:57 -0000 On 24 July 2014 12:35, Julio Merino wrote: > On Thu, Jul 17, 2014 at 3:12 AM, Eitan Adler wrote: >> Author: eadler >> Date: Thu Jul 17 07:12:12 2014 >> New Revision: 268794 >> URL: http://svnweb.freebsd.org/changeset/base/268794 >> >> Log: >> units(1): Add basic tests >> Add some tests to help avoid breaking units >> >> Added: >> head/usr.bin/units/tests/ >> head/usr.bin/units/tests/Makefile (contents, props changed) >> head/usr.bin/units/tests/units_basics.sh (contents, props changed) > > The convention says that this file should be called basics_test.sh. My computer is out of commission at the moment. Would you mind making this change for me? Thanks for letting me know! -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 20:44:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED8B92EC; Thu, 24 Jul 2014 20:44:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB7C82639; Thu, 24 Jul 2014 20:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6OKiUWd068822; Thu, 24 Jul 2014 20:44:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6OKiUIs068821; Thu, 24 Jul 2014 20:44:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407242044.s6OKiUIs068821@svn.freebsd.org> From: John Baldwin Date: Thu, 24 Jul 2014 20:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269079 - head/lib/libc/gen 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.18 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, 24 Jul 2014 20:44:31 -0000 Author: jhb Date: Thu Jul 24 20:44:30 2014 New Revision: 269079 URL: http://svnweb.freebsd.org/changeset/base/269079 Log: POSIX says that passing a location returned by telldir() to seekdir() after an intervening call to rewinddir() is undefined, so reclaim any pending telldir() cookies in the directory when rewinddir() is called. CR: D459 Reviewed by: jilles MFC after: 1 week Modified: head/lib/libc/gen/rewinddir.c Modified: head/lib/libc/gen/rewinddir.c ============================================================================== --- head/lib/libc/gen/rewinddir.c Thu Jul 24 20:16:45 2014 (r269078) +++ head/lib/libc/gen/rewinddir.c Thu Jul 24 20:44:30 2014 (r269079) @@ -58,6 +58,7 @@ rewinddir(dirp) dirp->dd_seek = 0; } dirp->dd_loc = 0; + _reclaim_telldir(dirp); if (__isthreaded) _pthread_mutex_unlock(&dirp->dd_lock); } From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 22:00:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DE656E91; Thu, 24 Jul 2014 22:00:35 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BADD2D97; Thu, 24 Jul 2014 22:00:34 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id n3so24856wiv.13 for ; Thu, 24 Jul 2014 15:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=Ac+R4zAwC+j6m67ANPbpblqTTckcT3DHn0idE1NM7Tk=; b=w8TkSY7r7wqaoVgoc/6V9zD8CD94o3aQbfZDCZcIz4ngWvaMcOQTeYtryU2cchr3ic x7vIXD+uJCT4UYUAZs/ux147tKUmfXby/ZMjOahuWzcEaOzXHHjRFH1NYc8oDBRjMWku g0jqnTnX7ogk2awKD1qUCisUl3ByIHIR5x01pG9hTB77VRn7VbbfTI/T8e+64NPV4vGp nYg6FO/vW+kaIVbDI8xyQHf3J3KmtHq29osHj6sMgQNIwz/53Pm4So6FxDLVo5iBfSFC 4JcyG4ENCfYNiabpBI38iSWZq4GsLClQIB7uClJbNCLqB5F6Qc+VTtRLxGOspduIPq+5 Ektw== MIME-Version: 1.0 X-Received: by 10.180.189.210 with SMTP id gk18mr55143wic.82.1406239233082; Thu, 24 Jul 2014 15:00:33 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.194.203.134 with HTTP; Thu, 24 Jul 2014 15:00:33 -0700 (PDT) In-Reply-To: <201405251201.s4PC1DWX011526@svn.freebsd.org> References: <201405251201.s4PC1DWX011526@svn.freebsd.org> Date: Thu, 24 Jul 2014 16:00:33 -0600 X-Google-Sender-Auth: fGAnlu_hrWkFSAD3PjIsjjBCios Message-ID: Subject: Re: svn commit: r266650 - in head: contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-sh etc/mtree lib/atf/libatf-c lib/atf/libatf-c++ lib/atf/libatf-c++/tests lib/atf/libatf-c/tests lib... From: Alan Somers To: Julio Merino Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 24 Jul 2014 22:00:36 -0000 On Sun, May 25, 2014 at 6:01 AM, Julio Merino wrote: > Author: jmmv > Date: Sun May 25 12:01:13 2014 > New Revision: 266650 > URL: http://svnweb.freebsd.org/changeset/base/266650 > > Log: > Change libatf-c and libatf-c++ to be private libraries. > > We should not be leaking these interfaces to the outside world given > that it's much easier for third-party components to use the devel/atf > package from ports. > > As a side-effect, we can also drop the ATF pkgconfig and aclocal files > from the base system. Nothing in the base system needs these, and it > was quite ugly to have to get them installed only so that a few ports > could build. The offending ports have been fixed to depend on > devel/atf explicitly. > > Reviewed by: bapt > > Deleted: > head/contrib/atf/atf-c++/atf-c++.m4 > head/contrib/atf/atf-c++/atf-c++.pc.in > head/contrib/atf/atf-c/atf-c.m4 > head/contrib/atf/atf-c/atf-c.pc.in > head/contrib/atf/atf-c/atf-common.m4 > head/contrib/atf/atf-sh/atf-sh.m4 > head/contrib/atf/atf-sh/atf-sh.pc.in > Modified: > head/contrib/atf/FREEBSD-Xlist > head/etc/mtree/BSD.tests.dist > head/lib/atf/libatf-c++/Makefile > head/lib/atf/libatf-c++/tests/Makefile > head/lib/atf/libatf-c/Makefile > head/lib/atf/libatf-c/tests/Makefile > head/libexec/atf/atf-check/Makefile > head/share/mk/atf.test.mk > head/share/mk/bsd.libnames.mk > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.bin/atf/atf-sh/Makefile > Do you intend to MFC this change to stable/10 ? From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 23:01:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 556F3B90; Thu, 24 Jul 2014 23:01:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A4FD2249; Thu, 24 Jul 2014 23:01:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ON1sBd050463; Thu, 24 Jul 2014 23:01:54 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6ON1sQ3050462; Thu, 24 Jul 2014 23:01:54 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407242301.s6ON1sQ3050462@svn.freebsd.org> From: Neel Natu Date: Thu, 24 Jul 2014 23:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269080 - head/sys/amd64/vmm 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.18 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, 24 Jul 2014 23:01:54 -0000 Author: neel Date: Thu Jul 24 23:01:53 2014 New Revision: 269080 URL: http://svnweb.freebsd.org/changeset/base/269080 Log: Fix a couple of issues in the PUSH emulation: It is not possible to PUSH a 32-bit operand on the stack in 64-bit mode. The default operand size for PUSH is 64-bits and the operand size override prefix changes that to 16-bits. vm_copy_setup() can return '1' if it encounters a fault when walking the guest page tables. This is a guest issue and is now handled properly by resuming the guest to handle the fault. Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Thu Jul 24 20:44:30 2014 (r269079) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Thu Jul 24 23:01:53 2014 (r269080) @@ -726,11 +726,19 @@ emulate_push(void *vm, int vcpuid, uint6 /* * From "Address-Size Attributes for Stack Accesses", Intel SDL, Vol 1 */ - if (paging->cpu_mode == CPU_MODE_REAL) + if (paging->cpu_mode == CPU_MODE_REAL) { stackaddrsize = 2; - else if (paging->cpu_mode == CPU_MODE_64BIT) + } else if (paging->cpu_mode == CPU_MODE_64BIT) { + /* + * "Stack Manipulation Instructions in 64-bit Mode", SDM, Vol 3 + * - Stack pointer size is always 64-bits. + * - PUSH/POP of 32-bit values is not possible in 64-bit mode. + * - 16-bit PUSH/POP is supported by using the operand size + * override prefix (66H). + */ stackaddrsize = 8; - else { + size = vie->opsize_override ? 2 : 8; + } else { /* * In protected or compability mode the 'B' flag in the * stack-segment descriptor determines the size of the @@ -773,8 +781,10 @@ emulate_push(void *vm, int vcpuid, uint6 error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, PROT_WRITE, copyinfo, nitems(copyinfo)); - if (error) - return (error); + if (error == -1) + return (-1); /* Unrecoverable error */ + else if (error == 1) + return (0); /* Return to guest to handle page fault */ error = memread(vm, vcpuid, mmio_gpa, &val, size, arg); if (error == 0) { From owner-svn-src-head@FreeBSD.ORG Thu Jul 24 23:14:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EA42E71; Thu, 24 Jul 2014 23:14:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD3D23C9; Thu, 24 Jul 2014 23:14:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ONE3NP055728; Thu, 24 Jul 2014 23:14:03 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6ONE3p7055727; Thu, 24 Jul 2014 23:14:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201407242314.s6ONE3p7055727@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 24 Jul 2014 23:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269081 - head/sys/fs/nullfs 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.18 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, 24 Jul 2014 23:14:04 -0000 Author: kib Date: Thu Jul 24 23:14:03 2014 New Revision: 269081 URL: http://svnweb.freebsd.org/changeset/base/269081 Log: Fix typo. MFC after: 3 days Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Jul 24 23:01:53 2014 (r269080) +++ head/sys/fs/nullfs/null_vnops.c Thu Jul 24 23:14:03 2014 (r269081) @@ -738,7 +738,7 @@ null_reclaim(struct vop_reclaim_args *ap lowervp = xp->null_lowervp; KASSERT(lowervp != NULL && vp->v_vnlock != &vp->v_lock, - ("Reclaiming inclomplete null vnode %p", vp)); + ("Reclaiming incomplete null vnode %p", vp)); null_hashrem(xp); /* From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 00:56:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 230DD864 for ; Fri, 25 Jul 2014 00:56:37 +0000 (UTC) Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D29F52CD6 for ; Fri, 25 Jul 2014 00:56:36 +0000 (UTC) Received: by mail-qg0-f42.google.com with SMTP id j5so4251082qga.15 for ; Thu, 24 Jul 2014 17:56:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=iv4a91uAh9gG51raP2po9xMMkZXYC4K7ugq8UQLsSjI=; b=RLIrHEMtGzKAKqYg0Fo4CfYR3U+27yoQSncpHo+ZCF7e/5bO4DrZIdL+OzIYNtM0dm I9noUcMEjhrBjBsjbHdNlnop0+beYYBwjk6b57fmTh4CcrSlFdc6wbhtEQHvNudkSryM TsJwVQV2ZbmqdziiOxvUg29otTAcYDls6B435t/Jb//jba9B/IHeV+fucI5GPvft+EEy visw/7DwTLW+endg3pJaZ1qM8/fzrllopjPgMkrQyZMi2OGm4TtAafl0Zq3GqrnXAv8g GcSyjeCJymwpmKAEDyNXBKw12pi3u0FP4LnCO1yd+9y/I4zFkb8HS3MtFRpisOLpHc61 INTw== X-Gm-Message-State: ALoCoQmeM4OBHnjU/KwRN2axIgn5Em+UUHPevIONw3Bgu6NrBFNcTjk71oOBsLzCySBXs6f0tuws X-Received: by 10.224.160.134 with SMTP id n6mr7332851qax.84.1406249795727; Thu, 24 Jul 2014 17:56:35 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Thu, 24 Jul 2014 17:56:15 -0700 (PDT) X-Originating-IP: [184.153.117.174] In-Reply-To: References: <201405251201.s4PC1DWX011526@svn.freebsd.org> From: Julio Merino Date: Thu, 24 Jul 2014 20:56:15 -0400 X-Google-Sender-Auth: tj79VsafC0lF6vdoDIndfPp5Fyw Message-ID: Subject: Re: svn commit: r266650 - in head: contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-sh etc/mtree lib/atf/libatf-c lib/atf/libatf-c++ lib/atf/libatf-c++/tests lib/atf/libatf-c/tests lib... To: Alan Somers Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 00:56:37 -0000 On Thu, Jul 24, 2014 at 6:00 PM, Alan Somers wrote: > On Sun, May 25, 2014 at 6:01 AM, Julio Merino wrote: >> Author: jmmv >> Date: Sun May 25 12:01:13 2014 >> New Revision: 266650 >> URL: http://svnweb.freebsd.org/changeset/base/266650 >> >> Log: >> Change libatf-c and libatf-c++ to be private libraries. > > Do you intend to MFC this change to stable/10 ? Yes, but I thought I had already done that! I have several pending MFCs to catch up with... will try to deal with them soon. From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 01:29:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E932AE10; Fri, 25 Jul 2014 01:29:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD5D92F7A; Fri, 25 Jul 2014 01:29:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6P1TNgK017146; Fri, 25 Jul 2014 01:29:23 GMT (envelope-from jmmv@svn.freebsd.org) Received: (from jmmv@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6P1TNeT017138; Fri, 25 Jul 2014 01:29:23 GMT (envelope-from jmmv@svn.freebsd.org) Message-Id: <201407250129.s6P1TNeT017138@svn.freebsd.org> From: Julio Merino Date: Fri, 25 Jul 2014 01:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269084 - in head: tools/build/mk usr.bin/units/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.18 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, 25 Jul 2014 01:29:24 -0000 Author: jmmv Date: Fri Jul 25 01:29:22 2014 New Revision: 269084 URL: http://svnweb.freebsd.org/changeset/base/269084 Log: Fix structure of new tests (r268794) for usr.bin/units. - Make sure the tests go into the right directory. The location was wrong so they were overwriting the bin/chown tests! - Use the right naming scheme for the test program. - Remove the svn:executable property from the shell script. Added: - copied unchanged from r269083, head/usr.bin/units/tests/units_basics.sh Directory Properties: head/usr.bin/units/tests/basics_test.sh (props changed) Deleted: head/usr.bin/units/tests/units_basics.sh Modified: head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/units/tests/Makefile Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jul 25 00:35:43 2014 (r269083) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Jul 25 01:29:22 2014 (r269084) @@ -4167,6 +4167,7 @@ OLD_FILES+=usr/share/aclocal/atf-c.m4 OLD_FILES+=usr/share/aclocal/atf-common.m4 OLD_FILES+=usr/share/aclocal/atf-sh.m4 OLD_DIRS+=usr/share/aclocal +OLD_FILES+=usr/tests/bin/chown/units_basics OLD_FILES+=usr/tests/usr.bin/atf/Kyuafile OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/Kyuafile OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/atf_check_test Modified: head/usr.bin/units/tests/Makefile ============================================================================== --- head/usr.bin/units/tests/Makefile Fri Jul 25 00:35:43 2014 (r269083) +++ head/usr.bin/units/tests/Makefile Fri Jul 25 01:29:22 2014 (r269084) @@ -2,8 +2,8 @@ .include -TESTSDIR= ${TESTSBASE}/bin/chown +TESTSDIR= ${TESTSBASE}/usr.bin/units -TAP_TESTS_SH= units_basics +TAP_TESTS_SH= basics_test .include Copied: head/usr.bin/units/tests/basics_test.sh (from r269083, head/usr.bin/units/tests/units_basics.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/units/tests/basics_test.sh Fri Jul 25 01:29:22 2014 (r269084, copy of r269083, head/usr.bin/units/tests/units_basics.sh) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..3" + +assert_equals() { + testnum="$1" + expected="$2" + fn="$3" + if [ "$expected" = "$($fn)" ] + then + echo "ok $testnum - $fn" + else + echo "not ok $testnum - $fn" + fi +} + +assert_equals 1 1 "units -t ft ft" +assert_equals 2 12 "units -t ft in" +assert_equals 3 0.083333333 "units -t in ft" From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 01:37:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DE7D1CE for ; Fri, 25 Jul 2014 01:37:45 +0000 (UTC) Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C4022031 for ; Fri, 25 Jul 2014 01:37:44 +0000 (UTC) Received: by mail-qg0-f44.google.com with SMTP id e89so4335054qgf.17 for ; Thu, 24 Jul 2014 18:37:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=bHkf1ZAlfvpVA0klbc1AK850yM2OlC9lpiCHE/cBAN4=; b=bJiz5QFjRIXjt6UUG4OeJg2ID8oehGkEpbTyzrYXG0UpFTf7MwRgSmanWt+1VG2Duq 89h+68H7d5cuPaVvmd7LwrCpwLfB+/Yya4hQ8/Bjflx8tIprUvI+Qvhy1XeE0vwNKuaY 1m+EVw1yVxzaBJzShDJkvC9M187OqYG2HyQhiUfP+DaPz8Xvpft1cjyWlLItoJ61kV67 tI5pRzkGasJmbzPljSlsWt7iYOVoxtOhp9TbUZgbKrLZWIOmNLphRJK4sUCmxlwtm5eT 1alRJVBm+br9jHGA040aSGY4+fAiLezcLH3YZtLQyd5XSRln07wgzq28uXdoGFi4vDd4 YaOA== X-Gm-Message-State: ALoCoQmUFgQI3llgOSjv9/ebtMM5Qoe3XqTcfxuAYePV7nhYDRpPaVVjw126Td5ntfC5o3PBnl6Y X-Received: by 10.140.24.140 with SMTP id 12mr6371401qgr.11.1406251798806; Thu, 24 Jul 2014 18:29:58 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Thu, 24 Jul 2014 18:29:38 -0700 (PDT) X-Originating-IP: [184.153.117.174] In-Reply-To: References: <201407170712.s6H7CCdw096979@svn.freebsd.org> From: Julio Merino Date: Thu, 24 Jul 2014 21:29:38 -0400 X-Google-Sender-Auth: VaUa7G5axO4is1Q5T3YPMy7e8ZY Message-ID: Subject: Re: svn commit: r268794 - in head: etc/mtree usr.bin/units usr.bin/units/tests To: Eitan Adler Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 01:37:45 -0000 On Thu, Jul 24, 2014 at 3:55 PM, Eitan Adler wrote: > My computer is out of commission at the moment. Would you mind making > this change for me? Thanks for letting me know! Renamed. And also fixed the value of TESTSDIR to get these tests in the right place. From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 01:39:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FC4C2BF; Fri, 25 Jul 2014 01:39:53 +0000 (UTC) Received: from felyko.com (felyko.com [IPv6:2001:470:1:2d5:26:3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 620BF2052; Fri, 25 Jul 2014 01:39:53 +0000 (UTC) Received: from fukuyama.hsd1.ca.comcast.net (unknown [73.162.13.215]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 3FE2334A9E4; Thu, 24 Jul 2014 18:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1406252384; bh=uL79fjOOeVpp8EUK9rdW50P8kasDBgHIK9RbQRfY1TQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=RCBkQ8xBIZwbbPJfZwEDOxYPRwzDaOzZfXERY7kCNyl86icsjHLQPjZHGiuyQLA4K 2mo/CCZy+hM2vWbYkiuslznw1IsPBp5IkDiPgyyjcfZgyQm68KbySI7Z1LQTjgPgKR fn9ZMTAsbGsYlFCtLaEGNa8Fc2iExdVTB8sAr4pA= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r269077 - head/lib/libstand From: Rui Paulo In-Reply-To: <201407241906.s6OJ6FkI020182@svn.freebsd.org> Date: Thu, 24 Jul 2014 18:39:42 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201407241906.s6OJ6FkI020182@svn.freebsd.org> To: Sean Bruno X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 01:39:53 -0000 On Jul 24, 2014, at 12:06, Sean Bruno wrote: > Author: sbruno > Date: Thu Jul 24 19:06:15 2014 > New Revision: 269077 > URL: http://svnweb.freebsd.org/changeset/base/269077 > > Log: > libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not > true on amd64 It *was* true until libstand changed to 64 bit a few months ago. :-) -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 02:28:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4DA48CEF; Fri, 25 Jul 2014 02:28:26 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 21175241F; Fri, 25 Jul 2014 02:28:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 314E33808C; Thu, 24 Jul 2014 21:28:19 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id PtdsRMxqHCWt; Thu, 24 Jul 2014 21:28:19 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 94C883808A; Thu, 24 Jul 2014 21:28:18 -0500 (CDT) Message-ID: <53D1C0C1.4010806@freebsd.org> Date: Thu, 24 Jul 2014 19:28:17 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Rui Paulo , Sean Bruno Subject: Re: svn commit: r269077 - head/lib/libstand References: <201407241906.s6OJ6FkI020182@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 02:28:26 -0000 On 07/24/14 18:39, Rui Paulo wrote: > On Jul 24, 2014, at 12:06, Sean Bruno wrote: > >> Author: sbruno >> Date: Thu Jul 24 19:06:15 2014 >> New Revision: 269077 >> URL: http://svnweb.freebsd.org/changeset/base/269077 >> >> Log: >> libstand's qdivrem.c assumes that sizeof(int) == sizeof(long), this is not >> true on amd64 > It *was* true until libstand changed to 64 bit a few months ago. :-) > > -- > Rui Paulo > > > > It was always 64-bit on sparc64, though. And presumably on ia64 as well. And alpha. -Nathan From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 06:53:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B5628E6; Fri, 25 Jul 2014 06:53:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC27C2B21; Fri, 25 Jul 2014 06:53:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6P6rLNj064858; Fri, 25 Jul 2014 06:53:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6P6rKUH064854; Fri, 25 Jul 2014 06:53:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407250653.s6P6rKUH064854@svn.freebsd.org> From: Xin LI Date: Fri, 25 Jul 2014 06:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269086 - 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.18 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, 25 Jul 2014 06:53:22 -0000 Author: delphij Date: Fri Jul 25 06:53:20 2014 New Revision: 269086 URL: http://svnweb.freebsd.org/changeset/base/269086 Log: As of r268075, the responsibility of rounding up buffer to optimal size have been transferred from zio_compress_data to its caller. Therefore, passing the 'minblocksize' down will be a no-op. Eliminate the parameter to reduce diff against upstream. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 25 03:24:00 2014 (r269085) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 25 06:53:20 2014 (r269086) @@ -5205,7 +5205,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); + cdata, l2hdr->b_asize); rounded = P2ROUNDUP(csize, (size_t)SPA_MINBLOCKSIZE); if (rounded > csize) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 25 03:24:00 2014 (r269085) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 25 06:53:20 2014 (r269086) @@ -81,7 +81,7 @@ extern int lz4_decompress(void *src, voi * Compress and decompress data if necessary. */ extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst, - size_t s_len, size_t minblocksize); + size_t s_len); extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 03:24:00 2014 (r269085) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 06:53:20 2014 (r269086) @@ -1160,10 +1160,8 @@ zio_write_bp_init(zio_t **ziop) } if (compress != ZIO_COMPRESS_OFF) { - metaslab_class_t *mc = spa_normal_class(spa); void *cbuf = zio_buf_alloc(lsize); - psize = zio_compress_data(compress, zio->io_data, cbuf, lsize, - (size_t)metaslab_class_get_minblocksize(mc)); + psize = zio_compress_data(compress, zio->io_data, cbuf, lsize); if (psize == 0 || psize == lsize) { compress = ZIO_COMPRESS_OFF; zio_buf_free(cbuf, lsize); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Fri Jul 25 03:24:00 2014 (r269085) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Fri Jul 25 06:53:20 2014 (r269086) @@ -97,8 +97,7 @@ zio_compress_select(enum zio_compress ch } size_t -zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len, - size_t minblocksize) +zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len) { uint64_t *word, *word_end; size_t c_len, d_len; From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 10:27:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51CFB4F5; Fri, 25 Jul 2014 10:27:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6CF2F5F; Fri, 25 Jul 2014 10:27:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PARafo060124; Fri, 25 Jul 2014 10:27:36 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PARa79060123; Fri, 25 Jul 2014 10:27:36 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201407251027.s6PARa79060123@svn.freebsd.org> From: Kevin Lo Date: Fri, 25 Jul 2014 10:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269087 - head/share/man/man7 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.18 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, 25 Jul 2014 10:27:37 -0000 Author: kevlo Date: Fri Jul 25 10:27:36 2014 New Revision: 269087 URL: http://svnweb.freebsd.org/changeset/base/269087 Log: Add net80211 and minor cleanup. Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Fri Jul 25 06:53:20 2014 (r269086) +++ head/share/man/man7/hier.7 Fri Jul 25 10:27:36 2014 (r269087) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 25, 2013 +.Dd July 25, 2014 .Dt HIER 7 .Os .Sh NAME @@ -222,6 +222,8 @@ WaveLAN driver .El .It Pa fs/ .Bl -tag -width ".Pa kerberos5/" -compact +.It Pa cd9660/ +iso9660 file system .It Pa fdescfs/ per-process file descriptors file system .It Pa fifofs/ @@ -261,11 +263,6 @@ STRIPE GEOM class .Pp .It Pa isc/ ISC utility library libisc include files -.It Pa isofs/ -.Bl -tag -width ".Pa kerberos5/" -compact -.It Pa cd9660/ -iso9660 file system -.El .It Pa libmilter/ C include files for libmilter, the @@ -275,6 +272,10 @@ mail filter API machine-specific C include files .It Pa net/ miscellaneous network C include files +.It Pa net80211/ +C include files for 802.11 wireless networking; +see +.Xr net80211 4 .It Pa netinet/ C include files for Internet standard protocols; see From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 11:29:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B65C58A8; Fri, 25 Jul 2014 11:29:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33B224F3; Fri, 25 Jul 2014 11:29:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PBTj4Z087565; Fri, 25 Jul 2014 11:29:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PBTjOU087564; Fri, 25 Jul 2014 11:29:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201407251129.s6PBTjOU087564@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 25 Jul 2014 11:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269088 - head/sys/cam/ctl 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.18 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, 25 Jul 2014 11:29:45 -0000 Author: trasz Date: Fri Jul 25 11:29:45 2014 New Revision: 269088 URL: http://svnweb.freebsd.org/changeset/base/269088 Log: Fix ctl(4) kldload failure that manifested like this: link_elf_obj: symbol icl_pdu_new_bhs undefined PR: 192031 Submitted by: Nils Beyer (earlier version) MFC after: 3 days Sponsored by: FreeBSD Foundation Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 25 10:27:36 2014 (r269087) +++ head/sys/cam/ctl/ctl_frontend_iscsi.c Fri Jul 25 11:29:45 2014 (r269088) @@ -179,6 +179,7 @@ static struct ctl_frontend cfiscsi_front .ioctl = cfiscsi_ioctl, }; CTL_FRONTEND_DECLARE(ctlcfiscsi, cfiscsi_frontend); +MODULE_DEPEND(ctlcfiscsi, icl, 1, 1, 1); static struct icl_pdu * cfiscsi_pdu_new_response(struct icl_pdu *request, int flags) From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 13:45:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5367840D for ; Fri, 25 Jul 2014 13:45:18 +0000 (UTC) Received: from mail-qg0-f49.google.com (mail-qg0-f49.google.com [209.85.192.49]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1098D22D0 for ; Fri, 25 Jul 2014 13:45:17 +0000 (UTC) Received: by mail-qg0-f49.google.com with SMTP id j107so5098739qga.36 for ; Fri, 25 Jul 2014 06:45:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=uA0mBwldoEKUEvWCM+WxHIPLy5yPBIWV8IZ7aGG5Xq8=; b=SmIe/+kgksK0MhMuGJ9/Vnqggsf8NThxOLV33Upq8vmJb48VC56T38C9u+AgEDq1eH zx1PBHE8uCWSxs92OCJNh8IHdcUpHhWmQTMGr0pYPbfcrQnszyMw1NWtgtGI4JEo0M8N Rl6UOQXgPEr2Kaxj0VHhBZWCPCHkdk+4krdwtCgoaChLD3ayEQQ0ssfc8jgLy7xEiN/C 6HuHaRGR2vDXoMIL9HiJMn0Muio+CrEFM3pHIEjvcTIU9IC/Xc/scH6ONkLnwt20PkIP ALESQnNdtW0ELpie4TgaZEUe48/kfIs1NB8jPkDx7ketEevB5lFpf5DpUHsKh5W6N+fV d0yQ== X-Gm-Message-State: ALoCoQlrSc0cRvDvggSY6n3zeXMb2yKkPHuPjHGp+gGlFitl60pi3ypTkhCL11wUEzAk382bMvFB X-Received: by 10.224.26.146 with SMTP id e18mr27816019qac.13.1406295916451; Fri, 25 Jul 2014 06:45:16 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Fri, 25 Jul 2014 06:44:56 -0700 (PDT) X-Originating-IP: [2620:0:1003:1007:48e0:b353:4608:ba98] In-Reply-To: <201407172222.s6HMMcC6034903@svn.freebsd.org> References: <201407172222.s6HMMcC6034903@svn.freebsd.org> From: Julio Merino Date: Fri, 25 Jul 2014 09:44:56 -0400 X-Google-Sender-Auth: av4ori33VPcsn1l3D7UnL1is0fc Message-ID: Subject: Re: svn commit: r268811 - in head: contrib/byacc contrib/byacc/package contrib/byacc/package/debian contrib/byacc/package/pkgsrc contrib/byacc/test contrib/byacc/test/btyacc contrib/byacc/test/yacc usr... To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 13:45:18 -0000 On Thu, Jul 17, 2014 at 6:22 PM, Baptiste Daroussin wrote: > Author: bapt > Date: Thu Jul 17 22:22:38 2014 > New Revision: 268811 > URL: http://svnweb.freebsd.org/changeset/base/268811 > > Log: > Update to byacc 20140715 (only concerns regression tests being fixed) > Directly use regression test from upstream > > PR: 191020 > Submitted by: gcooper (yaneurabeya@gmail.com) > > Added: > head/usr.bin/yacc/tests/yacc_tests.sh (contents, props changed) The tests handling in this change is severely broken. The following files were removed from /usr/tests: -/usr/tests/usr.bin/yacc/Kyuafile -/usr/tests/usr.bin/yacc/ftp.y -/usr/tests/usr.bin/yacc/legacy_test -/usr/tests/usr.bin/yacc/regress.00.out -/usr/tests/usr.bin/yacc/regress.01.out -/usr/tests/usr.bin/yacc/regress.02.out -/usr/tests/usr.bin/yacc/regress.03.out -/usr/tests/usr.bin/yacc/regress.04.out -/usr/tests/usr.bin/yacc/regress.05.out -/usr/tests/usr.bin/yacc/regress.06.out -/usr/tests/usr.bin/yacc/regress.07.out -/usr/tests/usr.bin/yacc/regress.08.out -/usr/tests/usr.bin/yacc/regress.09.out -/usr/tests/usr.bin/yacc/regress.10.out -/usr/tests/usr.bin/yacc/regress.11.out -/usr/tests/usr.bin/yacc/regress.12.out -/usr/tests/usr.bin/yacc/regress.13.out -/usr/tests/usr.bin/yacc/regress.14.out -/usr/tests/usr.bin/yacc/regress.sh -/usr/tests/usr.bin/yacc/undefined.y ... yet no entries exist in OptionalObsoleteFiles.mk for them. Also, note that the Kyuafile is now gone so these tests are useless where they are as they cannot be executed. Please fix. From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 14:47:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 391334D7; Fri, 25 Jul 2014 14:47:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 267C62977; Fri, 25 Jul 2014 14:47:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PElj1t081979; Fri, 25 Jul 2014 14:47:45 GMT (envelope-from allanjude@svn.freebsd.org) Received: (from allanjude@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PEljCC081978; Fri, 25 Jul 2014 14:47:45 GMT (envelope-from allanjude@svn.freebsd.org) Message-Id: <201407251447.s6PEljCC081978@svn.freebsd.org> From: Allan Jude Date: Fri, 25 Jul 2014 14:47:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269089 - head/games/fortune/datfiles 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.18 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, 25 Jul 2014 14:47:45 -0000 Author: allanjude (doc committer) Date: Fri Jul 25 14:47:44 2014 New Revision: 269089 URL: http://svnweb.freebsd.org/changeset/base/269089 Log: Update the freebsd-tips example to use drill instead of dig since bind is no longer in base CR: D460 Approved by: bcr (mentor) Modified: head/games/fortune/datfiles/freebsd-tips Modified: head/games/fortune/datfiles/freebsd-tips ============================================================================== --- head/games/fortune/datfiles/freebsd-tips Fri Jul 25 11:29:45 2014 (r269088) +++ head/games/fortune/datfiles/freebsd-tips Fri Jul 25 14:47:44 2014 (r269089) @@ -231,10 +231,10 @@ is running FreeBSD at the time) to quick To erase a line you've written at the command prompt, use "Ctrl-U". -- Dru % -To find out the hostname associated with an IP address, use +To find the hostname associated with an IP address, use - dig -x IP_address - -- Dru + drill -x IP_address + -- Allan Jude % To obtain a neat PostScript rendering of a manual page, use ``-t'' switch of the man(1) utility: ``man -t ''. For example: From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 17:09:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C4E5C7B; Fri, 25 Jul 2014 17:09:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FCF82761; Fri, 25 Jul 2014 17:09:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PH9mS7047093; Fri, 25 Jul 2014 17:09:48 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PH9mfU047092; Fri, 25 Jul 2014 17:09:48 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201407251709.s6PH9mfU047092@svn.freebsd.org> From: Warren Block Date: Fri, 25 Jul 2014 17:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269091 - head/sbin/setkey 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.18 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, 25 Jul 2014 17:09:49 -0000 Author: wblock (doc committer) Date: Fri Jul 25 17:09:48 2014 New Revision: 269091 URL: http://svnweb.freebsd.org/changeset/base/269091 Log: Fix spelling of Camellia algorithm. While here, replace blank lines between examples with actual .Pp breaks. PR: 192067 Submitted by: dmitry2004@yandex.ru MFC after: 1 week Modified: head/sbin/setkey/setkey.8 Modified: head/sbin/setkey/setkey.8 ============================================================================== --- head/sbin/setkey/setkey.8 Fri Jul 25 15:07:07 2014 (r269090) +++ head/sbin/setkey/setkey.8 Fri Jul 25 17:09:48 2014 (r269091) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2006 +.Dd July 25, 2014 .Dt SETKEY 8 .Os .\" @@ -514,7 +514,7 @@ the SA from the key exchange daemon. A value of .Li default tells the kernel to use the system wide default protocol -e.g.\& the one from the +e.g.,\& the one from the .Li esp_trans_deflev sysctl variable, when the kernel processes the packet. A value of @@ -627,7 +627,7 @@ des-deriv 64 ipsec-ciph-des-derived-01 3des-deriv 192 no document rijndael-cbc 128/192/256 rfc3602 aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03 -camllia-cbc 128/192/256 rfc4312 +camellia-cbc 128/192/256 rfc4312 .Ed .Pp Note that the first 128/192/256 bits of a key for @@ -656,47 +656,46 @@ des-cbc encryption algorithm. .Bd -literal -offset indent add 3ffe:501:4819::1 3ffe:501:481d::1 esp 123457 -E des-cbc 0x3ffe05014819ffff ; - +.Pp .Ed .\" Add an authentication SA between two FQDN specified hosts: .Bd -literal -offset indent add -6 myhost.example.com yourhost.example.com ah 123456 -A hmac-sha1 "AH SA configuration!" ; - +.Pp .Ed Use both ESP and AH between two numerically specified hosts: .Bd -literal -offset indent add 10.0.11.41 10.0.11.33 esp 0x10001 -E des-cbc 0x3ffe05014819ffff -A hmac-md5 "authentication!!" ; - +.Pp .Ed Get the SA information associated with first example above: .Bd -literal -offset indent get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ; - +.Pp .Ed Flush all entries from the database: .Bd -literal -offset indent flush ; - +.Pp .Ed Dump the ESP entries from the database: .Bd -literal -offset indent dump esp ; - +.Pp .Ed Add a security policy between two networks that uses ESP in tunnel mode: .Bd -literal -offset indent spdadd 10.0.11.41/32[21] 10.0.11.33/32[any] any -P out ipsec esp/tunnel/192.168.0.1-192.168.1.2/require ; - +.Pp .Ed Use TCP MD5 between two numerically specified hosts: .Bd -literal -offset indent add 10.1.10.34 10.1.10.36 tcp 0x1000 -A tcp-md5 "TCP-MD5 BGP secret" ; - .Ed .\" .Sh SEE ALSO From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 18:20:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 791B4DAA; Fri, 25 Jul 2014 18:20:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59E2A2E14; Fri, 25 Jul 2014 18:20:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PIKvgw082013; Fri, 25 Jul 2014 18:20:57 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PIKvJU082012; Fri, 25 Jul 2014 18:20:57 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201407251820.s6PIKvJU082012@svn.freebsd.org> From: Ed Maste Date: Fri, 25 Jul 2014 18:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269092 - head/usr.bin/elfdump 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.18 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, 25 Jul 2014 18:20:57 -0000 Author: emaste Date: Fri Jul 25 18:20:56 2014 New Revision: 269092 URL: http://svnweb.freebsd.org/changeset/base/269092 Log: elfdump: Improve section type reporting The SHT range 0x70000000-0x7fffffff is processor-specific. Pass the ELF machine type header to sh_types so the section header type name can be reported correctly for the given processor. For all ranges report the actual value for unknown types. Add MIPS-specific type SHT_MIPS_OPTIONS. CR: D483 Reviewed by: sbruno, marcel Sponsored by: DARPA, AFRL Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Fri Jul 25 17:09:48 2014 (r269091) +++ head/usr.bin/elfdump/elfdump.c Fri Jul 25 18:20:56 2014 (r269092) @@ -303,40 +303,76 @@ static const char *p_flags[] = { /* http://www.sco.com/developers/gabi/latest/ch4.sheader.html#sh_type */ static const char * -sh_types(u_int64_t sht) { - switch (sht) { - case 0: return "SHT_NULL"; - case 1: return "SHT_PROGBITS"; - case 2: return "SHT_SYMTAB"; - case 3: return "SHT_STRTAB"; - case 4: return "SHT_RELA"; - case 5: return "SHT_HASH"; - case 6: return "SHT_DYNAMIC"; - case 7: return "SHT_NOTE"; - case 8: return "SHT_NOBITS"; - case 9: return "SHT_REL"; - case 10: return "SHT_SHLIB"; - case 11: return "SHT_DYNSYM"; - case 14: return "SHT_INIT_ARRAY"; - case 15: return "SHT_FINI_ARRAY"; - case 16: return "SHT_PREINIT_ARRAY"; - case 17: return "SHT_GROUP"; - case 18: return "SHT_SYMTAB_SHNDX"; - /* 0x60000000 - 0x6fffffff operating system-specific semantics */ - case 0x6ffffff0: return "XXX:VERSYM"; - case 0x6ffffff4: return "SHT_SUNW_dof"; - case 0x6ffffff7: return "SHT_GNU_LIBLIST"; - case 0x6ffffffc: return "XXX:VERDEF"; - case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef"; - case 0x6ffffffe: return "SHT_SUNW(GNU)_verneed"; - case 0x6fffffff: return "SHT_SUNW(GNU)_versym"; - /* 0x70000000 - 0x7fffffff processor-specific semantics */ - case 0x70000000: return "SHT_IA_64_EXT"; - case 0x70000001: return "SHT_IA_64_UNWIND"; - case 0x7ffffffd: return "XXX:AUXILIARY"; - case 0x7fffffff: return "XXX:FILTER"; - /* 0x80000000 - 0xffffffff application programs */ - default: return "ERROR: SHT NOT DEFINED"; +sh_types(uint64_t machine, uint64_t sht) { + static char unknown_buf[64]; + + if (sht < 0x60000000) { + switch (sht) { + case 0: return "SHT_NULL"; + case 1: return "SHT_PROGBITS"; + case 2: return "SHT_SYMTAB"; + case 3: return "SHT_STRTAB"; + case 4: return "SHT_RELA"; + case 5: return "SHT_HASH"; + case 6: return "SHT_DYNAMIC"; + case 7: return "SHT_NOTE"; + case 8: return "SHT_NOBITS"; + case 9: return "SHT_REL"; + case 10: return "SHT_SHLIB"; + case 11: return "SHT_DYNSYM"; + case 14: return "SHT_INIT_ARRAY"; + case 15: return "SHT_FINI_ARRAY"; + case 16: return "SHT_PREINIT_ARRAY"; + case 17: return "SHT_GROUP"; + case 18: return "SHT_SYMTAB_SHNDX"; + } + snprintf(unknown_buf, sizeof(unknown_buf), + "ERROR: SHT %ju NOT DEFINED", (uintmax_t)sht); + return (unknown_buf); + } else if (sht < 0x70000000) { + /* 0x60000000-0x6fffffff operating system-specific semantics */ + switch (sht) { + case 0x6ffffff0: return "XXX:VERSYM"; + case 0x6ffffff4: return "SHT_SUNW_dof"; + case 0x6ffffff7: return "SHT_GNU_LIBLIST"; + case 0x6ffffffc: return "XXX:VERDEF"; + case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef"; + case 0x6ffffffe: return "SHT_SUNW(GNU)_verneed"; + case 0x6fffffff: return "SHT_SUNW(GNU)_versym"; + } + snprintf(unknown_buf, sizeof(unknown_buf), + "ERROR: OS-SPECIFIC SHT 0x%jx NOT DEFINED", + (uintmax_t)sht); + return (unknown_buf); + } else if (sht < 0x80000000) { + /* 0x70000000-0x7fffffff processor-specific semantics */ + switch (machine) { + case EM_MIPS: + switch (sht) { + case 0x7000000d: return "SHT_MIPS_OPTIONS"; + } + break; + case EM_IA_64: + switch (sht) { + case 0x70000000: return "SHT_IA_64_EXT"; + case 0x70000001: return "SHT_IA_64_UNWIND"; + } + break; + } + switch (sht) { + case 0x7ffffffd: return "XXX:AUXILIARY"; + case 0x7fffffff: return "XXX:FILTER"; + } + snprintf(unknown_buf, sizeof(unknown_buf), + "ERROR: PROCESSOR-SPECIFIC SHT 0x%jx NOT DEFINED", + (uintmax_t)sht); + return (unknown_buf); + } else { + /* 0x80000000-0xffffffff application programs */ + snprintf(unknown_buf, sizeof(unknown_buf), + "ERROR: SHT 0x%jx NOT DEFINED", + (uintmax_t)sht); + return (unknown_buf); } } @@ -704,6 +740,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) u_int64_t info; u_int64_t addralign; u_int64_t entsize; + u_int64_t machine; void *v; int i; @@ -712,6 +749,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) return; } + machine = elf_get_quarter(e, e, E_MACHINE); shentsize = elf_get_quarter(e, e, E_SHENTSIZE); shnum = elf_get_shnum(e, sh); fprintf(out, "\nsection header:\n"); @@ -730,7 +768,7 @@ elf_print_shdr(Elf32_Ehdr *e, void *sh) fprintf(out, "\n"); fprintf(out, "entry: %d\n", i); fprintf(out, "\tsh_name: %s\n", shstrtab + name); - fprintf(out, "\tsh_type: %s\n", sh_types(type)); + fprintf(out, "\tsh_type: %s\n", sh_types(machine, type)); fprintf(out, "\tsh_flags: %s\n", sh_flags[flags & 0x7]); fprintf(out, "\tsh_addr: %#jx\n", addr); fprintf(out, "\tsh_offset: %jd\n", (intmax_t)offset); From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 18:41:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7C8C21C6; Fri, 25 Jul 2014 18:41:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 694972092; Fri, 25 Jul 2014 18:41:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PIfvgY002203; Fri, 25 Jul 2014 18:41:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PIfvUm002202; Fri, 25 Jul 2014 18:41:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407251841.s6PIfvUm002202@svn.freebsd.org> From: Xin LI Date: Fri, 25 Jul 2014 18:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269093 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 18:41:57 -0000 Author: delphij Date: Fri Jul 25 18:41:56 2014 New Revision: 269093 URL: http://svnweb.freebsd.org/changeset/base/269093 Log: Transform the I/O when vdev_physical_ashift is greater than SPA_MINBLOCKSHIFT. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 18:20:56 2014 (r269092) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 25 18:41:56 2014 (r269093) @@ -2622,7 +2622,8 @@ zio_vdev_io_start(zio_t **ziop) align = 1ULL << vd->vdev_top->vdev_ashift; - if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && + if ((!(zio->io_flags & ZIO_FLAG_PHYSICAL) || + (vd->vdev_top->vdev_physical_ashift > SPA_MINBLOCKSHIFT)) && P2PHASE(zio->io_size, align) != 0) { /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 20:18:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24C0029A; Fri, 25 Jul 2014 20:18:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 050E82985; Fri, 25 Jul 2014 20:18:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PKIaip047121; Fri, 25 Jul 2014 20:18:36 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PKIZx4047114; Fri, 25 Jul 2014 20:18:35 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407252018.s6PKIZx4047114@svn.freebsd.org> From: Neel Natu Date: Fri, 25 Jul 2014 20:18:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269094 - 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.18 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, 25 Jul 2014 20:18:37 -0000 Author: neel Date: Fri Jul 25 20:18:35 2014 New Revision: 269094 URL: http://svnweb.freebsd.org/changeset/base/269094 Log: Simplify the meaning of return values from the inout handlers. After this change 0 means success and non-zero means failure. This also helps to eliminate VMEXIT_POWEROFF and VMEXIT_RESET as return values from VM-exit handlers. CR: D480 Reviewed by: grehan, jhb Modified: head/usr.sbin/bhyve/atkbdc.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/bhyverun.h head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/inout.h head/usr.sbin/bhyve/pm.c Modified: head/usr.sbin/bhyve/atkbdc.c ============================================================================== --- head/usr.sbin/bhyve/atkbdc.c Fri Jul 25 18:41:56 2014 (r269093) +++ head/usr.sbin/bhyve/atkbdc.c Fri Jul 25 20:18:35 2014 (r269094) @@ -31,6 +31,10 @@ __FBSDID("$FreeBSD$"); #include +#include + +#include +#include #include #include "inout.h" @@ -48,29 +52,30 @@ atkbdc_data_handler(struct vmctx *ctx, i uint32_t *eax, void *arg) { if (bytes != 1) - return (INOUT_ERROR); + return (-1); *eax = 0; - return (INOUT_OK); + return (0); } static int atkbdc_sts_ctl_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - int retval; + int error, retval; if (bytes != 1) - return (INOUT_ERROR); + return (-1); - retval = INOUT_OK; + retval = 0; if (in) { *eax = KBD_SYS_FLAG; /* system passed POST */ } else { switch (*eax) { case KBDC_RESET: /* Pulse "reset" line. */ - retval = INOUT_RESET; + error = vm_suspend(ctx, VM_SUSPEND_RESET); + assert(error == 0 || errno == EALREADY); break; } } Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri Jul 25 18:41:56 2014 (r269093) +++ head/usr.sbin/bhyve/bhyverun.c Fri Jul 25 20:18:35 2014 (r269094) @@ -107,8 +107,6 @@ struct bhyvestats { uint64_t vmexit_inst_emul; uint64_t cpu_switch_rotate; uint64_t cpu_switch_direct; - int io_reset; - int io_poweroff; } stats; struct mt_vmm_info { @@ -331,27 +329,18 @@ vmexit_inout(struct vmctx *ctx, struct v } error = emulate_inout(ctx, vcpu, vme, strictio); - if (error == INOUT_OK && in && !string) { + if (!error && in && !string) { error = vm_set_register(ctx, vcpu, VM_REG_GUEST_RAX, vme->u.inout.eax); + assert(error == 0); } - switch (error) { - case INOUT_OK: - return (VMEXIT_CONTINUE); - case INOUT_RESTART: - return (VMEXIT_RESTART); - case INOUT_RESET: - stats.io_reset++; - return (VMEXIT_RESET); - case INOUT_POWEROFF: - stats.io_poweroff++; - return (VMEXIT_POWEROFF); - default: - fprintf(stderr, "Unhandled %s%c 0x%04x\n", - in ? "in" : "out", - bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); + if (error) { + fprintf(stderr, "Unhandled %s%c 0x%04x\n", in ? "in" : "out", + bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port); return (VMEXIT_ABORT); + } else { + return (VMEXIT_CONTINUE); } } @@ -581,7 +570,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin { int error, rc, prevcpu; enum vm_exitcode exitcode; - enum vm_suspend_how how; cpuset_t active_cpus; if (vcpumap[vcpu] != NULL) { @@ -616,16 +604,6 @@ vm_loop(struct vmctx *ctx, int vcpu, uin case VMEXIT_RESTART: rip = vmexit[vcpu].rip; break; - case VMEXIT_RESET: - case VMEXIT_POWEROFF: - if (rc == VMEXIT_RESET) - how = VM_SUSPEND_RESET; - else - how = VM_SUSPEND_POWEROFF; - error = vm_suspend(ctx, how); - assert(error == 0 || errno == EALREADY); - rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length; - break; case VMEXIT_ABORT: abort(); default: Modified: head/usr.sbin/bhyve/bhyverun.h ============================================================================== --- head/usr.sbin/bhyve/bhyverun.h Fri Jul 25 18:41:56 2014 (r269093) +++ head/usr.sbin/bhyve/bhyverun.h Fri Jul 25 20:18:35 2014 (r269094) @@ -38,8 +38,6 @@ #define VMEXIT_CONTINUE 1 /* continue from next instruction */ #define VMEXIT_RESTART 2 /* restart current instruction */ #define VMEXIT_ABORT 3 /* abort the vm run loop */ -#define VMEXIT_RESET 4 /* guest machine has reset */ -#define VMEXIT_POWEROFF 5 /* guest machine has powered off */ struct vmctx; extern int guest_ncpus; Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Fri Jul 25 18:41:56 2014 (r269093) +++ head/usr.sbin/bhyve/inout.c Fri Jul 25 20:18:35 2014 (r269094) @@ -154,27 +154,28 @@ emulate_inout(struct vmctx *ctx, int vcp /* Limit number of back-to-back in/out emulations to 16 */ iterations = MIN(count, 16); while (iterations > 0) { + assert(retval == 0); if (vie_calculate_gla(vis->paging.cpu_mode, vis->seg_name, &vis->seg_desc, index, bytes, addrsize, prot, &gla)) { vm_inject_gp(ctx, vcpu); - retval = INOUT_RESTART; break; } error = vm_copy_setup(ctx, vcpu, &vis->paging, gla, bytes, prot, iov, nitems(iov)); - assert(error == 0 || error == 1 || error == -1); - if (error) { - retval = (error == 1) ? INOUT_RESTART : - INOUT_ERROR; + if (error == -1) { + retval = -1; /* Unrecoverable error */ + break; + } else if (error == 1) { + retval = 0; /* Resume guest to handle fault */ break; } if (vie_alignment_check(vis->paging.cpl, bytes, vis->cr0, vis->rflags, gla)) { vm_inject_ac(ctx, vcpu, 0); - return (INOUT_RESTART); + break; } val = 0; @@ -213,8 +214,8 @@ emulate_inout(struct vmctx *ctx, int vcp } /* Restart the instruction if more iterations remain */ - if (retval == INOUT_OK && count != 0) - retval = INOUT_RESTART; + if (retval == 0 && count != 0) + vmexit->inst_length = 0; } else { if (!in) { val = vmexit->u.inout.eax & vie_size2mask(bytes); Modified: head/usr.sbin/bhyve/inout.h ============================================================================== --- head/usr.sbin/bhyve/inout.h Fri Jul 25 18:41:56 2014 (r269093) +++ head/usr.sbin/bhyve/inout.h Fri Jul 25 20:18:35 2014 (r269094) @@ -34,13 +34,9 @@ struct vmctx; struct vm_exit; -/* Handler return values. */ -#define INOUT_ERROR -1 -#define INOUT_OK 0 -#define INOUT_RESTART 1 -#define INOUT_RESET 2 -#define INOUT_POWEROFF 3 - +/* + * inout emulation handlers return 0 on success and -1 on failure. + */ typedef int (*inout_func_t)(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg); Modified: head/usr.sbin/bhyve/pm.c ============================================================================== --- head/usr.sbin/bhyve/pm.c Fri Jul 25 18:41:56 2014 (r269093) +++ head/usr.sbin/bhyve/pm.c Fri Jul 25 20:18:35 2014 (r269094) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -56,6 +57,8 @@ static int reset_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { + int error; + static uint8_t reset_control; if (bytes != 1) @@ -66,8 +69,10 @@ reset_handler(struct vmctx *ctx, int vcp reset_control = *eax; /* Treat hard and soft resets the same. */ - if (reset_control & 0x4) - return (INOUT_RESET); + if (reset_control & 0x4) { + error = vm_suspend(ctx, VM_SUSPEND_RESET); + assert(error == 0 || errno == EALREADY); + } } return (0); } @@ -224,6 +229,7 @@ static int pm1_control_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { + int error; if (bytes != 2) return (-1); @@ -243,8 +249,10 @@ pm1_control_handler(struct vmctx *ctx, i * says that '5' should be stored in SLP_TYP for S5. */ if (*eax & PM1_SLP_EN) { - if ((pm1_control & PM1_SLP_TYP) >> 10 == 5) - return (INOUT_POWEROFF); + if ((pm1_control & PM1_SLP_TYP) >> 10 == 5) { + error = vm_suspend(ctx, VM_SUSPEND_POWEROFF); + assert(error == 0 || errno == EALREADY); + } } } return (0); From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 20:21:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 896F03FE; Fri, 25 Jul 2014 20:21:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76CC72993; Fri, 25 Jul 2014 20:21:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PKL3nR049683; Fri, 25 Jul 2014 20:21:03 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PKL3A8049682; Fri, 25 Jul 2014 20:21:03 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201407252021.s6PKL3A8049682@svn.freebsd.org> From: Daniel Eischen Date: Fri, 25 Jul 2014 20:21:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269095 - 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.18 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, 25 Jul 2014 20:21:03 -0000 Author: deischen Date: Fri Jul 25 20:21:02 2014 New Revision: 269095 URL: http://svnweb.freebsd.org/changeset/base/269095 Log: Insert new threads at the end of the thread list in the process instead of at the beginning. This allows an intra process signal to be sent to the oldest thread with the signal unmasked - which, if it still exists, is the main thread. This mimics behavior found in Linux and Solaris. Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Fri Jul 25 20:18:35 2014 (r269094) +++ head/sys/kern/kern_thread.c Fri Jul 25 20:21:02 2014 (r269095) @@ -546,7 +546,7 @@ thread_link(struct thread *td, struct pr LIST_INIT(&td->td_lprof[1]); sigqueue_init(&td->td_sigqueue, p); callout_init(&td->td_slpcallout, CALLOUT_MPSAFE); - TAILQ_INSERT_HEAD(&p->p_threads, td, td_plist); + TAILQ_INSERT_TAIL(&p->p_threads, td, td_plist); p->p_numthreads++; } From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 20:50:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B6C4D90; Fri, 25 Jul 2014 20:50:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78F972BE9; Fri, 25 Jul 2014 20:50:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PKo0Ia061579; Fri, 25 Jul 2014 20:50:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PKo0eT061578; Fri, 25 Jul 2014 20:50:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407252050.s6PKo0eT061578@svn.freebsd.org> From: Xin LI Date: Fri, 25 Jul 2014 20:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269097 - head/tools/test/netfibs 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.18 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, 25 Jul 2014 20:50:00 -0000 Author: delphij Date: Fri Jul 25 20:49:59 2014 New Revision: 269097 URL: http://svnweb.freebsd.org/changeset/base/269097 Log: Use the right length. Submitted by: Sascha Wildner MFC after: 2 weeks Modified: head/tools/test/netfibs/reflect.c Modified: head/tools/test/netfibs/reflect.c ============================================================================== --- head/tools/test/netfibs/reflect.c Fri Jul 25 20:44:04 2014 (r269096) +++ head/tools/test/netfibs/reflect.c Fri Jul 25 20:49:59 2014 (r269097) @@ -94,7 +94,7 @@ reflect_conn(int s, char *buf, size_t bu fprintf(stderr, "<< %s: %s\n", testcase, buf); if (reflectfib != (u_int)-1) - l = snprintf(buf, sizeof(buf), "FIB %u\n", reflectfib); + l = snprintf(buf, buflen, "FIB %u\n", reflectfib); /* If debug is on, log. */ if (debug > 0) { From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 20:54:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 90179153; Fri, 25 Jul 2014 20:54:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C9612CAA; Fri, 25 Jul 2014 20:54:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PKsB5V065300; Fri, 25 Jul 2014 20:54:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PKsBp3065298; Fri, 25 Jul 2014 20:54:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407252054.s6PKsBp3065298@svn.freebsd.org> From: Xin LI Date: Fri, 25 Jul 2014 20:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269098 - in head/tools/regression/net80211: ccmp wep 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.18 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, 25 Jul 2014 20:54:11 -0000 Author: delphij Date: Fri Jul 25 20:54:10 2014 New Revision: 269098 URL: http://svnweb.freebsd.org/changeset/base/269098 Log: Use the right lengths. Submitted by: Sascha Wildner MFC after: 2 weeks Modified: head/tools/regression/net80211/ccmp/test_ccmp.c head/tools/regression/net80211/wep/test_wep.c Modified: head/tools/regression/net80211/ccmp/test_ccmp.c ============================================================================== --- head/tools/regression/net80211/ccmp/test_ccmp.c Fri Jul 25 20:49:59 2014 (r269097) +++ head/tools/regression/net80211/ccmp/test_ccmp.c Fri Jul 25 20:54:10 2014 (r269098) @@ -680,7 +680,7 @@ runtest(struct ieee80211com *ic, struct printf("FAIL: decap botch; data does not compare\n"); printtest(t); cmpfail(mtod(m, const void *), m->m_pkthdr.len, - t->plaintext, sizeof(t->plaintext)); + t->plaintext, t_plaintext_len); goto bad; } m_freem(m); Modified: head/tools/regression/net80211/wep/test_wep.c ============================================================================== --- head/tools/regression/net80211/wep/test_wep.c Fri Jul 25 20:49:59 2014 (r269097) +++ head/tools/regression/net80211/wep/test_wep.c Fri Jul 25 20:54:10 2014 (r269098) @@ -242,7 +242,7 @@ runtest(struct ieee80211com *ic, struct } else if (memcmp(mtod(m, const void *), t->plaintext, t->plaintext_len)) { printf("FAIL: decap botch; data does not compare\n"); cmpfail(mtod(m, const void *), m->m_pkthdr.len, - t->plaintext, sizeof(t->plaintext)); + t->plaintext, t->plaintext_len); goto bad; } From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 21:10:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EE255F0; Fri, 25 Jul 2014 21:10:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F05A32E1F; Fri, 25 Jul 2014 21:10:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PLAUjL071805; Fri, 25 Jul 2014 21:10:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PLAUqT071804; Fri, 25 Jul 2014 21:10:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407252110.s6PLAUqT071804@svn.freebsd.org> From: Warner Losh Date: Fri, 25 Jul 2014 21:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269099 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 25 Jul 2014 21:10:31 -0000 Author: imp Date: Fri Jul 25 21:10:30 2014 New Revision: 269099 URL: http://svnweb.freebsd.org/changeset/base/269099 Log: Document an important, but easy to overlook without grepping the entire tree, detail about LDFLAGS. Modified: head/share/mk/bsd.README Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Fri Jul 25 20:54:10 2014 (r269098) +++ head/share/mk/bsd.README Fri Jul 25 21:10:30 2014 (r269099) @@ -231,7 +231,9 @@ LDADD Additional loader objects. Usual LDADD=-lutil -lcompat -LDFLAGS Additional loader flags. +LDFLAGS Additional loader flags. Passed to the loader via CC, + since that's used to link programs as well, so loader + specific flags need to be prefixed with -Wl, to work. LINKS The list of binary links; should be full pathnames, the linked-to file coming first, followed by the linked From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 22:58:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21E62581; Fri, 25 Jul 2014 22:58:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02DB727A5; Fri, 25 Jul 2014 22:58:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PMwtWJ022079; Fri, 25 Jul 2014 22:58:55 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PMwtls022077; Fri, 25 Jul 2014 22:58:55 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407252258.s6PMwtls022077@svn.freebsd.org> From: Xin LI Date: Fri, 25 Jul 2014 22:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269100 - head/cddl/contrib/opensolaris/cmd/zpool 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.18 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, 25 Jul 2014 22:58:56 -0000 Author: delphij Date: Fri Jul 25 22:58:55 2014 New Revision: 269100 URL: http://svnweb.freebsd.org/changeset/base/269100 Log: Diff reduction against Illumos. MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Jul 25 21:10:30 2014 (r269099) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Fri Jul 25 22:58:55 2014 (r269100) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2014 +.Dd July 25, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -556,7 +556,12 @@ will decrease while .Sy free increases. .It Sy expandsize -This property has currently no value on FreeBSD. +Amount of uninitialized space within the pool or device that can be used to +increase the total capacity of the pool. +Uninitialized space consists of +any space on an EFI labeled vdev which has not been brought online +.Pq i.e. zpool online -e . +This space occurs when a LUN is dynamically expanded. .It Sy guid A unique identifier for the pool. .It Sy health @@ -1391,7 +1396,10 @@ instead of arbitrary space. .It Fl p Display numbers in parsable (exact) values. .It Fl v -Show more detailed information. +Verbose statistics. Reports usage statistics for individual +.Em vdevs +within +the pool, in addition to the pool-wide statistics. .It Fl o Ar property Ns Op , Ns Ar ... Comma-separated list of properties to display. See the .Qq Sx Properties @@ -1400,6 +1408,7 @@ section for a list of valid properties. .Sy size , .Sy used , .Sy available , +.Sy expandsize , .Sy capacity , .Sy health , .Sy altroot . @@ -1785,9 +1794,9 @@ is immediately available to any datasets The following command lists all available pools on the system. .Bd -literal -offset 2n .Li # Ic zpool list -NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT -pool 2.70T 473G 2.24T 17% 1.00x ONLINE - -test 1.98G 89.5K 1.98G 0% 1.00x ONLINE - +NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT +pool 2.70T 473G 2.24T - 17% 1.00x ONLINE - +test 1.98G 89.5K 1.98G - 0% 1.00x ONLINE - .Ed .It Sy Example 7 No Listing All Properties for a Pool .Pp Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 25 21:10:30 2014 (r269099) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 25 22:58:55 2014 (r269100) @@ -3031,7 +3031,7 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,capacity,dedupratio," + "name,size,allocated,free,expandsize,capacity,dedupratio," "health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jul 25 23:52:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 826919CC; Fri, 25 Jul 2014 23:52:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2452C6C; Fri, 25 Jul 2014 23:52:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6PNqt2t049788; Fri, 25 Jul 2014 23:52:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6PNqskY049781; Fri, 25 Jul 2014 23:52:54 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407252352.s6PNqskY049781@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 25 Jul 2014 23:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269105 - in head/sys: arm/arm kern mips/mips powerpc/powerpc sparc64/sparc64 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.18 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, 25 Jul 2014 23:52:55 -0000 Author: gavin Date: Fri Jul 25 23:52:53 2014 New Revision: 269105 URL: http://svnweb.freebsd.org/changeset/base/269105 Log: Add error return to dumpsys(), and use it in doadump(). This commit does not add error returns to minidumpsys() or textdump_dumpsys(); those can also be added later. Submitted by: Conrad Meyer (EMC / Isilon storage division) Modified: head/sys/arm/arm/dump_machdep.c head/sys/kern/kern_shutdown.c head/sys/mips/mips/dump_machdep.c head/sys/powerpc/powerpc/dump_machdep.c head/sys/sparc64/sparc64/dump_machdep.c head/sys/sys/conf.h head/sys/x86/x86/dump_machdep.c Modified: head/sys/arm/arm/dump_machdep.c ============================================================================== --- head/sys/arm/arm/dump_machdep.c Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/arm/arm/dump_machdep.c Fri Jul 25 23:52:53 2014 (r269105) @@ -271,7 +271,7 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } -void +int dumpsys(struct dumperinfo *di) { Elf_Ehdr ehdr; @@ -282,7 +282,7 @@ dumpsys(struct dumperinfo *di) if (do_minidump) { minidumpsys(di); - return; + return (0); } bzero(&ehdr, sizeof(ehdr)); @@ -368,7 +368,7 @@ dumpsys(struct dumperinfo *di) /* Signal completion, signoff and exit stage left. */ dump_write(di, NULL, 0, 0, 0); printf("\nDump complete\n"); - return; + return (0); fail: if (error < 0) @@ -380,4 +380,5 @@ dumpsys(struct dumperinfo *di) printf("\nDump failed. Partition too small.\n"); else printf("\n** DUMP FAILED (ERROR %d) **\n", error); + return (error); } Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/kern/kern_shutdown.c Fri Jul 25 23:52:53 2014 (r269105) @@ -249,7 +249,9 @@ int doadump(boolean_t textdump) { boolean_t coredump; + int error; + error = 0; if (dumping) return (EBUSY); if (dumper.dumper == NULL) @@ -267,10 +269,10 @@ doadump(boolean_t textdump) } #endif if (coredump) - dumpsys(&dumper); + error = dumpsys(&dumper); dumping--; - return (0); + return (error); } static int Modified: head/sys/mips/mips/dump_machdep.c ============================================================================== --- head/sys/mips/mips/dump_machdep.c Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/mips/mips/dump_machdep.c Fri Jul 25 23:52:53 2014 (r269105) @@ -257,7 +257,7 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } -void +int dumpsys(struct dumperinfo *di) { Elf_Ehdr ehdr; @@ -268,7 +268,7 @@ dumpsys(struct dumperinfo *di) if (do_minidump) { minidumpsys(di); - return; + return (0); } bzero(&ehdr, sizeof(ehdr)); @@ -354,7 +354,7 @@ dumpsys(struct dumperinfo *di) /* Signal completion, signoff and exit stage left. */ dump_write(di, NULL, 0, 0, 0); printf("\nDump complete\n"); - return; + return (0); fail: if (error < 0) @@ -366,4 +366,5 @@ dumpsys(struct dumperinfo *di) printf("\nDump failed. Partition too small.\n"); else printf("\n** DUMP FAILED (ERROR %d) **\n", error); + return (error); } Modified: head/sys/powerpc/powerpc/dump_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/dump_machdep.c Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/powerpc/powerpc/dump_machdep.c Fri Jul 25 23:52:53 2014 (r269105) @@ -205,7 +205,7 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } -void +int dumpsys(struct dumperinfo *di) { Elf_Ehdr ehdr; @@ -299,7 +299,7 @@ dumpsys(struct dumperinfo *di) /* Signal completion, signoff and exit stage left. */ dump_write(di, NULL, 0, 0, 0); printf("\nDump complete\n"); - return; + return (0); fail: if (error < 0) @@ -311,4 +311,5 @@ dumpsys(struct dumperinfo *di) printf("\nDump failed. Partition too small.\n"); else printf("\n** DUMP FAILED (ERROR %d) **\n", error); + return (error); } Modified: head/sys/sparc64/sparc64/dump_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/dump_machdep.c Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/sparc64/sparc64/dump_machdep.c Fri Jul 25 23:52:53 2014 (r269105) @@ -142,7 +142,7 @@ blk_dump(struct dumperinfo *di, vm_paddr return (error); } -void +int dumpsys(struct dumperinfo *di) { struct sparc64_dump_hdr hdr; @@ -218,9 +218,10 @@ dumpsys(struct dumperinfo *di) /* Signal completion, signoff and exit stage left. */ dump_write(di, NULL, 0, 0, 0); printf("\nDump complete\n"); - return; + return (0); fail: /* XXX It should look more like VMS :-) */ printf("** DUMP FAILED (ERROR %d) **\n", error); + return (error); } Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/sys/conf.h Fri Jul 25 23:52:53 2014 (r269105) @@ -336,7 +336,7 @@ struct dumperinfo { int set_dumper(struct dumperinfo *, const char *_devname); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); -void dumpsys(struct dumperinfo *); +int dumpsys(struct dumperinfo *); int doadump(boolean_t); extern int dumping; /* system is dumping */ Modified: head/sys/x86/x86/dump_machdep.c ============================================================================== --- head/sys/x86/x86/dump_machdep.c Fri Jul 25 23:36:39 2014 (r269104) +++ head/sys/x86/x86/dump_machdep.c Fri Jul 25 23:52:53 2014 (r269105) @@ -266,7 +266,7 @@ foreach_chunk(callback_t cb, void *arg) return (seqnr); } -void +int dumpsys(struct dumperinfo *di) { Elf_Ehdr ehdr; @@ -277,7 +277,7 @@ dumpsys(struct dumperinfo *di) if (do_minidump) { minidumpsys(di); - return; + return (0); } bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; @@ -363,7 +363,7 @@ dumpsys(struct dumperinfo *di) /* Signal completion, signoff and exit stage left. */ dump_write(di, NULL, 0, 0, 0); printf("\nDump complete\n"); - return; + return (0); fail: if (error < 0) @@ -375,4 +375,5 @@ dumpsys(struct dumperinfo *di) printf("\nDump failed. Partition too small.\n"); else printf("\n** DUMP FAILED (ERROR %d) **\n", error); + return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 00:00:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F009DC2D; Sat, 26 Jul 2014 00:00:54 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E5FB2D39; Sat, 26 Jul 2014 00:00:54 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 45C6AACEE; Fri, 25 Jul 2014 17:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1406332848; x=1406347248; bh=iC3LmvZU05ULi1+pkqm7dcG3Fqir3NUz6lDNH0TEsEE=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=HZ3lmWAdEPctefgTNcoGzrSJLTinWSDK5Dxq0RR5GOdxLkPNSOLD1WG86aVYSj3m0 B2DCP6mQ+Mx8jjz95LivFv4QImlVodCqLQ8I/ZqafmZuJRJrRfoOGteWs/wMl43PHd FUC7noA4v/HVICkyfFvwe4ujFFUheUugVCqjcLGM= Message-ID: <53D2EFAF.9060903@delphij.net> Date: Fri, 25 Jul 2014 17:00:47 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Pietro Cerutti , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268494 - in head: lib/libsbuf sys/kern sys/sys References: <201407101308.s6AD8pbR080041@svn.freebsd.org> In-Reply-To: <201407101308.s6AD8pbR080041@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= , Baptiste Daroussin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 00:00:55 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 07/10/14 06:08, Pietro Cerutti wrote: > Author: gahr (ports committer) Date: Thu Jul 10 13:08:51 2014 New > Revision: 268494 URL: > http://svnweb.freebsd.org/changeset/base/268494 > > Log: Implement Short/Small String Optimization in SBUF(9) and > change lengths and positions in the API from ssize_t and int to > size_t. > > CR: D388 Approved by: des, bapt Please fix the ABI breakage by creating the compatibility shims or revert this change for now. Once a library have converted to use versioned symbols, we are promising not to break ABI compatibility and it's not Okay to break that promise. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJT0u+vAAoJEJW2GBstM+nsokoP/jz6o84f/NAwlWeMjBdYEXBk vYBLZN8tWNNwppykdkiFps67HYBgaVI2rIKHfcIRaNT4BG1MdQ78jaes6NEukbBz wJAeggpsJh8DuzfBEKDuXSG7VGfdrjaPa5PwfANgnwxFy8aagZA1xAyy6l9lUIqq J+hWtmIbZSttn3nlyYQXVjcsCaOaCAn4HMBdfAMNV+4LJtNNDGhrwL5kUncLAru3 9PdFqgjJPuvbaI10L6vSIbthHnAj8pVtNsRj7W54zjkMvhfweT66hajDNMvmgc5O 9BcFNqCmtemqpVDf3gRPfwTIaoPgbHnJnZPrJ+Ria2D/S3HnFRr96wCGYiy6yP1x G9Raf8/6qKDZ3WxjCJIOly6KVbKQxroy7SL59SW1h5LX9mgq5lqrkDeL9lRiLzwB 7LNzrGfvVUsufnLy0DQk9tiMGx4UTTjUFYcWWGK6m214lxJ/4+Zv6DlYU4m21Teg OqsuL/W78j0/1x0j+d7tHP4uucISQHF8suehXhGTbdpio7Mi4G6SzeZfqpYXW6HP ZwRvDJuiG8Q6o1V3Uhf+HvvEifjzm4779nycSyzq7T2qlRRU9Gs6rdJmRcR6E+pR 1iVQPNSDh4M/6GQ/NySxY8Xd1pdSvYumDzjh12RULY2agHuccYRhkRQWLLBqtV/U wrS+hdXjlum9ZCoZRsn6 =FR8o -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 00:51:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248E5950; Sat, 26 Jul 2014 00:51:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11D22208A; Sat, 26 Jul 2014 00:51:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q0pjJJ077574; Sat, 26 Jul 2014 00:51:45 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q0pjNO077573; Sat, 26 Jul 2014 00:51:45 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407260051.s6Q0pjNO077573@svn.freebsd.org> From: Navdeep Parhar Date: Sat, 26 Jul 2014 00:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269106 - head/tools/tools/cxgbetool 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.18 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, 26 Jul 2014 00:51:46 -0000 Author: np Date: Sat Jul 26 00:51:45 2014 New Revision: 269106 URL: http://svnweb.freebsd.org/changeset/base/269106 Log: Add a 'raw' parameter to the 'modinfo' subcommand. This is handy when trying to figure out why a QSFP+/SFP+ connector or cable wasn't identified correctly by cxgbe(4). Its output looks like this: # cxgbetool t5nex0 modinfo 0 raw 00: 03 04 21 00 00 00 00 00 ..!. .... 08: 04 00 00 00 67 00 00 00 .... g... 10: 00 00 05 00 41 6d 70 68 .... Amph 18: 65 6e 6f 6c 20 20 20 20 enol 20: 20 20 20 20 00 41 50 48 .APH 28: 35 37 31 35 34 30 30 30 5715 4000 30: 33 20 20 20 20 20 20 20 3 38: 4b 20 20 20 01 00 00 fa K .... 40: 00 00 00 00 41 50 46 31 .... APF1 48: 30 30 34 30 30 33 30 30 0040 0300 50: 30 33 20 20 31 30 30 31 03 1001 58: 33 30 20 20 00 00 00 97 30 .... MFC after: 3 days Modified: head/tools/tools/cxgbetool/cxgbetool.c Modified: head/tools/tools/cxgbetool/cxgbetool.c ============================================================================== --- head/tools/tools/cxgbetool/cxgbetool.c Fri Jul 25 23:52:53 2014 (r269105) +++ head/tools/tools/cxgbetool/cxgbetool.c Sat Jul 26 00:51:45 2014 (r269106) @@ -95,7 +95,7 @@ usage(FILE *fp) "\ti2c [] read from i2c device\n" "\tloadfw install firmware\n" "\tmemdump dump a memory range\n" - "\tmodinfo optics/cable information\n" + "\tmodinfo [raw] optics/cable information\n" "\treg
[=] read/write register\n" "\treg64
[=] read/write 64 bit register\n" "\tregdump [] ... dump registers\n" @@ -1873,6 +1873,41 @@ tracer_cmd(int argc, const char *argv[]) } static int +modinfo_raw(int port_id) +{ + uint8_t offset; + struct t4_i2c_data i2cd; + int rc; + + for (offset = 0; offset < 96; offset += sizeof(i2cd.data)) { + bzero(&i2cd, sizeof(i2cd)); + i2cd.port_id = port_id; + i2cd.dev_addr = 0xa0; + i2cd.offset = offset; + i2cd.len = sizeof(i2cd.data); + rc = doit(CHELSIO_T4_GET_I2C, &i2cd); + if (rc != 0) + return (rc); + printf("%02x: %02x %02x %02x %02x %02x %02x %02x %02x", + offset, i2cd.data[0], i2cd.data[1], i2cd.data[2], + i2cd.data[3], i2cd.data[4], i2cd.data[5], i2cd.data[6], + i2cd.data[7]); + + printf(" %c%c%c%c %c%c%c%c\n", + isprint(i2cd.data[0]) ? i2cd.data[0] : '.', + isprint(i2cd.data[1]) ? i2cd.data[1] : '.', + isprint(i2cd.data[2]) ? i2cd.data[2] : '.', + isprint(i2cd.data[3]) ? i2cd.data[3] : '.', + isprint(i2cd.data[4]) ? i2cd.data[4] : '.', + isprint(i2cd.data[5]) ? i2cd.data[5] : '.', + isprint(i2cd.data[6]) ? i2cd.data[6] : '.', + isprint(i2cd.data[7]) ? i2cd.data[7] : '.'); + } + + return (0); +} + +static int modinfo(int argc, const char *argv[]) { long port; @@ -1881,17 +1916,31 @@ modinfo(int argc, const char *argv[]) int rc, i; uint16_t temp, vcc, tx_bias, tx_power, rx_power; - if (argc != 1) { + if (argc < 1) { warnx("must supply a port"); return (EINVAL); } + if (argc > 2) { + warnx("too many arguments"); + return (EINVAL); + } + p = str_to_number(argv[0], &port, NULL); if (*p || port > UCHAR_MAX) { warnx("invalid port id \"%s\"", argv[0]); return (EINVAL); } + if (argc == 2) { + if (!strcmp(argv[1], "raw")) + return (modinfo_raw(port)); + else { + warnx("second argument can only be \"raw\""); + return (EINVAL); + } + } + bzero(&i2cd, sizeof(i2cd)); i2cd.len = 1; i2cd.port_id = port; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 02:51:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDA63910; Sat, 26 Jul 2014 02:51:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AABFC2902; Sat, 26 Jul 2014 02:51:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q2pknA030375; Sat, 26 Jul 2014 02:51:46 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q2pktD030374; Sat, 26 Jul 2014 02:51:46 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407260251.s6Q2pktD030374@svn.freebsd.org> From: Neel Natu Date: Sat, 26 Jul 2014 02:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269108 - head/sys/amd64/vmm 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.18 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, 26 Jul 2014 02:51:46 -0000 Author: neel Date: Sat Jul 26 02:51:46 2014 New Revision: 269108 URL: http://svnweb.freebsd.org/changeset/base/269108 Log: Don't return -1 from the push emulation handler. Negative return values are interpreted specially on return from sys_ioctl() and may cause undesirable side-effects like restarting the system call. Modified: head/sys/amd64/vmm/vmm_instruction_emul.c Modified: head/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- head/sys/amd64/vmm/vmm_instruction_emul.c Sat Jul 26 02:41:18 2014 (r269107) +++ head/sys/amd64/vmm/vmm_instruction_emul.c Sat Jul 26 02:51:46 2014 (r269108) @@ -781,10 +781,17 @@ emulate_push(void *vm, int vcpuid, uint6 error = vm_copy_setup(vm, vcpuid, paging, stack_gla, size, PROT_WRITE, copyinfo, nitems(copyinfo)); - if (error == -1) - return (-1); /* Unrecoverable error */ - else if (error == 1) - return (0); /* Return to guest to handle page fault */ + if (error == -1) { + /* + * XXX cannot return a negative error value here because it + * ends up being the return value of the VM_RUN() ioctl and + * is interpreted as a pseudo-error (for e.g. ERESTART). + */ + return (EFAULT); + } else if (error == 1) { + /* Resume guest execution to handle page fault */ + return (0); + } error = memread(vm, vcpuid, mmio_gpa, &val, size, arg); if (error == 0) { From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 02:53:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C264A75; Sat, 26 Jul 2014 02:53:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB9B298B; Sat, 26 Jul 2014 02:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q2rqi8032420; Sat, 26 Jul 2014 02:53:52 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q2rp8B032416; Sat, 26 Jul 2014 02:53:51 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407260253.s6Q2rp8B032416@svn.freebsd.org> From: Neel Natu Date: Sat, 26 Jul 2014 02:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269109 - in head/sys/amd64: include vmm vmm/intel 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.18 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, 26 Jul 2014 02:53:52 -0000 Author: neel Date: Sat Jul 26 02:53:51 2014 New Revision: 269109 URL: http://svnweb.freebsd.org/changeset/base/269109 Log: If a vcpu has issued a HLT instruction with interrupts disabled then it sleeps forever in vm_handle_hlt(). This is usually not an issue as long as one of the other vcpus properly resets or powers off the virtual machine. However, if the bhyve(8) process is killed with a signal the halted vcpu cannot be woken up because it's sleep cannot be interrupted. Fix this by waking up periodically and returning from vm_handle_hlt() if TDF_ASTPENDING is set. Reported by: Leon Dang Sponsored by: Nahanni Systems Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat Jul 26 02:51:46 2014 (r269108) +++ head/sys/amd64/include/vmm.h Sat Jul 26 02:53:51 2014 (r269109) @@ -270,6 +270,14 @@ vcpu_is_running(struct vm *vm, int vcpu, return (vcpu_get_state(vm, vcpu, hostcpu) == VCPU_RUNNING); } +#ifdef _SYS_PROC_H_ +static int __inline +vcpu_should_yield(struct vm *vm, int vcpu) +{ + return (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)); +} +#endif + void *vcpu_stats(struct vm *vm, int vcpu); void vcpu_notify_event(struct vm *vm, int vcpuid, bool lapic_intr); struct vmspace *vm_get_vmspace(struct vm *vm); Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 26 02:51:46 2014 (r269108) +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 26 02:53:51 2014 (r269109) @@ -2559,7 +2559,7 @@ vmx_run(void *arg, int vcpu, register_t break; } - if (curthread->td_flags & (TDF_ASTPENDING | TDF_NEEDRESCHED)) { + if (vcpu_should_yield(vm, vcpu)) { enable_intr(); vm_exit_astpending(vmx->vm, vcpu, vmcs_guest_rip()); vmx_astpending_trace(vmx, vcpu, vmexit->rip); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Jul 26 02:51:46 2014 (r269108) +++ head/sys/amd64/vmm/vmm.c Sat Jul 26 02:53:51 2014 (r269109) @@ -1105,6 +1105,10 @@ vm_handle_hlt(struct vm *vm, int vcpuid, } } + /* Don't go to sleep if the vcpu thread needs to yield */ + if (vcpu_should_yield(vm, vcpuid)) + break; + /* * Some Linux guests implement "halt" by having all vcpus * execute HLT with interrupts disabled. 'halted_cpus' keeps @@ -1128,7 +1132,11 @@ vm_handle_hlt(struct vm *vm, int vcpuid, t = ticks; vcpu_require_state_locked(vcpu, VCPU_SLEEPING); - msleep_spin(vcpu, &vcpu->mtx, wmesg, 0); + /* + * XXX msleep_spin() cannot be interrupted by signals so + * wake up periodically to check pending signals. + */ + msleep_spin(vcpu, &vcpu->mtx, wmesg, hz); vcpu_require_state_locked(vcpu, VCPU_FROZEN); vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 03:19:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9B8DF21; Sat, 26 Jul 2014 03:19:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6CC42BF6; Sat, 26 Jul 2014 03:19:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q3JDOP043367; Sat, 26 Jul 2014 03:19:13 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q3JDgH043366; Sat, 26 Jul 2014 03:19:13 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407260319.s6Q3JDgH043366@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Jul 2014 03:19:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269110 - head/sys/boot/arm/at91/libat91 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.18 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, 26 Jul 2014 03:19:13 -0000 Author: ian Date: Sat Jul 26 03:19:13 2014 New Revision: 269110 URL: http://svnweb.freebsd.org/changeset/base/269110 Log: Silence a clang warning about a while loop with an empty body. Modified: head/sys/boot/arm/at91/libat91/emac.c Modified: head/sys/boot/arm/at91/libat91/emac.c ============================================================================== --- head/sys/boot/arm/at91/libat91/emac.c Sat Jul 26 02:53:51 2014 (r269109) +++ head/sys/boot/arm/at91/libat91/emac.c Sat Jul 26 03:19:13 2014 (r269110) @@ -96,7 +96,8 @@ GetServerAddress(void) memcpy(p_ARP->target_ip, serverIPAddr, 4); // wait until transmit is available - while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) ; + while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) + continue; *AT91C_EMAC_TSR |= AT91C_EMAC_COMP; *AT91C_EMAC_TAR = (unsigned)transmitBuffer; @@ -157,7 +158,8 @@ Send_TFTP_Packet(char *tftpData, unsigne udpHdr->udp_cksum = SWAP16(t_checksum); - while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) ; + while (!(*AT91C_EMAC_TSR & AT91C_EMAC_BNQ)) + continue; *AT91C_EMAC_TSR |= AT91C_EMAC_COMP; *AT91C_EMAC_TAR = (unsigned)tftpSendPacket; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 03:33:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8DF422C; Sat, 26 Jul 2014 03:33:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89D372D4C; Sat, 26 Jul 2014 03:33:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q3XL5Y051363; Sat, 26 Jul 2014 03:33:21 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q3XKAa051354; Sat, 26 Jul 2014 03:33:20 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407260333.s6Q3XKAa051354@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Jul 2014 03:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269111 - in head/sys/boot/arm/at91: boot0 boot0iic boot0spi boot2 bootiic bootspi 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.18 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, 26 Jul 2014 03:33:21 -0000 Author: ian Date: Sat Jul 26 03:33:19 2014 New Revision: 269111 URL: http://svnweb.freebsd.org/changeset/base/269111 Log: Eliminate "no previous prototype for main" warnings. Modified: head/sys/boot/arm/at91/boot0/main.c head/sys/boot/arm/at91/boot0iic/main.c head/sys/boot/arm/at91/boot0spi/main.c head/sys/boot/arm/at91/boot2/boot2.c head/sys/boot/arm/at91/bootiic/main.c head/sys/boot/arm/at91/bootspi/main.c Modified: head/sys/boot/arm/at91/boot0/main.c ============================================================================== --- head/sys/boot/arm/at91/boot0/main.c Sat Jul 26 03:19:13 2014 (r269110) +++ head/sys/boot/arm/at91/boot0/main.c Sat Jul 26 03:33:19 2014 (r269111) @@ -30,6 +30,8 @@ typedef void fn_t(void); +int main(void); + int main(void) { Modified: head/sys/boot/arm/at91/boot0iic/main.c ============================================================================== --- head/sys/boot/arm/at91/boot0iic/main.c Sat Jul 26 03:19:13 2014 (r269110) +++ head/sys/boot/arm/at91/boot0iic/main.c Sat Jul 26 03:33:19 2014 (r269111) @@ -28,6 +28,8 @@ #include "lib.h" #include "at91rm9200_lowlevel.h" +int main(void); + int main(void) { Modified: head/sys/boot/arm/at91/boot0spi/main.c ============================================================================== --- head/sys/boot/arm/at91/boot0spi/main.c Sat Jul 26 03:19:13 2014 (r269110) +++ head/sys/boot/arm/at91/boot0spi/main.c Sat Jul 26 03:33:19 2014 (r269111) @@ -31,7 +31,9 @@ #define OFFSET 0 -void +int main(void); + +int main(void) { int len, i, j, off, sec; @@ -59,4 +61,5 @@ main(void) continue; printf("Done\n"); reset(); + return (1); } Modified: head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/at91/boot2/boot2.c Sat Jul 26 03:19:13 2014 (r269110) +++ head/sys/boot/arm/at91/boot2/boot2.c Sat Jul 26 03:33:19 2014 (r269111) @@ -93,6 +93,7 @@ static char kname[1024]; static uint32_t opts; static uint8_t dsk_meta; +int main(void); static void load(void); static int parse(void); static int dskread(void *, unsigned, unsigned); @@ -190,6 +191,7 @@ main(void) else load(); } + return (1); } static void Modified: head/sys/boot/arm/at91/bootiic/main.c ============================================================================== --- head/sys/boot/arm/at91/bootiic/main.c Sat Jul 26 03:19:13 2014 (r269110) +++ head/sys/boot/arm/at91/bootiic/main.c Sat Jul 26 03:33:19 2014 (r269111) @@ -28,6 +28,8 @@ #include "emac.h" #include "lib.h" +int main(void); + /* * .KB_C_FN_DEFINITION_START * int main(void) Modified: head/sys/boot/arm/at91/bootspi/main.c ============================================================================== --- head/sys/boot/arm/at91/bootspi/main.c Sat Jul 26 03:19:13 2014 (r269110) +++ head/sys/boot/arm/at91/bootspi/main.c Sat Jul 26 03:33:19 2014 (r269111) @@ -43,6 +43,8 @@ #include "spi_flash.h" #include "ee.h" +int main(void); + int main(void) { From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 04:09:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 881A1696; Sat, 26 Jul 2014 04:09:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7538B2F76; Sat, 26 Jul 2014 04:09:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q49iH2065579; Sat, 26 Jul 2014 04:09:44 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q49i20065578; Sat, 26 Jul 2014 04:09:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407260409.s6Q49i20065578@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Jul 2014 04:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269112 - head/sys/boot/arm/at91/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.18 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, 26 Jul 2014 04:09:44 -0000 Author: ian Date: Sat Jul 26 04:09:43 2014 New Revision: 269112 URL: http://svnweb.freebsd.org/changeset/base/269112 Log: The 'flags' variable is conflicting with some inline code in a header file ("variable flags shadows a global..."), just rename this variable to wish away the problem. Modified: head/sys/boot/arm/at91/boot2/boot2.c Modified: head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- head/sys/boot/arm/at91/boot2/boot2.c Sat Jul 26 03:33:19 2014 (r269111) +++ head/sys/boot/arm/at91/boot2/boot2.c Sat Jul 26 04:09:43 2014 (r269112) @@ -77,7 +77,7 @@ extern uint32_t _end; #define OPT_CHECK(opt) ((opts) & OPT_SET(opt)) static const char optstr[NOPT] = "agnrsv"; -static const unsigned char flags[NOPT] = { +static const unsigned char bootflags[NOPT] = { RBX_ASKNAME, RBX_GDB, RBX_NOINTR, @@ -265,7 +265,7 @@ parse() for (i = 0; c != optstr[i]; i++) if (i == NOPT - 1) return -1; - opts ^= OPT_SET(flags[i]); + opts ^= OPT_SET(bootflags[i]); } } else { arg--; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 04:16:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44C11939; Sat, 26 Jul 2014 04:16:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3131B209E; Sat, 26 Jul 2014 04:16:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q4G5fC069916; Sat, 26 Jul 2014 04:16:05 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q4G4Ie069912; Sat, 26 Jul 2014 04:16:04 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407260416.s6Q4G4Ie069912@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Jul 2014 04:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269113 - head/sys/boot/arm/at91/libat91 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.18 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, 26 Jul 2014 04:16:05 -0000 Author: ian Date: Sat Jul 26 04:16:04 2014 New Revision: 269113 URL: http://svnweb.freebsd.org/changeset/base/269113 Log: Enable at91 systems to boot from high capacity SD cards. This also fixes a few minor violations of the SD protocol, such as running the bus at high speed during the card identification sequence. The sdcard_init() routine now probes for SDHC cards so that later read requests can make needed adjustments between block and byte offsets based on card type. There is a new MCI_readblocks() function that takes block number and block count parameters instead of byte-offset values. Using this routine, boot loader code can load a kernel from any location on an SDHC or standard SD. The old MCI_read() interface remains unchanged so that existing customized boot loader code will still keep working without changes. Using this routine, boot loaders can load a kernel from anywhere in the first 4GB of an SDHC card (or of course any location on a standard SD card). A new sdcard_use4wire() routine allows boot loaders to request 4-bit transfers; it should be called after sdcard_init(). The sdcard_init() routine no longer assumes the hardware is 4-wire capable and by default sets things up for 1-bit transfers. (4-wire mode is unreliable on at91rm9200, works on later SoCs.) PR: 155894 Submitted by: me. years ago. Modified: head/sys/boot/arm/at91/libat91/mci_device.h head/sys/boot/arm/at91/libat91/sd-card.c head/sys/boot/arm/at91/libat91/sd-card.h Modified: head/sys/boot/arm/at91/libat91/mci_device.h ============================================================================== --- head/sys/boot/arm/at91/libat91/mci_device.h Sat Jul 26 04:09:43 2014 (r269112) +++ head/sys/boot/arm/at91/libat91/mci_device.h Sat Jul 26 04:16:04 2014 (r269113) @@ -90,6 +90,8 @@ typedef struct _AT91S_MciDevice { volatile unsigned char state; unsigned char SDCard_bus_width; + unsigned char IsSDv2; + unsigned char IsSDHC; unsigned int RCA; // RCA unsigned int READ_BL_LEN; #ifdef REPORT_SIZE @@ -202,7 +204,9 @@ typedef struct _AT91S_MciDevice MMC_MAXLAT) #define GO_INACTIVE_STATE_CMD \ (15 | MMC_RSPTYP_NO) - +#define SD_SEND_IF_COND_CMD \ + (8 | MMC_TRCMD_NO | MMC_SPCMD_NONE | MMC_RSPTYP_48 | \ + MMC_MAXLAT) //*------------------------------------------------ //* Class 2 commands: Block oriented Read commands //*------------------------------------------------ @@ -264,7 +268,7 @@ typedef struct _AT91S_MciDevice #define SDCARD_STATUS_CMD (13 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) #define SDCARD_SEND_NUM_WR_BLOCKS_CMD (22 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) #define SDCARD_SET_WR_BLK_ERASE_COUNT_CMD (23 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) -#define SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO ) +#define SDCARD_APP_OP_COND_CMD (41 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) #define SDCARD_SET_CLR_CARD_DETECT_CMD (42 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) #define SDCARD_SEND_SCR_CMD (51 | MMC_SPCMD_NONE | MMC_RSPTYP_48 | MMC_TRCMD_NO | MMC_MAXLAT) @@ -306,7 +310,8 @@ typedef struct _AT91S_MciDevice #define AT91C_VDD_33_34 (1 << 21) #define AT91C_VDD_34_35 (1 << 22) #define AT91C_VDD_35_36 (1 << 23) -#define AT91C_CARD_POWER_UP_BUSY (1U << 31) +#define AT91C_CCS (1 << 30) +#define AT91C_CARD_POWER_UP_DONE (1U << 31) #define AT91C_MMC_HOST_VOLTAGE_RANGE (AT91C_VDD_27_28 | AT91C_VDD_28_29 | \ AT91C_VDD_29_30 | AT91C_VDD_30_31 | AT91C_VDD_31_32 | AT91C_VDD_32_33) Modified: head/sys/boot/arm/at91/libat91/sd-card.c ============================================================================== --- head/sys/boot/arm/at91/libat91/sd-card.c Sat Jul 26 04:09:43 2014 (r269112) +++ head/sys/boot/arm/at91/libat91/sd-card.c Sat Jul 26 04:16:04 2014 (r269113) @@ -47,35 +47,38 @@ #include "lib.h" #include "sd-card.h" -#define AT91C_MCI_TIMEOUT 1000000 /* For AT91F_MCIDeviceWaitReady */ -#define BUFFER_SIZE_MCI_DEVICE 512 -#define MASTER_CLOCK 60000000 +#define AT91C_MCI_TIMEOUT 1000000 /* For AT91F_MCIDeviceWaitReady */ +#define SD_BLOCK_SIZE 512 //* Global Variables -AT91S_MciDevice MCI_Device; -char Buffer[BUFFER_SIZE_MCI_DEVICE]; +static AT91S_MciDevice MCI_Device; /****************************************************************************** **Error return codes ******************************************************************************/ -#define MCI_UNSUPP_SIZE_ERROR 5 +#define MCI_UNSUPP_SIZE_ERROR 5 #define MCI_UNSUPP_OFFSET_ERROR 6 //*---------------------------------------------------------------------------- //* \fn MCIDeviceWaitReady //* \brief Wait for MCI Device ready //*---------------------------------------------------------------------------- -static void +static unsigned int MCIDeviceWaitReady(unsigned int timeout) { - volatile int status; - + volatile unsigned int status; + int waitfor; + + if (MCI_Device.state == AT91C_MCI_RX_SINGLE_BLOCK) + waitfor = AT91C_MCI_RXBUFF; + else + waitfor = AT91C_MCI_NOTBUSY; do { status = AT91C_BASE_MCI->MCI_SR; timeout--; } - while( !(status & AT91C_MCI_NOTBUSY) && (timeout>0) ); + while( !(status & waitfor) && (timeout>0) ); status = AT91C_BASE_MCI->MCI_SR; @@ -92,25 +95,39 @@ MCIDeviceWaitReady(unsigned int timeout) AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTDIS; MCI_Device.state = AT91C_MCI_IDLE; } // End of if AT91C_MCI_RXBUFF + + //printf("WaitReady returning status %x\n", status); + + return status; } static inline unsigned int -swap(unsigned int a) +swap(unsigned int v) { - return (((a & 0xff) << 24) | ((a & 0xff00) << 8) | ((a & 0xff0000) >> 8) - | ((a & 0xff000000) >> 24)); + unsigned int t1; + + __asm __volatile("eor %1, %0, %0, ror #16\n" + "bic %1, %1, #0x00ff0000\n" + "mov %0, %0, ror #8\n" + "eor %0, %0, %1, lsr #8\n" + : "+r" (v), "=r" (t1)); + + return (v); } -static inline void +inline static unsigned int wait_ready() { int status; + int timeout = AT91C_MCI_TIMEOUT; // wait for CMDRDY Status flag to read the response do { status = AT91C_BASE_MCI->MCI_SR; - } while( !(status & AT91C_MCI_CMDRDY) ); + } while( !(status & AT91C_MCI_CMDRDY) && (--timeout > 0) ); + + return status; } //*---------------------------------------------------------------------------- @@ -122,18 +139,24 @@ MCI_SendCommand( unsigned int Cmd, unsigned int Arg) { - unsigned int error; + unsigned int error; + unsigned int errorMask = AT91C_MCI_SR_ERROR; + unsigned int opcode = Cmd & 0x3F; + + //printf("SendCmd %d (%x) arg %x\n", opcode, Cmd, Arg); + + // Don't check response CRC on ACMD41 (R3 response type). + + if (opcode == 41) + errorMask &= ~AT91C_MCI_RCRCE; AT91C_BASE_MCI->MCI_ARGR = Arg; AT91C_BASE_MCI->MCI_CMDR = Cmd; -// printf("CMDR %x ARG %x\n", Cmd, Arg); - wait_ready(); - // Test error ==> if crc error and response R3 ==> don't check error - error = (AT91C_BASE_MCI->MCI_SR) & AT91C_MCI_SR_ERROR; - if (error != 0) { - if (error != AT91C_MCI_RCRCE) - return (1); + error = wait_ready(); + + if ((error & errorMask) != 0) { + return (1); } return 0; } @@ -146,94 +169,98 @@ static unsigned int MCI_GetStatus() { if (MCI_SendCommand(SEND_STATUS_CMD, MCI_Device.RCA << 16)) - return AT91C_CMD_SEND_ERROR; + return 0; return (AT91C_BASE_MCI->MCI_RSPR[0]); + } //*---------------------------------------------------------------------------- //* \fn MCI_ReadBlock -//* \brief Read an ENTIRE block or PARTIAL block +//* \brief Start the read for a single 512-byte block //*---------------------------------------------------------------------------- static int -MCI_ReadBlock(int src, unsigned int *dataBuffer, int sizeToRead) +MCI_StartReadBlock(unsigned blknum, void *dataBuffer) { -// unsigned log2sl = MCI_Device.READ_BL_LEN; -// unsigned sectorLength = 1 << log2sl; - unsigned sectorLength = 512; - - /////////////////////////////////////////////////////////////////////// - if (MCI_Device.state != AT91C_MCI_IDLE) - return 1; - - if ((MCI_GetStatus() & AT91C_SR_READY_FOR_DATA) == 0) - return 1; - - /////////////////////////////////////////////////////////////////////// - // Init Mode Register - AT91C_BASE_MCI->MCI_MR |= ((sectorLength << 16) | AT91C_MCI_PDCMODE); + AT91C_BASE_MCI->MCI_MR |= ((SD_BLOCK_SIZE << 16) | AT91C_MCI_PDCMODE); - sizeToRead = sizeToRead / 4; - + // (PDC) Receiver Transfer Enable AT91C_BASE_PDC_MCI->PDC_PTCR = (AT91C_PDC_TXTDIS | AT91C_PDC_RXTDIS); AT91C_BASE_PDC_MCI->PDC_RPR = (unsigned int)dataBuffer; - AT91C_BASE_PDC_MCI->PDC_RCR = sizeToRead; + AT91C_BASE_PDC_MCI->PDC_RCR = SD_BLOCK_SIZE / 4;; + AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTEN; + + // SDHC wants block offset, non-HC wants byte offset. + if (!MCI_Device.IsSDHC) + blknum *= SD_BLOCK_SIZE; // Send the Read single block command - if (MCI_SendCommand(READ_SINGLE_BLOCK_CMD, src)) + if (MCI_SendCommand(READ_SINGLE_BLOCK_CMD, blknum)) { return AT91C_READ_ERROR; + } MCI_Device.state = AT91C_MCI_RX_SINGLE_BLOCK; - // Enable AT91C_MCI_RXBUFF Interrupt - AT91C_BASE_MCI->MCI_IER = AT91C_MCI_RXBUFF; - - // (PDC) Receiver Transfer Enable - AT91C_BASE_PDC_MCI->PDC_PTCR = AT91C_PDC_RXTEN; - return 0; } +//*---------------------------------------------------------------------------- +//* \fn MCI_readblocks +//* \brief Read one or more blocks +//*---------------------------------------------------------------------------- int -MCI_read(char* dest, unsigned source, unsigned length) +MCI_readblocks(char* dest, unsigned blknum, unsigned blkcount) { -// unsigned log2sl = MCI_Device.READ_BL_LEN; -// unsigned sectorLength = 1 << log2sl; - unsigned sectorLength = 512; - int sizeToRead; + unsigned int status; unsigned int *walker; - //As long as there is data to read - while (length) - { - if (length > sectorLength) - sizeToRead = sectorLength; - else - sizeToRead = length; + if (MCI_Device.state != AT91C_MCI_IDLE) { + return 1; + } + + if ((MCI_GetStatus() & AT91C_SR_READY_FOR_DATA) == 0) { + return 1; + } - MCIDeviceWaitReady(AT91C_MCI_TIMEOUT); + // As long as there is data to read + while (blkcount) + { //Do the reading - if (MCI_ReadBlock(source, - (unsigned int*)dest, sizeToRead)) + if (MCI_StartReadBlock(blknum, dest)) return -1; - //* Wait MCI Device Ready - MCIDeviceWaitReady(AT91C_MCI_TIMEOUT); + // Wait MCI Device Ready + status = MCIDeviceWaitReady(AT91C_MCI_TIMEOUT); + if (status & AT91C_MCI_SR_ERROR) + return 1; - // Fix erratum in MCI part + // Fix erratum in MCI part - endian-swap all data. for (walker = (unsigned int *)dest; - walker < (unsigned int *)(dest + sizeToRead); walker++) + walker < (unsigned int *)(dest + SD_BLOCK_SIZE); walker++) *walker = swap(*walker); - //Update counters & pointers - length -= sizeToRead; - dest += sizeToRead; - source += sizeToRead; + // Update counters & pointers + ++blknum; + --blkcount; + dest += SD_BLOCK_SIZE; } + return 0; } //*---------------------------------------------------------------------------- +//* \fn MCI_read +//* \brief Legacy read function, takes byte offset and length but was always +//* used to read full blocks; interface preserved for existing boot code. +//*---------------------------------------------------------------------------- +int +MCI_read(char* dest, unsigned byteoffset, unsigned length) +{ + return MCI_readblocks(dest, + byteoffset/SD_BLOCK_SIZE, length/SD_BLOCK_SIZE); +} + +//*---------------------------------------------------------------------------- //* \fn MCI_SDCard_SendAppCommand //* \brief Specific function to send a specific command to the SDCard //*---------------------------------------------------------------------------- @@ -242,15 +269,11 @@ MCI_SDCard_SendAppCommand( unsigned int Cmd_App, unsigned int Arg) { - // Send the CMD55 for application specific command - AT91C_BASE_MCI->MCI_ARGR = (MCI_Device.RCA << 16 ); - AT91C_BASE_MCI->MCI_CMDR = APP_CMD; - - wait_ready(); - // if an error occurs - if (AT91C_BASE_MCI->MCI_SR & AT91C_MCI_SR_ERROR) - return (1); - return (MCI_SendCommand(Cmd_App,Arg)); + int status; + + if ((status = MCI_SendCommand(APP_CMD, (MCI_Device.RCA << 16))) == 0) + status = MCI_SendCommand(Cmd_App,Arg); + return status; } //*---------------------------------------------------------------------------- @@ -260,12 +283,11 @@ MCI_SDCard_SendAppCommand( static int MCI_GetCSD(unsigned int rca, unsigned int *response) { - - if (MCI_SendCommand(SEND_CSD_CMD, (rca << 16))) + if (MCI_SendCommand(SEND_CSD_CMD, (rca << 16))) return 1; response[0] = AT91C_BASE_MCI->MCI_RSPR[0]; - response[1] = AT91C_BASE_MCI->MCI_RSPR[1]; + response[1] = AT91C_BASE_MCI->MCI_RSPR[1]; response[2] = AT91C_BASE_MCI->MCI_RSPR[2]; response[3] = AT91C_BASE_MCI->MCI_RSPR[3]; @@ -274,22 +296,64 @@ MCI_GetCSD(unsigned int rca, unsigned in //*---------------------------------------------------------------------------- //* \fn MCI_SDCard_GetOCR -//* \brief Asks to all cards to send their operations conditions +//* \brief Wait for card to power up and determine whether it's SDHC or not. //*---------------------------------------------------------------------------- static int MCI_SDCard_GetOCR() { - unsigned int response=0x0; + unsigned int response; + unsigned int arg = AT91C_MMC_HOST_VOLTAGE_RANGE; + int timeout = AT91C_MCI_TIMEOUT; + + // Force card to idle state. + + MCI_SendCommand(GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + + // Begin probe for SDHC by sending CMD8; only v2.0 cards respond to it. + // + // Arg is vvpp where vv is voltage range and pp is an arbitrary bit + // pattern that gets echoed back in the response. The only voltage + // ranges defined are: + // 0x01 = 2.7 - 3.6 + // 0x02 = "reserved for low voltage" whatever that means. + // + // If the card fails to respond then it's not v2.0. If it responds by + // echoing back exactly the arg we sent, then it's a v2.0 card and can + // run at our voltage. That means that when we send the ACMD41 (in + // MCI_SDCard_GetOCR) we can include the HCS bit to inquire about SDHC. + + if (MCI_SendCommand(SD_SEND_IF_COND_CMD, 0x01AA) == 0) { + MCI_Device.IsSDv2 = (AT91C_BASE_MCI->MCI_RSPR[0] == 0x01AA); + } + + // If we've determined the card supports v2.0 functionality, set the + // HCS/CCS bit to indicate that we support SDHC. This will cause a + // v2.0 card to report whether it is SDHC in the ACMD41 response. + + if (MCI_Device.IsSDv2) { + arg |= AT91C_CCS; + } + + // The RCA to be used for CMD55 in Idle state shall be the card's + // default RCA=0x0000. - // The RCA to be used for CMD55 in Idle state shall be the card's default RCA=0x0000. MCI_Device.RCA = 0x0; - - while( (response & AT91C_CARD_POWER_UP_BUSY) != AT91C_CARD_POWER_UP_BUSY ) { - if (MCI_SDCard_SendAppCommand(SDCARD_APP_OP_COND_CMD, - AT91C_MMC_HOST_VOLTAGE_RANGE)) + + // Repeat ACMD41 until the card comes out of power-up-busy state. + + do { + if (MCI_SDCard_SendAppCommand(SDCARD_APP_OP_COND_CMD, arg)) { return 1; + } response = AT91C_BASE_MCI->MCI_RSPR[0]; + } while (!(response & AT91C_CARD_POWER_UP_DONE) && (--timeout > 0)); + + // A v2.0 card sets CCS (card capacity status) in the response if it's SDHC. + + if (MCI_Device.IsSDv2) { + MCI_Device.IsSDHC = ((response & AT91C_CCS) == AT91C_CCS); } + return (0); } @@ -304,7 +368,7 @@ MCI_SDCard_GetCID(unsigned int *response return 1; response[0] = AT91C_BASE_MCI->MCI_RSPR[0]; - response[1] = AT91C_BASE_MCI->MCI_RSPR[1]; + response[1] = AT91C_BASE_MCI->MCI_RSPR[1]; response[2] = AT91C_BASE_MCI->MCI_RSPR[2]; response[3] = AT91C_BASE_MCI->MCI_RSPR[3]; @@ -312,47 +376,62 @@ MCI_SDCard_GetCID(unsigned int *response } //*---------------------------------------------------------------------------- -//* \fn MCI_SDCard_SetBusWidth -//* \brief Set bus width for SDCard +//* \fn sdcard_4wire +//* \brief Set bus width to 1-bit or 4-bit according to the parm. +//* +//* Unlike most functions in this file, the return value from this one is +//* bool-ish; returns 0 on failure, 1 on success. //*---------------------------------------------------------------------------- -static int -MCI_SDCard_SetBusWidth() +int +sdcard_use4wire(int use4wire) { volatile int ret_value; - char bus_width; do { ret_value=MCI_GetStatus(); } while((ret_value > 0) && ((ret_value & AT91C_SR_READY_FOR_DATA) == 0)); - // Select Card - MCI_SendCommand(SEL_DESEL_CARD_CMD, (MCI_Device.RCA)<<16); + // If going to 4-wire mode, ask the card to turn off the DAT3 card detect + // pullup resistor, if going to 1-wire ask it to turn it back on. - // Set bus width for Sdcard - if (MCI_Device.SDCard_bus_width == AT91C_MCI_SCDBUS) - bus_width = AT91C_BUS_WIDTH_4BITS; - else - bus_width = AT91C_BUS_WIDTH_1BIT; + ret_value = MCI_SDCard_SendAppCommand(SDCARD_SET_CLR_CARD_DETECT_CMD, + use4wire ? 0 : 1); + if (ret_value != AT91C_CMD_SEND_OK) + return 0; - if (MCI_SDCard_SendAppCommand( - SDCARD_SET_BUS_WIDTH_CMD,bus_width) != AT91C_CMD_SEND_OK) - return 1; + // Ask the card to go into the requested mode. - return 0; + ret_value = MCI_SDCard_SendAppCommand(SDCARD_SET_BUS_WIDTH_CMD, + use4wire ? AT91C_BUS_WIDTH_4BITS : + AT91C_BUS_WIDTH_1BIT); + if (ret_value != AT91C_CMD_SEND_OK) + return 0; + + // Set the MCI device to match the mode we set in the card. + + if (use4wire) { + MCI_Device.SDCard_bus_width = AT91C_BUS_WIDTH_4BITS; + AT91C_BASE_MCI->MCI_SDCR |= AT91C_MCI_SCDBUS; + } else { + MCI_Device.SDCard_bus_width = AT91C_BUS_WIDTH_1BIT; + AT91C_BASE_MCI->MCI_SDCR &= ~AT91C_MCI_SCDBUS; + } + + return 1; } //*---------------------------------------------------------------------------- -//* \fn main -//* \brief main function +//* \fn sdcard_init +//* \brief get the mci device ready to read from an SD or SDHC card. +//* +//* Unlike most functions in this file, the return value from this one is +//* bool-ish; returns 0 on failure, 1 on success. //*---------------------------------------------------------------------------- int sdcard_init(void) { unsigned int tab_response[4]; -#ifdef REPORT_SIZE - unsigned int mult,blocknr; -#endif int i; // Init MCI for MMC and SDCard interface @@ -362,51 +441,77 @@ sdcard_init(void) // Init Device Structure MCI_Device.state = AT91C_MCI_IDLE; - MCI_Device.SDCard_bus_width = AT91C_MCI_SCDBUS; + MCI_Device.SDCard_bus_width = 0; + MCI_Device.IsSDv2 = 0; + MCI_Device.IsSDHC = 0; + + // Reset the MCI and set the bus speed. + // Using MCK/230 gives a legal (under 400khz) bus speed for the card id + // sequence for all reasonable master clock speeds. - //* Reset the MCI - AT91C_BASE_MCI->MCI_CR = AT91C_MCI_MCIEN | AT91C_MCI_PWSEN; + AT91C_BASE_MCI->MCI_CR = AT91C_MCI_MCIDIS | 0x80; AT91C_BASE_MCI->MCI_IDR = 0xFFFFFFFF; AT91C_BASE_MCI->MCI_DTOR = AT91C_MCI_DTOR_1MEGA_CYCLES; - AT91C_BASE_MCI->MCI_MR = AT91C_MCI_PDCMODE; - AT91C_BASE_MCI->MCI_SDCR = AT91C_MCI_SDCARD_4BITS_SLOTA; - MCI_SendCommand(GO_IDLE_STATE_CMD, AT91C_NO_ARGUMENT); + AT91C_BASE_MCI->MCI_MR = AT91C_MCI_PDCMODE | 114; /* clkdiv 114 = MCK/230 */ + AT91C_BASE_MCI->MCI_SDCR = AT91C_MCI_MMC_SLOTA; + AT91C_BASE_MCI->MCI_CR = AT91C_MCI_MCIEN|AT91C_MCI_PWSEN; + + // Wait for the card to come out of power-up-busy state by repeatedly + // sending ACMD41. This also probes for SDHC versus standard cards. for (i = 0; i < 100; i++) { - if (!MCI_SDCard_GetOCR(&MCI_Device)) + if (MCI_SDCard_GetOCR() == 0) break; - printf("."); + if ((i & 0x01) == 0) { + printf("."); + } } if (i >= 100) return 0; + if (MCI_SDCard_GetCID(tab_response)) return 0; + + // Tell the card to set its address, and remember the result. + if (MCI_SendCommand(SET_RELATIVE_ADDR_CMD, 0)) return 0; - MCI_Device.RCA = (AT91C_BASE_MCI->MCI_RSPR[0] >> 16); + + // After sending CMD3 (set addr) we can increase the clock to full speed. + // Using MCK/4 gives a legal (under 25mhz) bus speed for all reasonable + // master clock speeds. + + AT91C_BASE_MCI->MCI_MR = AT91C_MCI_PDCMODE | 1; /* clkdiv 1 = MCK/4 */ + if (MCI_GetCSD(MCI_Device.RCA,tab_response)) return 0; MCI_Device.READ_BL_LEN = (tab_response[1] >> CSD_1_RD_B_LEN_S) & CSD_1_RD_B_LEN_M; + #ifdef REPORT_SIZE - // compute MULT - mult = 1 << ( ((tab_response[2] >> CSD_2_C_SIZE_M_S) & - CSD_2_C_SIZE_M_M) + 2 ); - // compute MSB of C_SIZE - blocknr = ((tab_response[1] >> CSD_1_CSIZE_H_S) & - CSD_1_CSIZE_H_M) << 2; - // compute MULT * (LSB of C-SIZE + MSB already computed + 1) = BLOCKNR - blocknr = mult * ((blocknr + ((tab_response[2] >> CSD_2_CSIZE_L_S) & - CSD_2_CSIZE_L_M)) + 1); - MCI_Device.Memory_Capacity = (1 << MCI_Device.READ_BL_LEN) * blocknr; + { + unsigned int mult,blocknr; + // compute MULT + mult = 1 << ( ((tab_response[2] >> CSD_2_C_SIZE_M_S) & + CSD_2_C_SIZE_M_M) + 2 ); + // compute MSB of C_SIZE + blocknr = ((tab_response[1] >> CSD_1_CSIZE_H_S) & + CSD_1_CSIZE_H_M) << 2; + // compute MULT * (LSB of C-SIZE + MSB already computed + 1) = BLOCKNR + blocknr = mult * ((blocknr + ((tab_response[2] >> CSD_2_CSIZE_L_S) & + CSD_2_CSIZE_L_M)) + 1); + MCI_Device.Memory_Capacity = (1 << MCI_Device.READ_BL_LEN) * blocknr; + printf("Found SD card %u bytes\n", MCI_Device.Memory_Capacity); + } #endif - if (MCI_SDCard_SetBusWidth()) + + // Select card and set block length for following transfers. + + if (MCI_SendCommand(SEL_DESEL_CARD_CMD, (MCI_Device.RCA)<<16)) return 0; - if (MCI_SendCommand(SET_BLOCKLEN_CMD, 1 << MCI_Device.READ_BL_LEN)) + if (MCI_SendCommand(SET_BLOCKLEN_CMD, SD_BLOCK_SIZE)) return 0; -#ifdef REPORT_SIZE - printf("Found SD card %u bytes\n", MCI_Device.Memory_Capacity); -#endif + return 1; } Modified: head/sys/boot/arm/at91/libat91/sd-card.h ============================================================================== --- head/sys/boot/arm/at91/libat91/sd-card.h Sat Jul 26 04:09:43 2014 (r269112) +++ head/sys/boot/arm/at91/libat91/sd-card.h Sat Jul 26 04:16:04 2014 (r269113) @@ -30,9 +30,35 @@ #ifndef __SD_CARD_H #define __SD_CARD_H -int MCI_write (unsigned dest, char* source, unsigned length); -int MCI_read (char* dest, unsigned source, unsigned length); +/* MCI_read() is the original read function, taking a byte offset and byte + * count. It is preserved to support existing customized boot code that still + * refers to it; it will work fine even on SDHC cards as long as the kernel and + * the metadata for locating it all exist within the first 4GB of the card. + * + * MCI_readblocks() is the new read function, taking offset and length in terms + * of block counts (where the SD spec defines a block as 512 bytes), allowing + * the kernel and filesystem metadata to be located anywhere on an SDHC card. + * + * Returns 0 on success, non-zero on failure. + */ + +int MCI_read (char* dest, unsigned bytenum, unsigned length); +int MCI_readblocks (char* dest, unsigned blknum, unsigned blkcount); + +/* sdcard_init() - get things set up to read from an SD or SDHC card. + * + * Returns 0 on failure, non-zero on success. + */ + int sdcard_init(void); +/* By default sdcard_init() sets things up for a 1-wire interface to the + * SD card. Calling sdcard_4wire(true) after sdcard_init() allows customized + * boot code to change to 4-bit transfers when the hardware supports it. + * + * Returns 0 on failure, non-zero on success. + */ +int sdcard_use4wire(int use4wire); + #endif From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 04:38:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EB47FFC; Sat, 26 Jul 2014 04:38:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0D9229D; Sat, 26 Jul 2014 04:38:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q4cAjG079189; Sat, 26 Jul 2014 04:38:10 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q4c9YB079179; Sat, 26 Jul 2014 04:38:09 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201407260438.s6Q4c9YB079179@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sat, 26 Jul 2014 04:38:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269114 - in head: lib/csu/i386-elf share/mk sys/boot/mips/beri/boot2 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.18 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, 26 Jul 2014 04:38:11 -0000 Author: sjg Date: Sat Jul 26 04:38:09 2014 New Revision: 269114 URL: http://svnweb.freebsd.org/changeset/base/269114 Log: Reviewed by: imp LDFLAGS is supposed to be given to CC not LD. Define _LDFLAGS as a filtered version of LDFLAGS safe to give to LD Modified: head/lib/csu/i386-elf/Makefile head/share/mk/sys.mk head/sys/boot/mips/beri/boot2/Makefile head/sys/conf/Makefile.arm head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk Modified: head/lib/csu/i386-elf/Makefile ============================================================================== --- head/lib/csu/i386-elf/Makefile Sat Jul 26 04:16:04 2014 (r269113) +++ head/lib/csu/i386-elf/Makefile Sat Jul 26 04:38:09 2014 (r269114) @@ -26,7 +26,7 @@ gcrt1_c.o: gcrt1_c.s ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s gcrt1.o: gcrt1_c.o crt1_s.o - ${LD} ${LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o + ${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o crt1_c.s: crt1_c.c ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c @@ -36,7 +36,7 @@ crt1_c.o: crt1_c.s ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s crt1.o: crt1_c.o crt1_s.o - ${LD} ${LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o + ${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o objcopy --localize-symbol _start1 crt1.o Scrt1_c.s: crt1_c.c @@ -47,7 +47,7 @@ Scrt1_c.o: Scrt1_c.s ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s Scrt1.o: Scrt1_c.o crt1_s.o - ${LD} ${LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o + ${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o objcopy --localize-symbol _start1 Scrt1.o .include Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Sat Jul 26 04:16:04 2014 (r269113) +++ head/share/mk/sys.mk Sat Jul 26 04:38:09 2014 (r269114) @@ -117,7 +117,8 @@ LEX ?= lex LFLAGS ?= LD ?= ld -LDFLAGS ?= +LDFLAGS ?= # LDFLAGS is for CC, +_LDFLAGS = ${LDFLAGS:S/-Wl,//g} # strip -Wl, for LD LINT ?= lint LINTFLAGS ?= -cghapbx Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Sat Jul 26 04:16:04 2014 (r269113) +++ head/sys/boot/mips/beri/boot2/Makefile Sat Jul 26 04:38:09 2014 (r269114) @@ -73,7 +73,7 @@ LDFLAGS= -nostdlib \ CFLAGS+= -I${.CURDIR}/../common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o - ${LD} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ + ${LD} ${_LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ ${.ALLSRC} ${LIBSTAND} flashboot: flashboot.elf objcopy -S -O binary ${.TARGET}.elf ${.TARGET} @@ -81,7 +81,7 @@ flashboot.md5: flashboot md5 flashboot > flashboot.md5 jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o - ${LD} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ + ${LD} ${_LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ ${.ALLSRC} ${LIBSTAND} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Sat Jul 26 04:16:04 2014 (r269113) +++ head/sys/conf/Makefile.arm Sat Jul 26 04:38:09 2014 (r269114) @@ -55,7 +55,7 @@ CFLAGS.clang += -mllvm -arm-enable-ehabi # hack because genassym.c includes sys/bus.h which includes these. genassym.o: bus_if.h device_if.h -SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${LDFLAGS} \ +SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.noheader ${_LDFLAGS} \ -warn-common -export-dynamic -dynamic-linker /red/herring -o \ ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL +=;sed s/" + SIZEOF_HEADERS"// ldscript.$M\ Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Jul 26 04:16:04 2014 (r269113) +++ head/sys/conf/kern.pre.mk Sat Jul 26 04:38:09 2014 (r269114) @@ -177,7 +177,7 @@ SYSTEM_DEP= Makefile ${SYSTEM_OBJS} SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} SYSTEM_OBJS+= hack.So -SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${LDFLAGS} --no-warn-mismatch \ +SYSTEM_LD= @${LD} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} --no-warn-mismatch \ -warn-common -export-dynamic -dynamic-linker /red/herring \ -o ${.TARGET} -X ${SYSTEM_OBJS} vers.o SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Sat Jul 26 04:16:04 2014 (r269113) +++ head/sys/conf/kmod.mk Sat Jul 26 04:38:09 2014 (r269114) @@ -146,11 +146,11 @@ CLEANFILES+= ${KMOD:S/$/.c/} ${_firmw:C/\:.*$/.fwo/}: ${_firmw:C/\:.*$//} @${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}} @if [ -e ${_firmw:C/\:.*$//} ]; then \ - ${LD} -b binary --no-warn-mismatch ${LDFLAGS} \ + ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \ else \ ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \ - ${LD} -b binary --no-warn-mismatch ${LDFLAGS} \ + ${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \ -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \ rm ${_firmw:C/\:.*$//}; \ fi @@ -178,7 +178,7 @@ ${PROG}.symbols: ${FULLPROG} .if ${__KLD_SHARED} == yes ${FULLPROG}: ${KMOD}.kld - ${LD} -Bshareable ${LDFLAGS} -o ${.TARGET} ${KMOD}.kld + ${LD} -Bshareable ${_LDFLAGS} -o ${.TARGET} ${KMOD}.kld .if !defined(DEBUG_FLAGS) ${OBJCOPY} --strip-debug ${.TARGET} .endif @@ -194,7 +194,7 @@ ${KMOD}.kld: ${OBJS} .else ${FULLPROG}: ${OBJS} .endif - ${LD} ${LDFLAGS} -r -d -o ${.TARGET} ${OBJS} + ${LD} ${_LDFLAGS} -r -d -o ${.TARGET} ${OBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 07:40:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 154DD87C; Sat, 26 Jul 2014 07:40:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0296F2067; Sat, 26 Jul 2014 07:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q7eVPu062032; Sat, 26 Jul 2014 07:40:31 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q7eVJt062031; Sat, 26 Jul 2014 07:40:31 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407260740.s6Q7eVJt062031@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 26 Jul 2014 07:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269115 - head/lib/libpam/modules/pam_lastlog 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.18 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, 26 Jul 2014 07:40:32 -0000 Author: des Date: Sat Jul 26 07:40:31 2014 New Revision: 269115 URL: http://svnweb.freebsd.org/changeset/base/269115 Log: Remove useless getpwnam() call. Submitted by: Arthur Mesh MFC after: 1 week Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Modified: head/lib/libpam/modules/pam_lastlog/pam_lastlog.c ============================================================================== --- head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Sat Jul 26 04:38:09 2014 (r269114) +++ head/lib/libpam/modules/pam_lastlog/pam_lastlog.c Sat Jul 26 07:40:31 2014 (r269115) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -68,7 +67,6 @@ PAM_EXTERN int pam_sm_open_session(pam_handle_t *pamh, int flags, int argc __unused, const char *argv[] __unused) { - struct passwd *pwd; struct utmpx *utx, utl; time_t t; const char *user; @@ -79,7 +77,7 @@ pam_sm_open_session(pam_handle_t *pamh, pam_err = pam_get_user(pamh, &user, NULL); if (pam_err != PAM_SUCCESS) return (pam_err); - if (user == NULL || (pwd = getpwnam(user)) == NULL) + if (user == NULL) return (PAM_SERVICE_ERR); PAM_LOG("Got user: %s", user); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 08:41:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05810DC; Sat, 26 Jul 2014 08:41:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FDA254B; Sat, 26 Jul 2014 08:41:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q8f3Cg091466; Sat, 26 Jul 2014 08:41:03 GMT (envelope-from ache@svn.freebsd.org) Received: (from ache@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q8f3Od091465; Sat, 26 Jul 2014 08:41:03 GMT (envelope-from ache@svn.freebsd.org) Message-Id: <201407260841.s6Q8f3Od091465@svn.freebsd.org> From: "Andrey A. Chernov" Date: Sat, 26 Jul 2014 08:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269116 - head/lib/libc/stdio 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.18 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, 26 Jul 2014 08:41:04 -0000 Author: ache Date: Sat Jul 26 08:41:03 2014 New Revision: 269116 URL: http://svnweb.freebsd.org/changeset/base/269116 Log: In the "Too many open files" edge cases don't try to preserve old number for non-std* descriptors, but close old file and retry. Obtained from: inspired by Apple's change from pfg@ MFC after: 2 weeks Modified: head/lib/libc/stdio/freopen.c Modified: head/lib/libc/stdio/freopen.c ============================================================================== --- head/lib/libc/stdio/freopen.c Sat Jul 26 07:40:31 2014 (r269115) +++ head/lib/libc/stdio/freopen.c Sat Jul 26 08:41:03 2014 (r269116) @@ -151,6 +151,14 @@ freopen(const char * __restrict file, co /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); + /* If out of fd's close the old one and try again. */ + if (f < 0 && isopen && wantfd > STDERR_FILENO && + (errno == ENFILE || errno == EMFILE)) { + (void) (*fp->_close)(fp->_cookie); + isopen = 0; + wantfd = -1; + f = _open(file, oflags, DEFFILEMODE); + } sverrno = errno; finish: From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 09:09:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06EEC718; Sat, 26 Jul 2014 09:09:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7F3F274D; Sat, 26 Jul 2014 09:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6Q99E0e002075; Sat, 26 Jul 2014 09:09:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6Q99ED2002074; Sat, 26 Jul 2014 09:09:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407260909.s6Q99ED2002074@svn.freebsd.org> From: Alexander Motin Date: Sat, 26 Jul 2014 09:09:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269117 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 09:09:15 -0000 Author: mav Date: Sat Jul 26 09:09:14 2014 New Revision: 269117 URL: http://svnweb.freebsd.org/changeset/base/269117 Log: Make sysctls under vfs.zfs.zfetch writeable. I don't see any reason for them to be read-only, while tuning them without reboot is much more convenient for experiments. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sat Jul 26 08:41:03 2014 (r269116) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Sat Jul 26 09:09:14 2014 (r269117) @@ -57,11 +57,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, prefetch_ SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH"); SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_streams, CTLFLAG_RWTUN, &zfetch_max_streams, 0, "Max # of streams per zfetch"); -SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RDTUN, +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, min_sec_reap, CTLFLAG_RWTUN, &zfetch_min_sec_reap, 0, "Min time before stream reclaim"); -SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RDTUN, +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, block_cap, CTLFLAG_RWTUN, &zfetch_block_cap, 0, "Max number of blocks to fetch at a time"); -SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RDTUN, +SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, array_rd_sz, CTLFLAG_RWTUN, &zfetch_array_rd_sz, 0, "Number of bytes in a array_read at which we stop prefetching"); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 10:20:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31A9B533; Sat, 26 Jul 2014 10:20:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B09C2D4E; Sat, 26 Jul 2014 10:20:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QAKonR034658; Sat, 26 Jul 2014 10:20:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QAKmuX034649; Sat, 26 Jul 2014 10:20:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407261020.s6QAKmuX034649@svn.freebsd.org> From: Xin LI Date: Sat, 26 Jul 2014 10:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269118 - in head: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contri... 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.18 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, 26 Jul 2014 10:20:50 -0000 Author: delphij Date: Sat Jul 26 10:20:48 2014 New Revision: 269118 URL: http://svnweb.freebsd.org/changeset/base/269118 Log: MFV r269010: Import Illumos changes to address the following Illumos issues: 4976 zfs should only avoid writing to a failing non-redundant top-level vdev 4978 ztest fails in get_metaslab_refcount() 4979 extend free space histogram to device and pool 4980 metaslabs should have a fragmentation metric 4981 remove fragmented ops vector from block allocator 4982 space_map object should proactively upgrade when feature is enabled 4984 device selection should use fragmentation metric MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Jul 26 09:09:14 2014 (r269117) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Sat Jul 26 10:20:48 2014 (r269118) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2014 +.Dd July 26, 2014 .Dt ZDB 8 .Os .Sh NAME @@ -27,11 +27,11 @@ .Nd Display zpool debugging and consistency information .Sh SYNOPSIS .Nm -.Op Fl CumdibcsDvhLXFPA +.Op Fl CumdibcsDvhLMXFPA .Op Fl e Op Fl p Ar path... .Op Fl t Ar txg .Op Fl U Ar cache -.Op Fl M Ar inflight I/Os +.Op Fl I Ar inflight I/Os .Op Fl x Ar dumpdir .Ar poolname .Op Ar object ... @@ -42,7 +42,7 @@ .Ar dataset .Op Ar object ... .Nm -.Fl m Op Fl LXFPA +.Fl m Op Fl MLXFPA .Op Fl t Ar txg .Op Fl e Op Fl p Ar path... .Op Fl U Ar cache @@ -155,6 +155,13 @@ By default, verifies that all non-free blocks are referenced, which can be very expensive. .It Fl m Display the offset, spacemap, and free space of each metaslab. +When specified twice, also display information about the on-disk free +space histogram associated with each metaslab. When specified three time, +display the maximum contiguous free space, the in-core free space histogram, +and the percentage of free space in each space map. When specified +four times display every spacemap record. +.It Fl M +Display the offset, spacemap, and free space of each metaslab. When specified twice, also display information about the maximum contiguous free space and the percentage of free space in each space map. When specified three times display every spacemap record. @@ -229,7 +236,7 @@ all metadata on the pool. .It Fl F Attempt to make an unreadable pool readable by trying progressively older transactions. -.It Fl M Ar inflight I/Os +.It Fl I Ar inflight I/Os Limit the number of outstanding checksum I/Os to the specified value. The default value is 200. This option affects the performance of the .Fl c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Jul 26 09:09:14 2014 (r269117) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Jul 26 10:20:48 2014 (r269118) @@ -111,11 +111,11 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " - "[-U config] [-M inflight I/Os] [-x dumpdir] poolname [object...]\n" + "Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" - " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " + " %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] " "poolname [vdev [metaslab...]]\n" " %s -R [-A] [-e [-p path...]] poolname " "vdev:offset:size[:flags]\n" @@ -138,6 +138,7 @@ usage(void) (void) fprintf(stderr, " -h pool history\n"); (void) fprintf(stderr, " -b block statistics\n"); (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -M metaslab groups\n"); (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); @@ -168,7 +169,7 @@ usage(void) (void) fprintf(stderr, " -P print numbers in parseable form\n"); (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); - (void) fprintf(stderr, " -M -- " + (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " @@ -548,7 +549,7 @@ get_metaslab_refcount(vdev_t *vd) { int refcount = 0; - if (vd->vdev_top == vd) { + if (vd->vdev_top == vd && !vd->vdev_removing) { for (int m = 0; m < vd->vdev_ms_count; m++) { space_map_t *sm = vd->vdev_ms[m]->ms_sm; @@ -686,9 +687,10 @@ dump_metaslab(metaslab_t *msp) * The space map histogram represents free space in chunks * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). */ - (void) printf("\tOn-disk histogram:\n"); + (void) printf("\tOn-disk histogram:\t\tfragmentation %llu\n", + (u_longlong_t)msp->ms_fragmentation); dump_histogram(sm->sm_phys->smp_histogram, - SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift); } if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { @@ -713,6 +715,47 @@ print_vdev_metaslab_header(vdev_t *vd) } static void +dump_metaslab_groups(spa_t *spa) +{ + vdev_t *rvd = spa->spa_root_vdev; + metaslab_class_t *mc = spa_normal_class(spa); + uint64_t fragmentation; + + metaslab_class_histogram_verify(mc); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (mg->mg_class != mc) + continue; + + metaslab_group_histogram_verify(mg); + mg->mg_fragmentation = metaslab_group_fragmentation(mg); + + (void) printf("\tvdev %10llu\t\tmetaslabs%5llu\t\t" + "fragmentation", + (u_longlong_t)tvd->vdev_id, + (u_longlong_t)tvd->vdev_ms_count); + if (mg->mg_fragmentation == ZFS_FRAG_INVALID) { + (void) printf("%3s\n", "-"); + } else { + (void) printf("%3llu%%\n", + (u_longlong_t)mg->mg_fragmentation); + } + dump_histogram(mg->mg_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); + } + + (void) printf("\tpool %s\tfragmentation", spa_name(spa)); + fragmentation = metaslab_class_fragmentation(mc); + if (fragmentation == ZFS_FRAG_INVALID) + (void) printf("\t%3s\n", "-"); + else + (void) printf("\t%3llu%%\n", (u_longlong_t)fragmentation); + dump_histogram(mc->mc_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); +} + +static void dump_metaslabs(spa_t *spa) { vdev_t *vd, *rvd = spa->spa_root_vdev; @@ -2369,8 +2412,7 @@ zdb_leak(void *arg, uint64_t start, uint } static metaslab_ops_t zdb_metaslab_ops = { - NULL, /* alloc */ - NULL /* fragmented */ + NULL /* alloc */ }; static void @@ -2865,6 +2907,8 @@ dump_zpool(spa_t *spa) if (dump_opt['d'] > 2 || dump_opt['m']) dump_metaslabs(spa); + if (dump_opt['M']) + dump_metaslab_groups(spa); if (dump_opt['d'] || dump_opt['i']) { dump_dir(dp->dp_meta_objset); @@ -3360,7 +3404,7 @@ main(int argc, char **argv) dprintf_setup(&argc, argv); while ((c = getopt(argc, argv, - "bcdhilmM:suCDRSAFLXx:evp:t:U:P")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { case 'b': case 'c': @@ -3373,6 +3417,7 @@ main(int argc, char **argv) case 'u': case 'C': case 'D': + case 'M': case 'R': case 'S': dump_opt[c]++; @@ -3386,10 +3431,7 @@ main(int argc, char **argv) case 'P': dump_opt[c]++; break; - case 'v': - verbose++; - break; - case 'M': + case 'I': max_inflight = strtoull(optarg, NULL, 0); if (max_inflight == 0) { (void) fprintf(stderr, "maximum number " @@ -3413,9 +3455,6 @@ main(int argc, char **argv) } searchdirs[nsearch++] = optarg; break; - case 'x': - vn_dumpdir = optarg; - break; case 't': max_txg = strtoull(optarg, NULL, 0); if (max_txg < TXG_INITIAL) { @@ -3427,6 +3466,12 @@ main(int argc, char **argv) case 'U': spa_config_path = optarg; break; + case 'v': + verbose++; + break; + case 'x': + vn_dumpdir = optarg; + break; default: usage(); break; Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Jul 26 09:09:14 2014 (r269117) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Sat Jul 26 10:20:48 2014 (r269118) @@ -21,12 +21,12 @@ .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright 2011, Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2011, Justin T. Gibbs -.\" Copyright (c) 2012 by Delphix. All Rights Reserved. +.\" Copyright (c) 2013 by Delphix. All Rights Reserved. .\" Copyright (c) 2012, Glen Barber .\" .\" $FreeBSD$ .\" -.Dd July 25, 2014 +.Dd July 26, 2014 .Dt ZPOOL 8 .Os .Sh NAME @@ -543,6 +543,15 @@ For example, a value of 1.76 indicates that 1.76 units of data were stored but only 1 unit of disk space was actually consumed. See .Xr zfs 8 for a description of the deduplication feature. +.It Sy expandsize +Amount of uninitialized space within the pool or device that can be used to +increase the total capacity of the pool. +Uninitialized space consists of +any space on an EFI labeled vdev which has not been brought online +.Pq i.e. zpool online -e . +This space occurs when a LUN is dynamically expanded. +.It Sy fragmentation +The amount of fragmentation in the pool. .It Sy free Number of blocks within the pool that are not allocated. .It Sy freeing @@ -555,13 +564,6 @@ Over time will decrease while .Sy free increases. -.It Sy expandsize -Amount of uninitialized space within the pool or device that can be used to -increase the total capacity of the pool. -Uninitialized space consists of -any space on an EFI labeled vdev which has not been brought online -.Pq i.e. zpool online -e . -This space occurs when a LUN is dynamically expanded. .It Sy guid A unique identifier for the pool. .It Sy health @@ -1408,6 +1410,7 @@ section for a list of valid properties. .Sy size , .Sy used , .Sy available , +.Sy fragmentation , .Sy expandsize , .Sy capacity , .Sy health , @@ -1794,9 +1797,9 @@ is immediately available to any datasets The following command lists all available pools on the system. .Bd -literal -offset 2n .Li # Ic zpool list -NAME SIZE ALLOC FREE EXPANDSZ CAP DEDUP HEALTH ALTROOT -pool 2.70T 473G 2.24T - 17% 1.00x ONLINE - -test 1.98G 89.5K 1.98G - 0% 1.00x ONLINE - +NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT +pool 2.70T 473G 2.24T 33% - 17% 1.00x ONLINE - +test 1.98G 89.5K 1.98G 48% - 0% 1.00x ONLINE - .Ed .It Sy Example 7 No Listing All Properties for a Pool .Pp @@ -1924,7 +1927,35 @@ subcommand as follows: .Bd -literal -offset 2n .Li # Ic zpool iostat -v pool 5 .Ed -.It Sy Example 15 No Removing a Mirrored Log Device +.It Xo +.Sy Example 15 +Displaying expanded space on a device +.Xc +.Pp +The following command dipslays the detailed information for the +.Em data +pool. +This pool is comprised of a single +.Em raidz +vdev where one of its +devices increased its capacity by 10GB. +In this example, the pool will not +be able to utilized this extra capacity until all the devices under the +.Em raidz +vdev have been expanded. +.Bd -literal -offset 2n +.Li # Ic zpool list -v data +NAME SIZE ALLOC FREE FRAG EXPANDSZ CAP DEDUP HEALTH ALTROOT +data 23.9G 14.6G 9.30G 48% - 61% 1.00x ONLINE - + raidz1 23.9G 14.6G 9.30G 48% - + ada0 - - - - - + ada1 - - - - 10G + ada2 - - - - - +.Ed +.It Xo +.Sy Example 16 +Removing a Mirrored Log Device +.Xc .Pp The following command removes the mirrored log device .Em mirror-2 . @@ -1956,7 +1987,12 @@ is: .Bd -literal -offset 2n .Li # Ic zpool remove tank mirror-2 .Ed -.It Sy Example 16 No Recovering a Faulted Tn ZFS No Pool +.It Xo +.Sy Example 17 +Recovering a Faulted +.Tn ZFS +Pool +.Xc .Pp If a pool is faulted but recoverable, a message indicating this state is provided by Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 26 09:09:14 2014 (r269117) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Sat Jul 26 10:20:48 2014 (r269118) @@ -2900,10 +2900,15 @@ print_one_column(zpool_prop_t prop, uint boolean_t fixed; size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL); - zfs_nicenum(value, propval, sizeof (propval)); if (prop == ZPOOL_PROP_EXPANDSZ && value == 0) (void) strlcpy(propval, "-", sizeof (propval)); + else if (prop == ZPOOL_PROP_FRAGMENTATION && value == ZFS_FRAG_INVALID) + (void) strlcpy(propval, "-", sizeof (propval)); + else if (prop == ZPOOL_PROP_FRAGMENTATION) + (void) snprintf(propval, sizeof (propval), "%llu%%", value); + else + zfs_nicenum(value, propval, sizeof (propval)); if (scripted) (void) printf("\t%s", propval); @@ -2936,9 +2941,9 @@ print_list_stats(zpool_handle_t *zhp, co /* only toplevel vdevs have capacity stats */ if (vs->vs_space == 0) { if (scripted) - (void) printf("\t-\t-\t-"); + (void) printf("\t-\t-\t-\t-"); else - (void) printf(" - - -"); + (void) printf(" - - - -"); } else { print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, scripted); @@ -2946,6 +2951,8 @@ print_list_stats(zpool_handle_t *zhp, co scripted); print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc, scripted); + print_one_column(ZPOOL_PROP_FRAGMENTATION, + vs->vs_fragmentation, scripted); } print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, scripted); @@ -3031,8 +3038,8 @@ zpool_do_list(int argc, char **argv) int ret; list_cbdata_t cb = { 0 }; static char default_props[] = - "name,size,allocated,free,expandsize,capacity,dedupratio," - "health,altroot"; + "name,size,allocated,free,fragmentation,expandsize,capacity," + "dedupratio,health,altroot"; char *props = default_props; unsigned long interval = 0, count = 0; zpool_list_t *list; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat Jul 26 09:09:14 2014 (r269117) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Sat Jul 26 10:20:48 2014 (r269118) @@ -322,6 +322,14 @@ zpool_get_prop(zpool_handle_t *zhp, zpoo (u_longlong_t)intval); } break; + case ZPOOL_PROP_FRAGMENTATION: + if (intval == UINT64_MAX) { + (void) strlcpy(buf, "-", len); + } else { + (void) snprintf(buf, len, "%llu%%", + (u_longlong_t)intval); + } + break; case ZPOOL_PROP_DEDUPRATIO: (void) snprintf(buf, len, "%llu.%02llux", Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sat Jul 26 09:09:14 2014 (r269117) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c Sat Jul 26 10:20:48 2014 (r269118) @@ -21,7 +21,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -87,6 +87,8 @@ zpool_prop_init(void) PROP_READONLY, ZFS_TYPE_POOL, "", "ALLOC"); zprop_register_number(ZPOOL_PROP_EXPANDSZ, "expandsize", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "EXPANDSZ"); + zprop_register_number(ZPOOL_PROP_FRAGMENTATION, "fragmentation", 0, + PROP_READONLY, ZFS_TYPE_POOL, "", "FRAG"); zprop_register_number(ZPOOL_PROP_CAPACITY, "capacity", 0, PROP_READONLY, ZFS_TYPE_POOL, "", "CAP"); zprop_register_number(ZPOOL_PROP_GUID, "guid", 0, PROP_READONLY, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Jul 26 09:09:14 2014 (r269117) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Jul 26 10:20:48 2014 (r269118) @@ -32,6 +32,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -89,7 +90,7 @@ int zfs_metaslab_condense_block_threshol /* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of - * a free space. Metaslab groups that have more free space than + * free space. Metaslab groups that have more free space than * zfs_mg_noalloc_threshold are always eligible for allocations. Once * a metaslab group's free space is less than or equal to the * zfs_mg_noalloc_threshold the allocator will avoid allocating to that @@ -106,6 +107,23 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo " to make it eligible for allocation"); /* + * Metaslab groups are considered eligible for allocations if their + * fragmenation metric (measured as a percentage) is less than or equal to + * zfs_mg_fragmentation_threshold. If a metaslab group exceeds this threshold + * then it will be skipped unless all metaslab groups within the metaslab + * class have also crossed this threshold. + */ +int zfs_mg_fragmentation_threshold = 85; + +/* + * Allow metaslabs to keep their active state as long as their fragmentation + * percentage is less than or equal to zfs_metaslab_fragmentation_threshold. An + * active metaslab that exceeds this threshold will no longer keep its active + * status allowing better metaslabs to be selected. + */ +int zfs_metaslab_fragmentation_threshold = 70; + +/* * When set will load all metaslabs when pool is first opened. */ int metaslab_debug_load = 0; @@ -173,13 +191,6 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, "Number of TXGs that an unused metaslab can be kept in memory"); /* - * Should we be willing to write data to degraded vdevs? - */ -boolean_t zfs_write_to_degraded = B_FALSE; -SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_degraded, CTLFLAG_RWTUN, - &zfs_write_to_degraded, 0, "Allow writing data to degraded vdevs"); - -/* * Max number of metaslabs per group to preload. */ int metaslab_preload_limit = SPA_DVAS_PER_BP; @@ -196,13 +207,30 @@ SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, "Max number of metaslabs per group to preload"); /* - * Enable/disable additional weight factor for each metaslab. + * Enable/disable fragmentation weighting on metaslabs. + */ +boolean_t metaslab_fragmentation_factor_enabled = B_TRUE; +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, fragmentation_factor_enabled, CTLFLAG_RWTUN, + &metaslab_fragmentation_factor_enabled, 0, + "Enable fragmentation weighting on metaslabs"); + +/* + * Enable/disable lba weighting (i.e. outer tracks are given preference). + */ +boolean_t metaslab_lba_weighting_enabled = B_TRUE; +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, lba_weighting_enabled, CTLFLAG_RWTUN, + &metaslab_lba_weighting_enabled, 0, + "Enable LBA weighting (i.e. outer tracks are given preference)"); + +/* + * Enable/disable metaslab group biasing. */ -boolean_t metaslab_weight_factor_enable = B_FALSE; -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, - &metaslab_weight_factor_enable, 0, - "Enable additional weight factor for each metaslab"); +boolean_t metaslab_bias_enabled = B_TRUE; +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, bias_enabled, CTLFLAG_RWTUN, + &metaslab_bias_enabled, 0, + "Enable metaslab group biasing"); +static uint64_t metaslab_fragmentation(metaslab_t *); /* * ========================================================================== @@ -322,6 +350,121 @@ metaslab_class_get_minblocksize(metaslab return (mc->mc_minblocksize); } +void +metaslab_class_histogram_verify(metaslab_class_t *mc) +{ + vdev_t *rvd = mc->mc_spa->spa_root_vdev; + uint64_t *mc_hist; + int i; + + if ((zfs_flags & ZFS_DEBUG_HISTOGRAM_VERIFY) == 0) + return; + + mc_hist = kmem_zalloc(sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE, + KM_SLEEP); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + /* + * Skip any holes, uninitialized top-levels, or + * vdevs that are not in this metalab class. + */ + if (tvd->vdev_ishole || tvd->vdev_ms_shift == 0 || + mg->mg_class != mc) { + continue; + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) + mc_hist[i] += mg->mg_histogram[i]; + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i++) + VERIFY3U(mc_hist[i], ==, mc->mc_histogram[i]); + + kmem_free(mc_hist, sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE); +} + +/* + * Calculate the metaslab class's fragmentation metric. The metric + * is weighted based on the space contribution of each metaslab group. + * The return value will be a number between 0 and 100 (inclusive), or + * ZFS_FRAG_INVALID if the metric has not been set. See comment above the + * zfs_frag_table for more information about the metric. + */ +uint64_t +metaslab_class_fragmentation(metaslab_class_t *mc) +{ + vdev_t *rvd = mc->mc_spa->spa_root_vdev; + uint64_t fragmentation = 0; + + spa_config_enter(mc->mc_spa, SCL_VDEV, FTAG, RW_READER); + + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + /* + * Skip any holes, uninitialized top-levels, or + * vdevs that are not in this metalab class. + */ + if (tvd->vdev_ishole || tvd->vdev_ms_shift == 0 || + mg->mg_class != mc) { + continue; + } + + /* + * If a metaslab group does not contain a fragmentation + * metric then just bail out. + */ + if (mg->mg_fragmentation == ZFS_FRAG_INVALID) { + spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); + return (ZFS_FRAG_INVALID); + } + + /* + * Determine how much this metaslab_group is contributing + * to the overall pool fragmentation metric. + */ + fragmentation += mg->mg_fragmentation * + metaslab_group_get_space(mg); + } + fragmentation /= metaslab_class_get_space(mc); + + ASSERT3U(fragmentation, <=, 100); + spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); + return (fragmentation); +} + +/* + * Calculate the amount of expandable space that is available in + * this metaslab class. If a device is expanded then its expandable + * space will be the amount of allocatable space that is currently not + * part of this metaslab class. + */ +uint64_t +metaslab_class_expandable_space(metaslab_class_t *mc) +{ + vdev_t *rvd = mc->mc_spa->spa_root_vdev; + uint64_t space = 0; + + spa_config_enter(mc->mc_spa, SCL_VDEV, FTAG, RW_READER); + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (tvd->vdev_ishole || tvd->vdev_ms_shift == 0 || + mg->mg_class != mc) { + continue; + } + + space += tvd->vdev_max_asize - tvd->vdev_asize; + } + spa_config_exit(mc->mc_spa, SCL_VDEV, FTAG); + return (space); +} + /* * ========================================================================== * Metaslab groups @@ -374,7 +517,15 @@ metaslab_group_alloc_update(metaslab_gro mg->mg_free_capacity = ((vs->vs_space - vs->vs_alloc) * 100) / (vs->vs_space + 1); - mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold); + /* + * A metaslab group is considered allocatable if it has plenty + * of free space or is not heavily fragmented. We only take + * fragmentation into account if the metaslab group has a valid + * fragmentation metric (i.e. a value between 0 and 100). + */ + mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold && + (mg->mg_fragmentation == ZFS_FRAG_INVALID || + mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)); /* * The mc_alloc_groups maintains a count of the number of @@ -395,6 +546,7 @@ metaslab_group_alloc_update(metaslab_gro mc->mc_alloc_groups--; else if (!was_allocatable && mg->mg_allocatable) mc->mc_alloc_groups++; + mutex_exit(&mg->mg_lock); } @@ -485,6 +637,7 @@ metaslab_group_passivate(metaslab_group_ } taskq_wait(mg->mg_taskq); + metaslab_group_alloc_update(mg); mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -502,20 +655,113 @@ metaslab_group_passivate(metaslab_group_ metaslab_class_minblocksize_update(mc); } +uint64_t +metaslab_group_get_space(metaslab_group_t *mg) +{ + return ((1ULL << mg->mg_vd->vdev_ms_shift) * mg->mg_vd->vdev_ms_count); +} + +void +metaslab_group_histogram_verify(metaslab_group_t *mg) +{ + uint64_t *mg_hist; + vdev_t *vd = mg->mg_vd; + uint64_t ashift = vd->vdev_ashift; + int i; + + if ((zfs_flags & ZFS_DEBUG_HISTOGRAM_VERIFY) == 0) + return; + + mg_hist = kmem_zalloc(sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE, + KM_SLEEP); + + ASSERT3U(RANGE_TREE_HISTOGRAM_SIZE, >=, + SPACE_MAP_HISTOGRAM_SIZE + ashift); + + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + + if (msp->ms_sm == NULL) + continue; + + for (i = 0; i < SPACE_MAP_HISTOGRAM_SIZE; i++) + mg_hist[i + ashift] += + msp->ms_sm->sm_phys->smp_histogram[i]; + } + + for (i = 0; i < RANGE_TREE_HISTOGRAM_SIZE; i ++) + VERIFY3U(mg_hist[i], ==, mg->mg_histogram[i]); + + kmem_free(mg_hist, sizeof (uint64_t) * RANGE_TREE_HISTOGRAM_SIZE); +} + static void -metaslab_group_add(metaslab_group_t *mg, metaslab_t *msp) +metaslab_group_histogram_add(metaslab_group_t *mg, metaslab_t *msp) { + metaslab_class_t *mc = mg->mg_class; + uint64_t ashift = mg->mg_vd->vdev_ashift; + + ASSERT(MUTEX_HELD(&msp->ms_lock)); + if (msp->ms_sm == NULL) + return; + mutex_enter(&mg->mg_lock); + for (int i = 0; i < SPACE_MAP_HISTOGRAM_SIZE; i++) { + mg->mg_histogram[i + ashift] += + msp->ms_sm->sm_phys->smp_histogram[i]; + mc->mc_histogram[i + ashift] += + msp->ms_sm->sm_phys->smp_histogram[i]; + } + mutex_exit(&mg->mg_lock); +} + +void +metaslab_group_histogram_remove(metaslab_group_t *mg, metaslab_t *msp) +{ + metaslab_class_t *mc = mg->mg_class; + uint64_t ashift = mg->mg_vd->vdev_ashift; + + ASSERT(MUTEX_HELD(&msp->ms_lock)); + if (msp->ms_sm == NULL) + return; + + mutex_enter(&mg->mg_lock); + for (int i = 0; i < SPACE_MAP_HISTOGRAM_SIZE; i++) { + ASSERT3U(mg->mg_histogram[i + ashift], >=, + msp->ms_sm->sm_phys->smp_histogram[i]); + ASSERT3U(mc->mc_histogram[i + ashift], >=, + msp->ms_sm->sm_phys->smp_histogram[i]); + + mg->mg_histogram[i + ashift] -= + msp->ms_sm->sm_phys->smp_histogram[i]; + mc->mc_histogram[i + ashift] -= + msp->ms_sm->sm_phys->smp_histogram[i]; + } + mutex_exit(&mg->mg_lock); +} + +static void +metaslab_group_add(metaslab_group_t *mg, metaslab_t *msp) +{ ASSERT(msp->ms_group == NULL); + mutex_enter(&mg->mg_lock); msp->ms_group = mg; msp->ms_weight = 0; avl_add(&mg->mg_metaslab_tree, msp); mutex_exit(&mg->mg_lock); + + mutex_enter(&msp->ms_lock); + metaslab_group_histogram_add(mg, msp); + mutex_exit(&msp->ms_lock); } static void metaslab_group_remove(metaslab_group_t *mg, metaslab_t *msp) { + mutex_enter(&msp->ms_lock); + metaslab_group_histogram_remove(mg, msp); + mutex_exit(&msp->ms_lock); + mutex_enter(&mg->mg_lock); ASSERT(msp->ms_group == mg); avl_remove(&mg->mg_metaslab_tree, msp); @@ -528,9 +774,9 @@ metaslab_group_sort(metaslab_group_t *mg { /* * Although in principle the weight can be any value, in - * practice we do not use values in the range [1, 510]. + * practice we do not use values in the range [1, 511]. */ - ASSERT(weight >= SPA_MINBLOCKSIZE-1 || weight == 0); + ASSERT(weight >= SPA_MINBLOCKSIZE || weight == 0); ASSERT(MUTEX_HELD(&msp->ms_lock)); mutex_enter(&mg->mg_lock); @@ -542,9 +788,42 @@ metaslab_group_sort(metaslab_group_t *mg } /* + * Calculate the fragmentation for a given metaslab group. We can use + * a simple average here since all metaslabs within the group must have + * the same size. The return value will be a value between 0 and 100 + * (inclusive), or ZFS_FRAG_INVALID if less than half of the metaslab in this + * group have a fragmentation metric. + */ +uint64_t +metaslab_group_fragmentation(metaslab_group_t *mg) +{ + vdev_t *vd = mg->mg_vd; + uint64_t fragmentation = 0; + uint64_t valid_ms = 0; + + for (int m = 0; m < vd->vdev_ms_count; m++) { + metaslab_t *msp = vd->vdev_ms[m]; + + if (msp->ms_fragmentation == ZFS_FRAG_INVALID) + continue; + + valid_ms++; + fragmentation += msp->ms_fragmentation; + } + + if (valid_ms <= vd->vdev_ms_count / 2) + return (ZFS_FRAG_INVALID); + + fragmentation /= valid_ms; + ASSERT3U(fragmentation, <=, 100); + return (fragmentation); +} + +/* * Determine if a given metaslab group should skip allocations. A metaslab - * group should avoid allocations if its used capacity has crossed the - * zfs_mg_noalloc_threshold and there is at least one metaslab group + * group should avoid allocations if its free capacity is less than the + * zfs_mg_noalloc_threshold or its fragmentation metric is greater than + * zfs_mg_fragmentation_threshold and there is at least one metaslab group * that can still handle allocations. */ static boolean_t @@ -555,12 +834,19 @@ metaslab_group_allocatable(metaslab_grou metaslab_class_t *mc = mg->mg_class; /* - * A metaslab group is considered allocatable if its free capacity - * is greater than the set value of zfs_mg_noalloc_threshold, it's - * associated with a slog, or there are no other metaslab groups - * with free capacity greater than zfs_mg_noalloc_threshold. - */ - return (mg->mg_free_capacity > zfs_mg_noalloc_threshold || + * We use two key metrics to determine if a metaslab group is + * considered allocatable -- free space and fragmentation. If + * the free space is greater than the free space threshold and + * the fragmentation is less than the fragmentation threshold then + * consider the group allocatable. There are two case when we will + * not consider these key metrics. The first is if the group is + * associated with a slog device and the second is if all groups + * in this metaslab class have already been consider ineligible + * for allocations. + */ + return ((mg->mg_free_capacity > zfs_mg_noalloc_threshold && + (mg->mg_fragmentation == ZFS_FRAG_INVALID || + mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)) || mc != spa_normal_class(spa) || mc->mc_alloc_groups == 0); } @@ -784,16 +1070,8 @@ metaslab_ff_alloc(metaslab_t *msp, uint6 return (metaslab_block_picker(t, cursor, size, align)); } -/* ARGSUSED */ -static boolean_t -metaslab_ff_fragmented(metaslab_t *msp) -{ - return (B_TRUE); -} - static metaslab_ops_t metaslab_ff_ops = { - metaslab_ff_alloc, - metaslab_ff_fragmented + metaslab_ff_alloc }; /* @@ -840,23 +1118,8 @@ metaslab_df_alloc(metaslab_t *msp, uint6 return (metaslab_block_picker(t, cursor, size, 1ULL)); } -static boolean_t -metaslab_df_fragmented(metaslab_t *msp) -{ - range_tree_t *rt = msp->ms_tree; - uint64_t max_size = metaslab_block_maxsize(msp); - int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - - if (max_size >= metaslab_df_alloc_threshold && - free_pct >= metaslab_df_free_pct) - return (B_FALSE); - - return (B_TRUE); -} - static metaslab_ops_t metaslab_df_ops = { - metaslab_df_alloc, - metaslab_df_fragmented + metaslab_df_alloc }; /* @@ -899,15 +1162,8 @@ metaslab_cf_alloc(metaslab_t *msp, uint6 return (offset); } -static boolean_t -metaslab_cf_fragmented(metaslab_t *msp) -{ - return (metaslab_block_maxsize(msp) < metaslab_min_alloc_size); -} - static metaslab_ops_t metaslab_cf_ops = { - metaslab_cf_alloc, - metaslab_cf_fragmented + metaslab_cf_alloc }; /* @@ -964,16 +1220,8 @@ metaslab_ndf_alloc(metaslab_t *msp, uint return (-1ULL); } -static boolean_t -metaslab_ndf_fragmented(metaslab_t *msp) -{ - return (metaslab_block_maxsize(msp) <= - (metaslab_min_alloc_size << metaslab_ndf_clump_shift)); -} - static metaslab_ops_t metaslab_ndf_ops = { - metaslab_ndf_alloc, - metaslab_ndf_fragmented + metaslab_ndf_alloc }; metaslab_ops_t *zfs_metaslab_ops = &metaslab_df_ops; @@ -1075,6 +1323,7 @@ metaslab_init(metaslab_group_t *mg, uint msp->ms_tree = range_tree_create(&metaslab_rt_ops, msp, &msp->ms_lock); metaslab_group_add(mg, msp); + msp->ms_fragmentation = metaslab_fragmentation(msp); msp->ms_ops = mg->mg_class->mc_ops; /* @@ -1140,69 +1389,113 @@ metaslab_fini(metaslab_t *msp) kmem_free(msp, sizeof (metaslab_t)); } +#define FRAGMENTATION_TABLE_SIZE 17 + /* - * Apply a weighting factor based on the histogram information for this - * metaslab. The current weighting factor is somewhat arbitrary and requires - * additional investigation. The implementation provides a measure of - * "weighted" free space and gives a higher weighting for larger contiguous - * regions. The weighting factor is determined by counting the number of - * sm_shift sectors that exist in each region represented by the histogram. - * That value is then multiplied by the power of 2 exponent and the sm_shift - * value. + * This table defines a segment size based fragmentation metric that will + * allow each metaslab to derive its own fragmentation value. This is done + * by calculating the space in each bucket of the spacemap histogram and + * multiplying that by the fragmetation metric in this table. Doing + * this for all buckets and dividing it by the total amount of free + * space in this metaslab (i.e. the total free space in all buckets) gives + * us the fragmentation metric. This means that a high fragmentation metric + * equates to most of the free space being comprised of small segments. + * Conversely, if the metric is low, then most of the free space is in + * large segments. A 10% change in fragmentation equates to approximately + * double the number of segments. * - * For example, assume the 2^21 histogram bucket has 4 2MB regions and the - * metaslab has an sm_shift value of 9 (512B): *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 12:17:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA1C6DFE; Sat, 26 Jul 2014 12:17:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7EA62636; Sat, 26 Jul 2014 12:17:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QCHQ9B088486; Sat, 26 Jul 2014 12:17:26 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QCHQN8088485; Sat, 26 Jul 2014 12:17:26 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201407261217.s6QCHQN8088485@svn.freebsd.org> From: Stefan Esser Date: Sat, 26 Jul 2014 12:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269119 - head/usr.sbin/kbdcontrol 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.18 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, 26 Jul 2014 12:17:26 -0000 Author: se Date: Sat Jul 26 12:17:26 2014 New Revision: 269119 URL: http://svnweb.freebsd.org/changeset/base/269119 Log: Fix obvious off by one error: prefix[1] should be set to the path of the newcons specific keymap files, not prefix[2]. The result of this bug was that kbdcontrol ignored the files in the syscons keymap directory, which apparently still work under newcons, for most locales. MFC after: 1 week Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Sat Jul 26 10:20:48 2014 (r269118) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Sat Jul 26 12:17:26 2014 (r269119) @@ -804,7 +804,7 @@ load_keymap(char *opt, int dumponly) char *postfix[] = {blank, dotkbd, NULL}; if (is_vt4()) - prefix[2] = vt_keymap_path; + prefix[1] = vt_keymap_path; cp = getenv("KEYMAP_PATH"); if (cp != NULL) asprintf(&(prefix[0]), "%s/", cp); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 13:14:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CF80AB7; Sat, 26 Jul 2014 13:14:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AAB42AF5; Sat, 26 Jul 2014 13:14:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QDESFs015454; Sat, 26 Jul 2014 13:14:28 GMT (envelope-from se@svn.freebsd.org) Received: (from se@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QDESOC015453; Sat, 26 Jul 2014 13:14:28 GMT (envelope-from se@svn.freebsd.org) Message-Id: <201407261314.s6QDESOC015453@svn.freebsd.org> From: Stefan Esser Date: Sat, 26 Jul 2014 13:14:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269120 - head/usr.sbin/kbdcontrol 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.18 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, 26 Jul 2014 13:14:29 -0000 Author: se Date: Sat Jul 26 13:14:28 2014 New Revision: 269120 URL: http://svnweb.freebsd.org/changeset/base/269120 Log: The previous commit (r269119) introduced a regression: It removed the ability to specify the the full path name of the keymap file. Instead leave the original search order intact, but insert the path for newcons-specific fonts (if run on a system using newcons): - KEYMAP_PATH in environment - full path name - /usr/share/vt/keymaps (only if newcons is in use!) - /usr/share/syscons/keymaps (also as fall-back for newcons) MFC after: 1 week Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Sat Jul 26 12:17:26 2014 (r269119) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Sat Jul 26 13:14:28 2014 (r269120) @@ -800,11 +800,11 @@ load_keymap(char *opt, int dumponly) char *name, *cp; char blank[] = "", keymap_path[] = KEYMAP_PATH; char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd"; - char *prefix[] = {blank, blank, keymap_path, NULL}; + char *prefix[] = {blank, blank, blank, keymap_path, NULL}; char *postfix[] = {blank, dotkbd, NULL}; if (is_vt4()) - prefix[1] = vt_keymap_path; + prefix[2] = vt_keymap_path; cp = getenv("KEYMAP_PATH"); if (cp != NULL) asprintf(&(prefix[0]), "%s/", cp); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 13:43:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1889F6CC; Sat, 26 Jul 2014 13:43:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0693B2D56; Sat, 26 Jul 2014 13:43:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QDhP4W028727; Sat, 26 Jul 2014 13:43:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QDhP5h028726; Sat, 26 Jul 2014 13:43:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407261343.s6QDhP5h028726@svn.freebsd.org> From: Alexander Motin Date: Sat, 26 Jul 2014 13:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269122 - head/sys/cam/ctl 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.18 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, 26 Jul 2014 13:43:26 -0000 Author: mav Date: Sat Jul 26 13:43:25 2014 New Revision: 269122 URL: http://svnweb.freebsd.org/changeset/base/269122 Log: Fix infinite loop, when doing WRITE SAME on file-backed LUN. MFC after: 3 days Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Jul 26 13:37:25 2014 (r269121) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Jul 26 13:43:25 2014 (r269122) @@ -722,10 +722,11 @@ ctl_be_block_dispatch_file(struct ctl_be } /* - * If this is a write, we're all done. + * If this is a write or a verify, we're all done. * If this is a read, we can now send the data to the user. */ - if (ARGS(io)->flags & (CTL_LLF_WRITE | CTL_LLF_VERIFY)) { + if ((beio->bio_cmd == BIO_WRITE) || + (ARGS(io)->flags & CTL_LLF_VERIFY)) { ctl_set_success(&io->scsiio); ctl_complete_beio(beio); } else { From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 13:56:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C0CA6901; Sat, 26 Jul 2014 13:56:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE6852E3C; Sat, 26 Jul 2014 13:56:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QDuoJj033602; Sat, 26 Jul 2014 13:56:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QDuotb033601; Sat, 26 Jul 2014 13:56:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407261356.s6QDuotb033601@svn.freebsd.org> From: Alexander Motin Date: Sat, 26 Jul 2014 13:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269123 - head/sys/cam/ctl 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.18 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, 26 Jul 2014 13:56:50 -0000 Author: mav Date: Sat Jul 26 13:56:50 2014 New Revision: 269123 URL: http://svnweb.freebsd.org/changeset/base/269123 Log: Implement separate I/O dispatch method for ZVOLs in "dev" mode. Unlike disk devices ZVOLs process all requests synchronously. That makes impossible sending multiple requests to them from single thread. From the other side ZVOLs have real d_read/d_write methods, which unlike d_strategy can handle uio scatter/gather and have no strict I/O size limitations. So, if ZVOL in "dev" mode is detected, use of d_read/d_write methods instead of d_strategy allows to avoid pointless splitting of large requests into MAXPHYS (128K) sized chunks. MFC after: 1 week Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Jul 26 13:43:25 2014 (r269122) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Jul 26 13:56:50 2014 (r269123) @@ -738,6 +738,88 @@ ctl_be_block_dispatch_file(struct ctl_be } static void +ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + struct ctl_be_block_devdata *dev_data; + union ctl_io *io; + struct uio xuio; + struct iovec *xiovec; + int flags; + int error, i; + + DPRINTF("entered\n"); + + dev_data = &be_lun->backend.dev; + io = beio->io; + flags = beio->bio_flags; + + bzero(&xuio, sizeof(xuio)); + if (beio->bio_cmd == BIO_READ) { + SDT_PROBE(cbb, kernel, read, file_start, 0, 0, 0, 0, 0); + xuio.uio_rw = UIO_READ; + } else { + SDT_PROBE(cbb, kernel, write, file_start, 0, 0, 0, 0, 0); + xuio.uio_rw = UIO_WRITE; + } + xuio.uio_offset = beio->io_offset; + xuio.uio_resid = beio->io_len; + xuio.uio_segflg = UIO_SYSSPACE; + xuio.uio_iov = beio->xiovecs; + xuio.uio_iovcnt = beio->num_segs; + xuio.uio_td = curthread; + + for (i = 0, xiovec = xuio.uio_iov; i < xuio.uio_iovcnt; i++, xiovec++) { + xiovec->iov_base = beio->sg_segs[i].addr; + xiovec->iov_len = beio->sg_segs[i].len; + } + + binuptime(&beio->ds_t0); + mtx_lock(&be_lun->io_lock); + devstat_start_transaction(beio->lun->disk_stats, &beio->ds_t0); + mtx_unlock(&be_lun->io_lock); + + if (beio->bio_cmd == BIO_READ) { + error = (*dev_data->csw->d_read)(dev_data->cdev, &xuio, 0); + SDT_PROBE(cbb, kernel, read, file_done, 0, 0, 0, 0, 0); + } else { + error = (*dev_data->csw->d_write)(dev_data->cdev, &xuio, 0); + SDT_PROBE(cbb, kernel, write, file_done, 0, 0, 0, 0, 0); + } + + mtx_lock(&be_lun->io_lock); + devstat_end_transaction(beio->lun->disk_stats, beio->io_len, + beio->ds_tag_type, beio->ds_trans_type, + /*now*/ NULL, /*then*/&beio->ds_t0); + mtx_unlock(&be_lun->io_lock); + + /* + * If we got an error, set the sense data to "MEDIUM ERROR" and + * return the I/O to the user. + */ + if (error != 0) { + ctl_set_medium_error(&io->scsiio); + ctl_complete_beio(beio); + return; + } + + /* + * If this is a write or a verify, we're all done. + * If this is a read, we can now send the data to the user. + */ + if ((beio->bio_cmd == BIO_WRITE) || + (ARGS(io)->flags & CTL_LLF_VERIFY)) { + ctl_set_success(&io->scsiio); + ctl_complete_beio(beio); + } else { +#ifdef CTL_TIME_IO + getbintime(&io->io_hdr.dma_start_bt); +#endif + ctl_datamove(io); + } +} + +static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -1578,14 +1660,17 @@ ctl_be_block_open_dev(struct ctl_be_bloc params = &req->reqdata.create; be_lun->dev_type = CTL_BE_BLOCK_DEV; - be_lun->dispatch = ctl_be_block_dispatch_dev; - be_lun->lun_flush = ctl_be_block_flush_dev; - be_lun->unmap = ctl_be_block_unmap_dev; be_lun->backend.dev.cdev = be_lun->vn->v_rdev; be_lun->backend.dev.csw = dev_refthread(be_lun->backend.dev.cdev, &be_lun->backend.dev.dev_ref); if (be_lun->backend.dev.csw == NULL) panic("Unable to retrieve device switch"); + if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) + be_lun->dispatch = ctl_be_block_dispatch_zvol; + else + be_lun->dispatch = ctl_be_block_dispatch_dev; + be_lun->lun_flush = ctl_be_block_flush_dev; + be_lun->unmap = ctl_be_block_unmap_dev; error = VOP_GETATTR(be_lun->vn, &vattr, NOCRED); if (error) { From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 14:24:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CAE28F3C; Sat, 26 Jul 2014 14:24:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC1C22060; Sat, 26 Jul 2014 14:24:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QEODLd047368; Sat, 26 Jul 2014 14:24:13 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QEODbm047367; Sat, 26 Jul 2014 14:24:13 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407261424.s6QEODbm047367@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 26 Jul 2014 14:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269124 - head/lib/libc/stdtime 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.18 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, 26 Jul 2014 14:24:13 -0000 Author: pfg Date: Sat Jul 26 14:24:13 2014 New Revision: 269124 URL: http://svnweb.freebsd.org/changeset/base/269124 Log: strftime() xlocale cleanups. Replace fprintf_l with fputs when output is unformatted. Use locale_t in _conv() since it was using sprintf (now sprintf_l) Use locale_t on _yconv() sinci it calls _conv() Obtained from: Apple Inc. (Libc 997.90.3) CR: D482 Reviewed by: theraven MFC after: 1 week Modified: head/lib/libc/stdtime/strftime.c Modified: head/lib/libc/stdtime/strftime.c ============================================================================== --- head/lib/libc/stdtime/strftime.c Sat Jul 26 13:56:50 2014 (r269123) +++ head/lib/libc/stdtime/strftime.c Sat Jul 26 14:24:13 2014 (r269124) @@ -46,10 +46,10 @@ __FBSDID("$FreeBSD$"); #include "timelocal.h" static char * _add(const char *, char *, const char *); -static char * _conv(int, const char *, char *, const char *); +static char * _conv(int, const char *, char *, const char *, locale_t); static char * _fmt(const char *, const struct tm *, char *, const char *, int *, locale_t); -static char * _yconv(int, int, int, int, char *, const char *); +static char * _yconv(int, int, int, int, char *, const char *, locale_t); extern char * tzname[]; @@ -101,16 +101,16 @@ strftime_l(char * __restrict s, size_t m if (warn != IN_NONE && getenv(YEAR_2000_NAME) != NULL) { (void) fprintf_l(stderr, loc, "\n"); if (format == NULL) - (void) fprintf_l(stderr, loc, "NULL strftime format "); + (void) fputs("NULL strftime format ", stderr); else (void) fprintf_l(stderr, loc, "strftime format \"%s\" ", format); - (void) fprintf_l(stderr, loc, "yields only two digits of years in "); + (void) fputs("yields only two digits of years in ", stderr); if (warn == IN_SOME) - (void) fprintf_l(stderr, loc, "some locales"); + (void) fputs("some locales", stderr); else if (warn == IN_THIS) - (void) fprintf_l(stderr, loc, "the current locale"); - else (void) fprintf_l(stderr, loc, "all locales"); - (void) fprintf_l(stderr, loc, "\n"); + (void) fputs("the current locale", stderr); + else (void) fputs("all locales", stderr); + (void) fputs("\n", stderr); } #endif /* !defined NO_RUN_TIME_WARNINGS_ABOUT_YEAR_2000_PROBLEMS_THANK_YOU */ if (p == s + maxsize) @@ -183,7 +183,7 @@ label: * (ado, 1993-05-24) */ pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 0, - pt, ptlim); + pt, ptlim, loc); continue; case 'c': { @@ -200,8 +200,9 @@ label: pt = _fmt("%m/%d/%y", t, pt, ptlim, warnp, loc); continue; case 'd': - pt = _conv(t->tm_mday, fmt_padding[PAD_FMT_DAYOFMONTH][PadIndex], - pt, ptlim); + pt = _conv(t->tm_mday, + fmt_padding[PAD_FMT_DAYOFMONTH][PadIndex], + pt, ptlim, loc); continue; case 'E': if (Ealternative || Oalternative) @@ -227,24 +228,26 @@ label: goto label; case 'e': pt = _conv(t->tm_mday, - fmt_padding[PAD_FMT_SDAYOFMONTH][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_SDAYOFMONTH][PadIndex], + pt, ptlim, loc); continue; case 'F': pt = _fmt("%Y-%m-%d", t, pt, ptlim, warnp, loc); continue; case 'H': pt = _conv(t->tm_hour, fmt_padding[PAD_FMT_HMS][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; case 'I': pt = _conv((t->tm_hour % 12) ? (t->tm_hour % 12) : 12, fmt_padding[PAD_FMT_HMS][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; case 'j': pt = _conv(t->tm_yday + 1, - fmt_padding[PAD_FMT_DAYOFYEAR][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_DAYOFYEAR][PadIndex], + pt, ptlim, loc); continue; case 'k': /* @@ -258,7 +261,7 @@ label: * (ado, 1993-05-24) */ pt = _conv(t->tm_hour, fmt_padding[PAD_FMT_SHMS][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; #ifdef KITCHEN_SINK case 'K': @@ -281,16 +284,16 @@ label: pt = _conv((t->tm_hour % 12) ? (t->tm_hour % 12) : 12, fmt_padding[PAD_FMT_SHMS][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; case 'M': pt = _conv(t->tm_min, fmt_padding[PAD_FMT_HMS][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; case 'm': pt = _conv(t->tm_mon + 1, fmt_padding[PAD_FMT_MONTH][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; case 'n': pt = _add("\n", pt, ptlim); @@ -309,7 +312,7 @@ label: continue; case 'S': pt = _conv(t->tm_sec, fmt_padding[PAD_FMT_HMS][PadIndex], - pt, ptlim); + pt, ptlim, loc); continue; case 's': { @@ -321,9 +324,9 @@ label: tm = *t; mkt = mktime(&tm); if (TYPE_SIGNED(time_t)) - (void) sprintf(buf, "%ld", + (void) sprintf_l(buf, loc, "%ld", (long) mkt); - else (void) sprintf(buf, "%lu", + else (void) sprintf_l(buf, loc, "%lu", (unsigned long) mkt); pt = _add(buf, pt, ptlim); } @@ -337,7 +340,8 @@ label: case 'U': pt = _conv((t->tm_yday + DAYSPERWEEK - t->tm_wday) / DAYSPERWEEK, - fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], + pt, ptlim, loc); continue; case 'u': /* @@ -348,7 +352,7 @@ label: */ pt = _conv((t->tm_wday == 0) ? DAYSPERWEEK : t->tm_wday, - "%d", pt, ptlim); + "%d", pt, ptlim, loc); continue; case 'V': /* ISO 8601 week number */ case 'G': /* ISO 8601 year (four digits) */ @@ -429,13 +433,13 @@ label: #endif /* defined XPG4_1994_04_09 */ if (*format == 'V') pt = _conv(w, fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], - pt, ptlim); + pt, ptlim, loc); else if (*format == 'g') { *warnp = IN_ALL; pt = _yconv(year, base, 0, 1, - pt, ptlim); + pt, ptlim, loc); } else pt = _yconv(year, base, 1, 1, - pt, ptlim); + pt, ptlim, loc); } continue; case 'v': @@ -451,10 +455,11 @@ label: (t->tm_wday ? (t->tm_wday - 1) : (DAYSPERWEEK - 1))) / DAYSPERWEEK, - fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_WEEKOFYEAR][PadIndex], + pt, ptlim, loc); continue; case 'w': - pt = _conv(t->tm_wday, "%d", pt, ptlim); + pt = _conv(t->tm_wday, "%d", pt, ptlim, loc); continue; case 'X': pt = _fmt(tptr->X_fmt, t, pt, ptlim, warnp, loc); @@ -473,11 +478,11 @@ label: case 'y': *warnp = IN_ALL; pt = _yconv(t->tm_year, TM_YEAR_BASE, 0, 1, - pt, ptlim); + pt, ptlim, loc); continue; case 'Y': pt = _yconv(t->tm_year, TM_YEAR_BASE, 1, 1, - pt, ptlim); + pt, ptlim, loc); continue; case 'Z': #ifdef TM_ZONE @@ -546,7 +551,8 @@ label: diff = (diff / MINSPERHOUR) * 100 + (diff % MINSPERHOUR); pt = _conv(diff, - fmt_padding[PAD_FMT_YEAR][PadIndex], pt, ptlim); + fmt_padding[PAD_FMT_YEAR][PadIndex], + pt, ptlim, loc); } continue; case '+': @@ -586,15 +592,16 @@ label: } static char * -_conv(n, format, pt, ptlim) +_conv(n, format, pt, ptlim, loc) const int n; const char * const format; char * const pt; const char * const ptlim; +locale_t loc; { char buf[INT_STRLEN_MAXIMUM(int) + 1]; - (void) sprintf(buf, format, n); + (void) sprintf_l(buf, loc, format, n); return _add(buf, pt, ptlim); } @@ -618,13 +625,14 @@ const char * const ptlim; */ static char * -_yconv(a, b, convert_top, convert_yy, pt, ptlim) +_yconv(a, b, convert_top, convert_yy, pt, ptlim, loc) const int a; const int b; const int convert_top; const int convert_yy; char * pt; const char * const ptlim; +locale_t loc; { register int lead; register int trail; @@ -643,9 +651,10 @@ const char * const ptlim; if (convert_top) { if (lead == 0 && trail < 0) pt = _add("-0", pt, ptlim); - else pt = _conv(lead, "%02d", pt, ptlim); + else pt = _conv(lead, "%02d", pt, ptlim, loc); } if (convert_yy) - pt = _conv(((trail < 0) ? -trail : trail), "%02d", pt, ptlim); + pt = _conv(((trail < 0) ? -trail : trail), "%02d", pt, + ptlim, loc); return (pt); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 14:33:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DA7D273; Sat, 26 Jul 2014 14:33:04 +0000 (UTC) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12BAC2122; Sat, 26 Jul 2014 14:33:03 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id a141so4363243oig.14 for ; Sat, 26 Jul 2014 07:33:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Tx7H2BE2+MQIhhPeau+5DAup0nPZR/NSHJZthZmsVtE=; b=PznMtdSBR6EVHOpD1I6jzr+M4LI5n3zFl8xoqtM3UxJ2KZ6yRW6j0LF13+eLNJsmtG 7CR75MP+hphGtXG6NDyZTUZtt6SxS+A3r0QfvPFmm1Ph+vqflcnShoGO1rbw3C5aegPo A/tJFFyWyp2e97a5af6sT+9MlWXmYmOOUVn13wdB3/vXOaObwpDtZLnASrna3vQ9Jc5B yRXDufHGheqBM5j7gUw9WyealP74leAOv+Zqz84wa8rjvjcTlbn9/8e0OA28BZk8e71A amVYQZepwDAFCE0D5Bdb120DxqmGxta0uuEZw+CpTw6k8gqqtWwZUDaYlATb+Qreq8y9 hC9w== MIME-Version: 1.0 X-Received: by 10.60.34.225 with SMTP id c1mr32352572oej.14.1406385183132; Sat, 26 Jul 2014 07:33:03 -0700 (PDT) Received: by 10.182.142.34 with HTTP; Sat, 26 Jul 2014 07:33:03 -0700 (PDT) In-Reply-To: <201407260409.s6Q49i20065578@svn.freebsd.org> References: <201407260409.s6Q49i20065578@svn.freebsd.org> Date: Sat, 26 Jul 2014 10:33:03 -0400 Message-ID: Subject: Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2 From: Benjamin Kaduk To: Ian Lepore Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 14:33:04 -0000 On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore wrote: > Author: ian > Date: Sat Jul 26 04:09:43 2014 > New Revision: 269112 > URL: http://svnweb.freebsd.org/changeset/base/269112 > > Log: > The 'flags' variable is conflicting with some inline code in a header > file > ("variable flags shadows a global..."), just rename this variable to > wish away the problem. > Not trying to pick on you, but we have lots of places where we get "variable shadows a global..." -- we have a global variable 'buf' in the kernel namespace, for one :) Do we think it's a good use of our time to try and get this to zero instances? -Ben From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 14:43:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4ECA55E; Sat, 26 Jul 2014 14:43:57 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (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 A5E312219; Sat, 26 Jul 2014 14:43:57 +0000 (UTC) Received: from c-50-155-136-3.hsd1.co.comcast.net ([50.155.136.3] helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XB3CW-000KpC-2k; Sat, 26 Jul 2014 14:43:56 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s6QEhtZi003474; Sat, 26 Jul 2014 08:43:55 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.155.136.3 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18eTzlsjgwWOTCPUIKVltde X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2 From: Ian Lepore To: Benjamin Kaduk In-Reply-To: References: <201407260409.s6Q49i20065578@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 26 Jul 2014 08:43:54 -0600 Message-ID: <1406385834.56408.24.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 14:43:57 -0000 On Sat, 2014-07-26 at 10:33 -0400, Benjamin Kaduk wrote: > On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore wrote: > > > Author: ian > > Date: Sat Jul 26 04:09:43 2014 > > New Revision: 269112 > > URL: http://svnweb.freebsd.org/changeset/base/269112 > > > > Log: > > The 'flags' variable is conflicting with some inline code in a header > > file > > ("variable flags shadows a global..."), just rename this variable to > > wish away the problem. > > > > Not trying to pick on you, but we have lots of places where we get > "variable shadows a global..." -- we have a global variable 'buf' in > the kernel namespace, for one :) > Do we think it's a good use of our time to try and get this to zero > instances? > > -Ben It was breakage I had to fix to get it to build so I could move ahead to the changes I was actually trying to make. (We use this stuff at $work; it has actually been disconnected from the build in freebsd for quite a while and has bitrotted. My goal is basically diff reduction between our repo at work and the base, and closing a 3 year old PR.) I guess boot2 must build with -Werror or something -- I didn't even think about changing the flags, I just did the same thing we did at work a couple years ago. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 15:33:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CFB14E16; Sat, 26 Jul 2014 15:33:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A361825BE; Sat, 26 Jul 2014 15:33:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QFXLwi078938; Sat, 26 Jul 2014 15:33:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QFXLxO078936; Sat, 26 Jul 2014 15:33:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201407261533.s6QFXLxO078936@svn.freebsd.org> From: Dimitry Andric Date: Sat, 26 Jul 2014 15:33:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269125 - in head: lib/libarchive rescue/rescue 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.18 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, 26 Jul 2014 15:33:22 -0000 Author: dim Date: Sat Jul 26 15:33:20 2014 New Revision: 269125 URL: http://svnweb.freebsd.org/changeset/base/269125 Log: In r232153, libarchive 3.0.3 was imported, replacing the archive_hash.h header with archive_crypto_private.h, and its ARCHIVE_HASH_xxx macros were renamed to ARCHIVE_CRYPTO_xxx. Rename these macros in lib/libarchive/config_freebsd.h, to re-enable the hashes for libarchive again. This affects the mtree format writer, and the xar format reader and writer modules. This also requires changes in the library order for statically linking rescue, otherwise ld would complain about redefined symbols. Thanks to jkim for pointing out the solution. Reviewed by: kientzle MFC after: 1 week Modified: head/lib/libarchive/config_freebsd.h head/rescue/rescue/Makefile Modified: head/lib/libarchive/config_freebsd.h ============================================================================== --- head/lib/libarchive/config_freebsd.h Sat Jul 26 14:24:13 2014 (r269124) +++ head/lib/libarchive/config_freebsd.h Sat Jul 26 15:33:20 2014 (r269125) @@ -228,15 +228,15 @@ /* FreeBSD defines for archive_hash.h */ #ifdef WITH_OPENSSL -#define ARCHIVE_HASH_MD5_OPENSSL 1 -#define ARCHIVE_HASH_RMD160_OPENSSL 1 -#define ARCHIVE_HASH_SHA1_OPENSSL -#define ARCHIVE_HASH_SHA256_OPENSSL 1 -#define ARCHIVE_HASH_SHA384_OPENSSL 1 -#define ARCHIVE_HASH_SHA512_OPENSSL 1 +#define ARCHIVE_CRYPTO_MD5_OPENSSL 1 +#define ARCHIVE_CRYPTO_RMD160_OPENSSL 1 +#define ARCHIVE_CRYPTO_SHA1_OPENSSL +#define ARCHIVE_CRYPTO_SHA256_OPENSSL 1 +#define ARCHIVE_CRYPTO_SHA384_OPENSSL 1 +#define ARCHIVE_CRYPTO_SHA512_OPENSSL 1 #else -#define ARCHIVE_HASH_MD5_LIBMD 1 -#define ARCHIVE_HASH_SHA1_LIBMD 1 -#define ARCHIVE_HASH_SHA256_LIBMD 1 -#define ARCHIVE_HASH_SHA512_LIBMD 1 +#define ARCHIVE_CRYPTO_MD5_LIBMD 1 +#define ARCHIVE_CRYPTO_SHA1_LIBMD 1 +#define ARCHIVE_CRYPTO_SHA256_LIBMD 1 +#define ARCHIVE_CRYPTO_SHA512_LIBMD 1 #endif Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Sat Jul 26 14:24:13 2014 (r269124) +++ head/rescue/rescue/Makefile Sat Jul 26 15:33:20 2014 (r269125) @@ -122,7 +122,11 @@ CRUNCH_LIBS+= -lalias -lcam -lncursesw - .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem .endif -CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz +CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv +.if ${MK_OPENSSL} == "no" +CRUNCH_LIBS+= -lmd +.endif +CRUNCH_LIBS+= -lsbuf -lufs -lz .if ${MACHINE_CPUARCH} == "i386" CRUNCH_PROGS_sbin+= bsdlabel sconfig fdisk @@ -187,10 +191,11 @@ CRUNCH_ALIAS_xz= unxz lzma unlzma xzcat CRUNCH_LIBS+= -llzma CRUNCH_PROGS_usr.bin+= tar -CRUNCH_LIBS+= -larchive -lmd +CRUNCH_LIBS+= -larchive .if ${MK_OPENSSL} != "no" CRUNCH_LIBS+= -lcrypto .endif +CRUNCH_LIBS+= -lmd CRUNCH_PROGS_usr.bin+= vi CRUNCH_ALIAS_vi= ex From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 15:46:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13D06FFF; Sat, 26 Jul 2014 15:46:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0114B2682; Sat, 26 Jul 2014 15:46:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QFkfl4083749; Sat, 26 Jul 2014 15:46:41 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QFkfaw083748; Sat, 26 Jul 2014 15:46:41 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261546.s6QFkfaw083748@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 15:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269126 - 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.18 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, 26 Jul 2014 15:46:42 -0000 Author: marcel Date: Sat Jul 26 15:46:41 2014 New Revision: 269126 URL: http://svnweb.freebsd.org/changeset/base/269126 Log: Don't return ERESTART when the device is gone. In ttydev_leave() ERESTART is the indication that draining got interrupted due to a revoke(2) and that tty_drain() is to be called again for draining to complete. If the device is flagged as gone, then waiting/draining is not possible. Only return ERESTART when waiting is still possible. Obtained from: Juniper Networks, Inc. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Jul 26 15:33:20 2014 (r269125) +++ head/sys/kern/tty.c Sat Jul 26 15:46:41 2014 (r269126) @@ -1370,14 +1370,14 @@ tty_wait(struct tty *tp, struct cv *cv) error = cv_wait_sig(cv, tp->t_mtx); - /* Restart the system call when we may have been revoked. */ - if (tp->t_revokecnt != revokecnt) - return (ERESTART); - /* Bail out when the device slipped away. */ if (tty_gone(tp)) return (ENXIO); + /* Restart the system call when we may have been revoked. */ + if (tp->t_revokecnt != revokecnt) + return (ERESTART); + return (error); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 16:06:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D54651C; Sat, 26 Jul 2014 16:06:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40ABC2862; Sat, 26 Jul 2014 16:06:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QG62MN092903; Sat, 26 Jul 2014 16:06:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QG61le092895; Sat, 26 Jul 2014 16:06:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407261606.s6QG61le092895@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 26 Jul 2014 16:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269127 - head/sys/dev/usb/wlan 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.18 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, 26 Jul 2014 16:06:02 -0000 Author: hselasky Date: Sat Jul 26 16:06:01 2014 New Revision: 269127 URL: http://svnweb.freebsd.org/changeset/base/269127 Log: Fix for division by zero. MFC after: 3 days Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_zyd.c head/sys/dev/usb/wlan/if_zydreg.h Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sat Jul 26 15:46:41 2014 (r269126) +++ head/sys/dev/usb/wlan/if_rum.c Sat Jul 26 16:06:01 2014 (r269127) @@ -1035,6 +1035,8 @@ rum_setup_tx_desc(struct rum_softc *sc, desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { + if (rate == 0) + rate = 2; /* avoid division by zero */ plcp_length = (16 * len + rate - 1) / rate; if (rate == 22) { remainder = (16 * len) % 22; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 15:46:41 2014 (r269126) +++ head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 16:06:01 2014 (r269127) @@ -1038,6 +1038,8 @@ ural_setup_tx_desc(struct ural_softc *sc desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { + if (rate == 0) + rate = 2; /* avoid division by zero */ plcp_length = (16 * len + rate - 1) / rate; if (rate == 22) { remainder = (16 * len) % 22; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sat Jul 26 15:46:41 2014 (r269126) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jul 26 16:06:01 2014 (r269127) @@ -2480,7 +2480,7 @@ zyd_tx_start(struct zyd_softc *sc, struc const struct ieee80211_txparam *tp; struct ieee80211_key *k; int rate, totlen; - static uint8_t ratediv[] = ZYD_TX_RATEDIV; + static const uint8_t ratediv[] = ZYD_TX_RATEDIV; uint8_t phy; uint16_t pktlen; uint32_t bits; Modified: head/sys/dev/usb/wlan/if_zydreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_zydreg.h Sat Jul 26 15:46:41 2014 (r269126) +++ head/sys/dev/usb/wlan/if_zydreg.h Sat Jul 26 16:06:01 2014 (r269127) @@ -970,7 +970,7 @@ #define ZYD_TX_RATEDIV \ { \ - 0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6, \ + 0x1, 0x2, 0xb, 0xb, 0x1, 0x1, 0x1, 0x1, 0x30, 0x18, 0xc, 0x6, \ 0x36, 0x24, 0x12, 0x9 \ } From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 16:45:12 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 37B2B961; Sat, 26 Jul 2014 16:45:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 246552B2F; Sat, 26 Jul 2014 16:45:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QGjBuj010988; Sat, 26 Jul 2014 16:45:11 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QGjBNR010985; Sat, 26 Jul 2014 16:45:11 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261645.s6QGjBNR010985@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 16:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269128 - head/usr.bin/gcore 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.18 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, 26 Jul 2014 16:45:12 -0000 Author: marcel Date: Sat Jul 26 16:45:11 2014 New Revision: 269128 URL: http://svnweb.freebsd.org/changeset/base/269128 Log: Create 32-bit core files for 32-bit processes on 64-bit machines. The 64-bit machine supported right now is amd64, but it's not too hard to add powerpc64. Obtained from: Juniper Networks, Inc. Added: head/usr.bin/gcore/elf32core.c (contents, props changed) Modified: head/usr.bin/gcore/Makefile head/usr.bin/gcore/elfcore.c Modified: head/usr.bin/gcore/Makefile ============================================================================== --- head/usr.bin/gcore/Makefile Sat Jul 26 16:06:01 2014 (r269127) +++ head/usr.bin/gcore/Makefile Sat Jul 26 16:45:11 2014 (r269128) @@ -6,6 +6,10 @@ SRCS= elfcore.c gcore.c DPADD= ${LIBSBUF} ${LIBUTIL} LDADD= -lsbuf -lutil +.if ${MACHINE_ARCH} == "amd64" +SRCS+= elf32core.c +.endif + WARNS?= 1 .include Added: head/usr.bin/gcore/elf32core.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/gcore/elf32core.c Sat Jul 26 16:45:11 2014 (r269128) @@ -0,0 +1,66 @@ +/* $FreeBSD$ */ +#ifndef __LP64__ +#error "this file must be compiled for LP64." +#endif + +#define __ELF_WORD_SIZE 32 +#define _MACHINE_ELF_WANT_32BIT + +#include + +struct prpsinfo32 { + int pr_version; + u_int pr_psinfosz; + char pr_fname[PRFNAMESZ+1]; + char pr_psargs[PRARGSZ+1]; +}; + +struct prstatus32 { + int pr_version; + u_int pr_statussz; + u_int pr_gregsetsz; + u_int pr_fpregsetsz; + int pr_osreldate; + int pr_cursig; + pid_t pr_pid; + struct reg32 pr_reg; +}; + +#define ELFCORE_COMPAT_32 1 +#include "elfcore.c" + +static void +elf_convert_gregset(elfcore_gregset_t *rd, struct reg *rs) +{ +#ifdef __amd64__ + rd->r_gs = rs->r_gs; + rd->r_fs = rs->r_fs; + rd->r_es = rs->r_es; + rd->r_ds = rs->r_ds; + rd->r_edi = rs->r_rdi; + rd->r_esi = rs->r_rsi; + rd->r_ebp = rs->r_rbp; + rd->r_ebx = rs->r_rbx; + rd->r_edx = rs->r_rdx; + rd->r_ecx = rs->r_rcx; + rd->r_eax = rs->r_rax; + rd->r_eip = rs->r_rip; + rd->r_cs = rs->r_cs; + rd->r_eflags = rs->r_rflags; + rd->r_esp = rs->r_rsp; + rd->r_ss = rs->r_ss; +#else +#error Unsupported architecture +#endif +} + +static void +elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs) +{ +#ifdef __amd64__ + /* XXX this is wrong... */ + memcpy(rd, rs, sizeof(*rd)); +#else +#error Unsupported architecture +#endif +} Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Sat Jul 26 16:06:01 2014 (r269127) +++ head/usr.bin/gcore/elfcore.c Sat Jul 26 16:45:11 2014 (r269128) @@ -28,6 +28,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -73,6 +74,22 @@ struct sseg_closure { size_t size; /* Total size of all writable segments. */ }; +#ifdef ELFCORE_COMPAT_32 +typedef struct fpreg32 elfcore_fpregset_t; +typedef struct reg32 elfcore_gregset_t; +typedef struct prpsinfo32 elfcore_prpsinfo_t; +typedef struct prstatus32 elfcore_prstatus_t; +static void elf_convert_gregset(elfcore_gregset_t *rd, struct reg *rs); +static void elf_convert_fpregset(elfcore_fpregset_t *rd, struct fpreg *rs); +#else +typedef fpregset_t elfcore_fpregset_t; +typedef gregset_t elfcore_gregset_t; +typedef prpsinfo_t elfcore_prpsinfo_t; +typedef prstatus_t elfcore_prstatus_t; +#define elf_convert_gregset(d,s) *d = *s +#define elf_convert_fpregset(d,s) *d = *s +#endif + typedef void* (*notefunc_t)(void *, size_t *); static void cb_put_phdr(vm_map_entry_t, void *); @@ -108,13 +125,28 @@ elf_ident(int efd, pid_t pid __unused, c { Elf_Ehdr hdr; int cnt; + uint16_t machine; cnt = read(efd, &hdr, sizeof(hdr)); if (cnt != sizeof(hdr)) return (0); - if (IS_ELF(hdr)) - return (1); - return (0); + if (!IS_ELF(hdr)) + return (0); + switch (hdr.e_ident[EI_DATA]) { + case ELFDATA2LSB: + machine = le16toh(hdr.e_machine); + break; + case ELFDATA2MSB: + machine = be16toh(hdr.e_machine); + break; + default: + return (0); + } + if (!ELF_MACHINE_OK(machine)) + return (0); + + /* Looks good. */ + return (1); } static void @@ -194,7 +226,7 @@ elf_coredump(int efd __unused, int fd, p uintmax_t nleft = php->p_filesz; iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (caddr_t)php->p_vaddr; + iorequest.piod_offs = (caddr_t)(uintptr_t)php->p_vaddr; while (nleft > 0) { char buf[8*1024]; size_t nwant; @@ -311,6 +343,7 @@ elf_putnotes(pid_t pid, struct sbuf *sb, elf_putnote(NT_THRMISC, elf_note_thrmisc, tids + i, sb); } +#ifndef ELFCORE_COMPAT_32 elf_putnote(NT_PROCSTAT_PROC, elf_note_procstat_proc, &pid, sb); elf_putnote(NT_PROCSTAT_FILES, elf_note_procstat_files, &pid, sb); elf_putnote(NT_PROCSTAT_VMMAP, elf_note_procstat_vmmap, &pid, sb); @@ -321,6 +354,7 @@ elf_putnotes(pid_t pid, struct sbuf *sb, elf_putnote(NT_PROCSTAT_PSSTRINGS, elf_note_procstat_psstrings, &pid, sb); elf_putnote(NT_PROCSTAT_AUXV, elf_note_procstat_auxv, &pid, sb); +#endif size = sbuf_end_section(sb, old_len, 1, 0); if (size == -1) @@ -491,7 +525,7 @@ static void * elf_note_prpsinfo(void *arg, size_t *sizep) { pid_t pid; - prpsinfo_t *psinfo; + elfcore_prpsinfo_t *psinfo; struct kinfo_proc kip; size_t len; int name[4]; @@ -501,7 +535,7 @@ elf_note_prpsinfo(void *arg, size_t *siz if (psinfo == NULL) errx(1, "out of memory"); psinfo->pr_version = PRPSINFO_VERSION; - psinfo->pr_psinfosz = sizeof(prpsinfo_t); + psinfo->pr_psinfosz = sizeof(*psinfo); name[0] = CTL_KERN; name[1] = KERN_PROC; @@ -523,19 +557,21 @@ static void * elf_note_prstatus(void *arg, size_t *sizep) { lwpid_t tid; - prstatus_t *status; + elfcore_prstatus_t *status; + struct reg greg; tid = *(lwpid_t *)arg; status = calloc(1, sizeof(*status)); if (status == NULL) errx(1, "out of memory"); status->pr_version = PRSTATUS_VERSION; - status->pr_statussz = sizeof(prstatus_t); - status->pr_gregsetsz = sizeof(gregset_t); - status->pr_fpregsetsz = sizeof(fpregset_t); + status->pr_statussz = sizeof(*status); + status->pr_gregsetsz = sizeof(elfcore_gregset_t); + status->pr_fpregsetsz = sizeof(elfcore_fpregset_t); status->pr_osreldate = __FreeBSD_version; status->pr_pid = tid; - ptrace(PT_GETREGS, tid, (void *)&status->pr_reg, 0); + ptrace(PT_GETREGS, tid, (void *)&greg, 0); + elf_convert_gregset(&status->pr_reg, &greg); *sizep = sizeof(*status); return (status); @@ -545,13 +581,15 @@ static void * elf_note_fpregset(void *arg, size_t *sizep) { lwpid_t tid; - prfpregset_t *fpregset; + elfcore_fpregset_t *fpregset; + fpregset_t fpreg; tid = *(lwpid_t *)arg; fpregset = calloc(1, sizeof(*fpregset)); if (fpregset == NULL) errx(1, "out of memory"); - ptrace(PT_GETFPREGS, tid, (void *)fpregset, 0); + ptrace(PT_GETFPREGS, tid, (void *)&fpreg, 0); + elf_convert_fpregset(fpregset, &fpreg); *sizep = sizeof(*fpregset); return (fpregset); @@ -700,5 +738,5 @@ elf_note_procstat_rlimit(void *arg, size return (buf); } -struct dumpers elfdump = { elf_ident, elf_coredump }; -TEXT_SET(dumpset, elfdump); +struct dumpers __elfN(dump) = { elf_ident, elf_coredump }; +TEXT_SET(dumpset, __elfN(dump)); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 17:07:32 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4201D0D; Sat, 26 Jul 2014 17:07:32 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0DC72C9F; Sat, 26 Jul 2014 17:07:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QH7W69020574; Sat, 26 Jul 2014 17:07:32 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QH7WtY020573; Sat, 26 Jul 2014 17:07:32 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261707.s6QH7WtY020573@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 17:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269129 - head/sys/powerpc/powerpc 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.18 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, 26 Jul 2014 17:07:32 -0000 Author: marcel Date: Sat Jul 26 17:07:32 2014 New Revision: 269129 URL: http://svnweb.freebsd.org/changeset/base/269129 Log: Fix relocations related to dpcpu and vnet sets. The address is rebased to point to the allocated memory, but for architectures that have non-zero relocation addends, the address comparison happens on the "unfinalized" address. After the addend is taken into account, call elf_relocaddr() to make sure we rebase properly. Modified: head/sys/powerpc/powerpc/elf32_machdep.c Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Sat Jul 26 16:45:11 2014 (r269128) +++ head/sys/powerpc/powerpc/elf32_machdep.c Sat Jul 26 17:07:32 2014 (r269129) @@ -190,8 +190,7 @@ elf_reloc_internal(linker_file_t lf, Elf addr = lookup(lf, symidx, 1); if (addr == 0) return -1; - addr += addend; - *where = addr; + *where = elf_relocaddr(lf, addr + addend); break; case R_PPC_ADDR16_LO: /* #lo(S) */ @@ -204,9 +203,8 @@ elf_reloc_internal(linker_file_t lf, Elf * are relative to relocbase. Detect this condition. */ if (addr > relocbase && addr <= (relocbase + addend)) - addr = relocbase + addend; - else - addr += addend; + addr = relocbase; + addr = elf_relocaddr(lf, addr + addend); *hwhere = addr & 0xffff; break; @@ -220,9 +218,8 @@ elf_reloc_internal(linker_file_t lf, Elf * are relative to relocbase. Detect this condition. */ if (addr > relocbase && addr <= (relocbase + addend)) - addr = relocbase + addend; - else - addr += addend; + addr = relocbase; + addr = elf_relocaddr(lf, addr + addend); *hwhere = ((addr >> 16) + ((addr & 0x8000) ? 1 : 0)) & 0xffff; break; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 17:24:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6459F9D; Sat, 26 Jul 2014 17:24:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50EEC2DFC; Sat, 26 Jul 2014 17:24:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QHOxQv029277; Sat, 26 Jul 2014 17:24:59 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QHOwbP029273; Sat, 26 Jul 2014 17:24:58 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261724.s6QHOwbP029273@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 17:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269130 - in head/sys/modules: bxe dtrace/fasttrap 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.18 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, 26 Jul 2014 17:24:59 -0000 Author: marcel Date: Sat Jul 26 17:24:58 2014 New Revision: 269130 URL: http://svnweb.freebsd.org/changeset/base/269130 Log: Avoid using ${.CURDIR} so that the module can be built from multiple directories. Obtained from: Juniper Networks, Inc. Modified: head/sys/modules/bxe/Makefile head/sys/modules/dtrace/fasttrap/Makefile head/sys/modules/zfs/Makefile Modified: head/sys/modules/bxe/Makefile ============================================================================== --- head/sys/modules/bxe/Makefile Sat Jul 26 17:07:32 2014 (r269129) +++ head/sys/modules/bxe/Makefile Sat Jul 26 17:24:58 2014 (r269130) @@ -1,5 +1,8 @@ # $FreeBSD$ -BXE = ${.CURDIR}/../../dev/bxe + +SYSDIR ?= ${.CURDIR}/../.. + +BXE = ${SYSDIR}/dev/bxe .PATH: ${BXE} KMOD = if_bxe Modified: head/sys/modules/dtrace/fasttrap/Makefile ============================================================================== --- head/sys/modules/dtrace/fasttrap/Makefile Sat Jul 26 17:07:32 2014 (r269129) +++ head/sys/modules/dtrace/fasttrap/Makefile Sat Jul 26 17:24:58 2014 (r269130) @@ -20,7 +20,7 @@ CFLAGS+= -I${SYSDIR}/cddl/contrib/openso .PATH: ${SYSDIR}/cddl/contrib/opensolaris/uts/powerpc/dtrace .endif -.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/common/unicode +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode SRCS+= u8_textprep.c CFLAGS+= -DSMP Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Sat Jul 26 17:07:32 2014 (r269129) +++ head/sys/modules/zfs/Makefile Sat Jul 26 17:24:58 2014 (r269130) @@ -1,10 +1,12 @@ # $FreeBSD$ +SYSDIR?=${.CURDIR}/../.. + KMOD= zfs SRCS= bus_if.h device_if.h vnode_if.h -SUNW= ${.CURDIR}/../../cddl/contrib/opensolaris +SUNW= ${SYSDIR}/cddl/contrib/opensolaris .PATH: ${SUNW}/common/acl SRCS+= acl_common.c @@ -14,10 +16,10 @@ SRCS+= avl.c SRCS+= nvpair.c SRCS+= nvpair_alloc_fixed.c SRCS+= fnvpair.c -.PATH: ${.CURDIR}/../../cddl/contrib/opensolaris/common/unicode +.PATH: ${SYSDIR}/cddl/contrib/opensolaris/common/unicode SRCS+= u8_textprep.c -.PATH: ${.CURDIR}/../../cddl/compat/opensolaris/kern +.PATH: ${SYSDIR}/cddl/compat/opensolaris/kern SRCS+= opensolaris_acl.c SRCS+= opensolaris_kobj.c SRCS+= opensolaris_kstat.c @@ -31,7 +33,7 @@ SRCS+= opensolaris_vfs.c SRCS+= opensolaris_vm.c SRCS+= opensolaris_zone.c -_A=${.CURDIR}/../../cddl/contrib/opensolaris/common/atomic +_A=${SYSDIR}/cddl/contrib/opensolaris/common/atomic .if exists(${_A}/${MACHINE_CPUARCH}/opensolaris_atomic.S) .PATH: ${_A}/${MACHINE_CPUARCH} SRCS+= opensolaris_atomic.S @@ -64,7 +66,7 @@ SRCS+= zmod.c SRCS+= zmod_subr.c SRCS+= zutil.c -.PATH: ${.CURDIR}/../../crypto/sha2 +.PATH: ${SYSDIR}/crypto/sha2 SRCS+= sha2.c sha256c.c .PATH: ${SUNW}/common/zfs @@ -78,11 +80,11 @@ SRCS+= trim_map.c # Use FreeBSD's namecache. CFLAGS+=-DFREEBSD_NAMECACHE -CFLAGS+=-I${.CURDIR}/../../cddl/compat/opensolaris +CFLAGS+=-I${SYSDIR}/cddl/compat/opensolaris CFLAGS+=-I${SUNW}/uts/common/fs/zfs CFLAGS+=-I${SUNW}/uts/common/zmod CFLAGS+=-I${SUNW}/uts/common -CFLAGS+=-I${.CURDIR}/../.. +CFLAGS+=-I${SYSDIR} CFLAGS+=-I${SUNW}/common/zfs CFLAGS+=-I${SUNW}/common CFLAGS+=-DBUILDING_ZFS @@ -96,7 +98,7 @@ CFLAGS+=-mminimal-toc .include -CFLAGS+= -include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h CWARNFLAGS+=-Wno-unknown-pragmas CWARNFLAGS+=-Wno-missing-prototypes From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 17:49:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A84B1999; Sat, 26 Jul 2014 17:49:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94F0420A2; Sat, 26 Jul 2014 17:49:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QHneoZ038914; Sat, 26 Jul 2014 17:49:40 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QHnene038913; Sat, 26 Jul 2014 17:49:40 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261749.s6QHnene038913@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 17:49:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269131 - head/sys/dev/uart 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.18 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, 26 Jul 2014 17:49:40 -0000 Author: marcel Date: Sat Jul 26 17:49:40 2014 New Revision: 269131 URL: http://svnweb.freebsd.org/changeset/base/269131 Log: Do not fail the low-level device probe simply because the kernel doesn't have support for the Z8530. Embedded PowerPC platforms typically don't. Fail when the device class we actually need is not present. Obtained from: Juniper Networks, Inc. Modified: head/sys/dev/uart/uart_cpu_powerpc.c Modified: head/sys/dev/uart/uart_cpu_powerpc.c ============================================================================== --- head/sys/dev/uart/uart_cpu_powerpc.c Sat Jul 26 17:24:58 2014 (r269130) +++ head/sys/dev/uart/uart_cpu_powerpc.c Sat Jul 26 17:49:40 2014 (r269131) @@ -113,10 +113,6 @@ uart_cpu_getdev(int devtype, struct uart phandle_t input, opts, chosen; int error; - class = &uart_z8530_class; - if (class == NULL) - return (ENXIO); - opts = OF_finddevice("/options"); chosen = OF_finddevice("/chosen"); switch (devtype) { @@ -181,6 +177,9 @@ uart_cpu_getdev(int devtype, struct uart } else return (ENXIO); + if (class == NULL) + return (ENXIO); + error = OF_decode_addr(input, 0, &di->bas.bst, &di->bas.bsh); if (error) return (error); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 17:57:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 31D64B5C; Sat, 26 Jul 2014 17:57:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB98215C; Sat, 26 Jul 2014 17:57:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QHvD5C043026; Sat, 26 Jul 2014 17:57:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QHvDXU043025; Sat, 26 Jul 2014 17:57:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261757.s6QHvDXU043025@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 17:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269132 - head/sys/dev/tsec 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.18 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, 26 Jul 2014 17:57:14 -0000 Author: marcel Date: Sat Jul 26 17:57:13 2014 New Revision: 269132 URL: http://svnweb.freebsd.org/changeset/base/269132 Log: Remove bogus module dependencies. Modified: head/sys/dev/tsec/if_tsec_fdt.c Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Sat Jul 26 17:49:40 2014 (r269131) +++ head/sys/dev/tsec/if_tsec_fdt.c Sat Jul 26 17:57:13 2014 (r269132) @@ -101,8 +101,6 @@ static driver_t tsec_fdt_driver = { }; DRIVER_MODULE(tsec, simplebus, tsec_fdt_driver, tsec_devclass, 0, 0); -MODULE_DEPEND(tsec, simplebus, 1, 1, 1); -MODULE_DEPEND(tsec, ether, 1, 1, 1); static int tsec_fdt_probe(device_t dev) From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 17:59:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4952CB5; Sat, 26 Jul 2014 17:59:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A13A9216F; Sat, 26 Jul 2014 17:59:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QHxPAx043341; Sat, 26 Jul 2014 17:59:25 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QHxP5L043340; Sat, 26 Jul 2014 17:59:25 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261759.s6QHxP5L043340@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 17:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269133 - head/sys/modules/tsec 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.18 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, 26 Jul 2014 17:59:25 -0000 Author: marcel Date: Sat Jul 26 17:59:25 2014 New Revision: 269133 URL: http://svnweb.freebsd.org/changeset/base/269133 Log: Build tsec(4) as a module. Obtained from: Juniper Networks, Inc. Added: head/sys/modules/tsec/ head/sys/modules/tsec/Makefile (contents, props changed) Added: head/sys/modules/tsec/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/tsec/Makefile Sat Jul 26 17:59:25 2014 (r269133) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +SYSDIR?=${.CURDIR}/../.. + +.PATH: ${SYSDIR}/dev/tsec + +KMOD= if_tsec +SRCS= if_tsec.c if_tsec_fdt.c +SRCS+= bus_if.h device_if.h miibus_if.h miidevs.h ofw_bus_if.h + +.include From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:10:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B58E1F26; Sat, 26 Jul 2014 18:10:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95C30228F; Sat, 26 Jul 2014 18:10:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QIAJVF049447; Sat, 26 Jul 2014 18:10:19 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QIAIIj049439; Sat, 26 Jul 2014 18:10:18 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201407261810.s6QIAIIj049439@svn.freebsd.org> From: Alan Cox Date: Sat, 26 Jul 2014 18:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269134 - head/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.18 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, 26 Jul 2014 18:10:19 -0000 Author: alc Date: Sat Jul 26 18:10:18 2014 New Revision: 269134 URL: http://svnweb.freebsd.org/changeset/base/269134 Log: When unwiring a region of an address space, do not assume that the underlying physical pages are mapped by the pmap. If, for example, the application has performed an mprotect(..., PROT_NONE) on any part of the wired region, then those pages will no longer be mapped by the pmap. So, using the pmap to lookup the wired pages in order to unwire them doesn't always work, and when it doesn't work wired pages are leaked. To avoid the leak, introduce and use a new function vm_object_unwire() that locates the wired pages by traversing the object and its backing objects. At the same time, switch from using pmap_change_wiring() to the recently introduced function pmap_unwire() for unwiring the region's mappings. pmap_unwire() is faster, because it operates a range of virtual addresses rather than a single virtual page at a time. Moreover, by operating on a range, it is superpage friendly. It doesn't waste time performing unnecessary demotions. Reported by: markj Reviewed by: kib Tested by: pho, jmg (arm) Sponsored by: EMC / Isilon Storage Division Modified: head/sys/vm/vm_extern.h head/sys/vm/vm_fault.c head/sys/vm/vm_map.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Sat Jul 26 17:59:25 2014 (r269133) +++ head/sys/vm/vm_extern.h Sat Jul 26 18:10:18 2014 (r269134) @@ -81,7 +81,6 @@ int vm_fault_hold(vm_map_t map, vm_offse int fault_flags, vm_page_t *m_hold); int vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len, vm_prot_t prot, vm_page_t *ma, int max_count); -void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); int vm_fault_wire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); int vm_forkproc(struct thread *, struct proc *, struct thread *, struct vmspace *, int); void vm_waitproc(struct proc *); Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sat Jul 26 17:59:25 2014 (r269133) +++ head/sys/vm/vm_fault.c Sat Jul 26 18:10:18 2014 (r269134) @@ -106,6 +106,7 @@ __FBSDID("$FreeBSD$"); #define PFFOR 4 static int vm_fault_additional_pages(vm_page_t, int, int, vm_page_t *, int *); +static void vm_fault_unwire(vm_map_t, vm_offset_t, vm_offset_t, boolean_t); #define VM_FAULT_READ_BEHIND 8 #define VM_FAULT_READ_MAX (1 + VM_FAULT_READ_AHEAD_MAX) @@ -1186,7 +1187,7 @@ vm_fault_wire(vm_map_t map, vm_offset_t * * Unwire a range of virtual addresses in a map. */ -void +static void vm_fault_unwire(vm_map_t map, vm_offset_t start, vm_offset_t end, boolean_t fictitious) { Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Jul 26 17:59:25 2014 (r269133) +++ head/sys/vm/vm_map.c Sat Jul 26 18:10:18 2014 (r269134) @@ -132,6 +132,7 @@ static void _vm_map_init(vm_map_t map, p vm_offset_t max); static void vm_map_entry_deallocate(vm_map_entry_t entry, boolean_t system_map); static void vm_map_entry_dispose(vm_map_t map, vm_map_entry_t entry); +static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry); #ifdef INVARIANTS static void vm_map_zdtor(void *mem, int size, void *arg); static void vmspace_zdtor(void *mem, int size, void *arg); @@ -2393,16 +2394,10 @@ done: (entry->eflags & MAP_ENTRY_USER_WIRED))) { if (user_unwire) entry->eflags &= ~MAP_ENTRY_USER_WIRED; - entry->wired_count--; - if (entry->wired_count == 0) { - /* - * Retain the map lock. - */ - vm_fault_unwire(map, entry->start, entry->end, - entry->object.vm_object != NULL && - (entry->object.vm_object->flags & - OBJ_FICTITIOUS) != 0); - } + if (entry->wired_count == 1) + vm_map_entry_unwire(map, entry); + else + entry->wired_count--; } KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, ("vm_map_unwire: in-transition flag missing %p", entry)); @@ -2635,19 +2630,12 @@ done: * unnecessary. */ entry->wired_count = 0; - } else { - if (!user_wire || - (entry->eflags & MAP_ENTRY_USER_WIRED) == 0) + } else if (!user_wire || + (entry->eflags & MAP_ENTRY_USER_WIRED) == 0) { + if (entry->wired_count == 1) + vm_map_entry_unwire(map, entry); + else entry->wired_count--; - if (entry->wired_count == 0) { - /* - * Retain the map lock. - */ - vm_fault_unwire(map, entry->start, entry->end, - entry->object.vm_object != NULL && - (entry->object.vm_object->flags & - OBJ_FICTITIOUS) != 0); - } } next_entry_done: KASSERT((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0, @@ -2783,9 +2771,13 @@ vm_map_sync( static void vm_map_entry_unwire(vm_map_t map, vm_map_entry_t entry) { - vm_fault_unwire(map, entry->start, entry->end, - entry->object.vm_object != NULL && - (entry->object.vm_object->flags & OBJ_FICTITIOUS) != 0); + + VM_MAP_ASSERT_LOCKED(map); + KASSERT(entry->wired_count > 0, + ("vm_map_entry_unwire: entry %p isn't wired", entry)); + pmap_unwire(map->pmap, entry->start, entry->end); + vm_object_unwire(entry->object.vm_object, entry->offset, entry->end - + entry->start, PQ_ACTIVE); entry->wired_count = 0; } Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Sat Jul 26 17:59:25 2014 (r269133) +++ head/sys/vm/vm_object.c Sat Jul 26 18:10:18 2014 (r269134) @@ -2202,6 +2202,78 @@ vm_object_set_writeable_dirty(vm_object_ vm_object_set_flag(object, OBJ_MIGHTBEDIRTY); } +/* + * vm_object_unwire: + * + * For each page offset within the specified range of the given object, + * find the highest-level page in the shadow chain and unwire it. A page + * must exist at every page offset, and the highest-level page must be + * wired. + */ +void +vm_object_unwire(vm_object_t object, vm_ooffset_t offset, vm_size_t length, + uint8_t queue) +{ + vm_object_t tobject; + vm_page_t m, tm; + vm_pindex_t end_pindex, pindex, tpindex; + int depth, locked_depth; + + KASSERT((offset & PAGE_MASK) == 0, + ("vm_object_unwire: offset is not page aligned")); + KASSERT((length & PAGE_MASK) == 0, + ("vm_object_unwire: length is not a multiple of PAGE_SIZE")); + /* The wired count of a fictitious page never changes. */ + if ((object->flags & OBJ_FICTITIOUS) != 0) + return; + pindex = OFF_TO_IDX(offset); + end_pindex = pindex + atop(length); + locked_depth = 1; + VM_OBJECT_RLOCK(object); + m = vm_page_find_least(object, pindex); + while (pindex < end_pindex) { + if (m == NULL || pindex < m->pindex) { + /* + * The first object in the shadow chain doesn't + * contain a page at the current index. Therefore, + * the page must exist in a backing object. + */ + tobject = object; + tpindex = pindex; + depth = 0; + do { + tpindex += + OFF_TO_IDX(tobject->backing_object_offset); + tobject = tobject->backing_object; + KASSERT(tobject != NULL, + ("vm_object_unwire: missing page")); + if ((tobject->flags & OBJ_FICTITIOUS) != 0) + goto next_page; + depth++; + if (depth == locked_depth) { + locked_depth++; + VM_OBJECT_RLOCK(tobject); + } + } while ((tm = vm_page_lookup(tobject, tpindex)) == + NULL); + } else { + tm = m; + m = TAILQ_NEXT(m, listq); + } + vm_page_lock(tm); + vm_page_unwire(tm, queue); + vm_page_unlock(tm); +next_page: + pindex++; + } + /* Release the accumulated object locks. */ + for (depth = 0; depth < locked_depth; depth++) { + tobject = object->backing_object; + VM_OBJECT_RUNLOCK(object); + object = tobject; + } +} + #include "opt_ddb.h" #ifdef DDB #include Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Sat Jul 26 17:59:25 2014 (r269133) +++ head/sys/vm/vm_object.h Sat Jul 26 18:10:18 2014 (r269134) @@ -291,6 +291,8 @@ void vm_object_shadow (vm_object_t *, vm void vm_object_split(vm_map_entry_t); boolean_t vm_object_sync(vm_object_t, vm_ooffset_t, vm_size_t, boolean_t, boolean_t); +void vm_object_unwire(vm_object_t object, vm_ooffset_t offset, + vm_size_t length, uint8_t queue); #endif /* _KERNEL */ #endif /* _VM_OBJECT_ */ From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:14:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65C4C133; Sat, 26 Jul 2014 18:14:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5220A2330; Sat, 26 Jul 2014 18:14:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QIEH0F052340; Sat, 26 Jul 2014 18:14:17 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QIEHlL052339; Sat, 26 Jul 2014 18:14:17 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407261814.s6QIEHlL052339@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Jul 2014 18:14:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269135 - 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.18 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, 26 Jul 2014 18:14:17 -0000 Author: ian Date: Sat Jul 26 18:14:16 2014 New Revision: 269135 URL: http://svnweb.freebsd.org/changeset/base/269135 Log: Remove completely bogus alignment check -- it's the physical address that needs to be aligned, not the virtual, and it doesn't seem worth the cost of a vtophys() call just to see if kmem_alloc_contig() works properly. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sat Jul 26 18:10:18 2014 (r269134) +++ head/sys/arm/arm/busdma_machdep-v6.c Sat Jul 26 18:14:16 2014 (r269135) @@ -721,8 +721,6 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi free(*mapp, M_DEVBUF); *mapp = NULL; return (ENOMEM); - } else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) { - printf("bus_dmamem_alloc failed to align memory properly.\n"); } dmat->map_count++; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:19:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54A4F2F4; Sat, 26 Jul 2014 18:19:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4134E2359; Sat, 26 Jul 2014 18:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QIJihG053134; Sat, 26 Jul 2014 18:19:44 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QIJiiS053133; Sat, 26 Jul 2014 18:19:44 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407261819.s6QIJiiS053133@svn.freebsd.org> From: Ian Lepore Date: Sat, 26 Jul 2014 18:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269136 - 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.18 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, 26 Jul 2014 18:19:44 -0000 Author: ian Date: Sat Jul 26 18:19:43 2014 New Revision: 269136 URL: http://svnweb.freebsd.org/changeset/base/269136 Log: Pull in the armv4 "fast out" code for checking whether busdma can bounce due to an excluded region of physical memory. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sat Jul 26 18:14:16 2014 (r269135) +++ head/sys/arm/arm/busdma_machdep-v6.c Sat Jul 26 18:19:43 2014 (r269136) @@ -229,10 +229,26 @@ busdma_init(void *dummy) */ SYSINIT(busdma, SI_SUB_KMEM, SI_ORDER_FOURTH, busdma_init, NULL); +/* + * This routine checks the exclusion zone constraints from a tag against the + * physical RAM available on the machine. If a tag specifies an exclusion zone + * but there's no RAM in that zone, then we avoid allocating resources to bounce + * a request, and we can use any memory allocator (as opposed to needing + * kmem_alloc_contig() just because it can allocate pages in an address range). + * + * Most tags have BUS_SPACE_MAXADDR or BUS_SPACE_MAXADDR_32BIT (they are the + * same value on 32-bit architectures) as their lowaddr constraint, and we can't + * possibly have RAM at an address higher than the highest address we can + * express, so we take a fast out. + */ static __inline int _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t highaddr) { int i; + + if (lowaddr >= BUS_SPACE_MAXADDR) + return (0); + for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) || (lowaddr < phys_avail[i] && From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:26:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 974144BE; Sat, 26 Jul 2014 18:26:14 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 1F97823FB; Sat, 26 Jul 2014 18:26:13 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s6QIQ8tb021594 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 26 Jul 2014 21:26:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s6QIQ8tb021594 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s6QIQ8on021593; Sat, 26 Jul 2014 21:26:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 26 Jul 2014 21:26:07 +0300 From: Konstantin Belousov To: Navdeep Parhar Subject: Re: svn commit: r269106 - head/tools/tools/cxgbetool Message-ID: <20140726182607.GG93733@kib.kiev.ua> References: <201407260051.s6Q0pjNO077573@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X7Zep0NQCNWF69sf" Content-Disposition: inline In-Reply-To: <201407260051.s6Q0pjNO077573@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 18:26:14 -0000 --X7Zep0NQCNWF69sf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 26, 2014 at 12:51:45AM +0000, Navdeep Parhar wrote: > Author: np > Date: Sat Jul 26 00:51:45 2014 > New Revision: 269106 > URL: http://svnweb.freebsd.org/changeset/base/269106 >=20 > Log: > Add a 'raw' parameter to the 'modinfo' subcommand. This is handy when > trying to figure out why a QSFP+/SFP+ connector or cable wasn't > identified correctly by cxgbe(4). Its output looks like this: > =20 > # cxgbetool t5nex0 modinfo 0 raw > 00: 03 04 21 00 00 00 00 00 ..!. .... > 08: 04 00 00 00 67 00 00 00 .... g... > 10: 00 00 05 00 41 6d 70 68 .... Amph > 18: 65 6e 6f 6c 20 20 20 20 enol > 20: 20 20 20 20 00 41 50 48 .APH > 28: 35 37 31 35 34 30 30 30 5715 4000 > 30: 33 20 20 20 20 20 20 20 3 > 38: 4b 20 20 20 01 00 00 fa K .... > 40: 00 00 00 00 41 50 46 31 .... APF1 > 48: 30 30 34 30 30 33 30 30 0040 0300 > 50: 30 33 20 20 31 30 30 31 03 1001 > 58: 33 30 20 20 00 00 00 97 30 .... > =20 > MFC after: 3 days >=20 > Modified: > head/tools/tools/cxgbetool/cxgbetool.c I do not remember if this question was already asked. Why cxgbetool lives in tools and not installed into /usr/sbin as cxgbecontrol(8) ? --X7Zep0NQCNWF69sf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT0/K/AAoJEJDCuSvBvK1BQNUP/jjrk0eILPS+OxzA2Fi4QoMu +dXFP7W7eyo5jy5X5tehN0WpWwk3lDhrFkpQKoRbtCXjMyGW8vFUUZaYBPfJG9ou IaOu60vMp44jjl64Uy/0KcfzSdWnHzptFEI9DebaQNwpR5RpO5eWqVaACxyxM1ER nvLRjpw5H8eD536cYaL78jyesdVbhvIp//7ii04NSZOZnTEu3Ucea8tiCZQfVPmY OklXKFjWWmFfCN6dSvFW0hhjPhpz2PlJgBy7NgsNR3CJMHQMQvuq/o8WL5EuuKpv r4eJgyXwzGVScZ+TeJhHUMeMMq8zMUWVEj91WPHTrFrpI+OgQE23bxVb7ojxkLc8 OQNmTJXjsQMoFENxOwUQkgsDxg8S3HMquaFSyePRgn8wWZdNpefPyFkH7EH6dSAw +kLBIi1bCLR72TwTE4VsXYCE9kM19FW6cZ7x8gu8GfGFio2p5/3vW1i5HT1oLSFv QvhshW0ueb7pIwTmTBrJ/jD4Rk3XAxDOuV8a4mzw5wSg/3z+6MuG4b3hZM6qWimu pzHGyj0xODU/y62beHvzwKQoOfwZg++iAdgSXiM3ECuhCmx6cXQlj4uklV8dZaJk +uoNsrsEemPrLwQrM8DZZoqCxNfW7fA6P9Z9HC4UnHmRKPxgaypGTvyCE5WOJudU tQkFRfPHl/eBauGHfC5x =No1o -----END PGP SIGNATURE----- --X7Zep0NQCNWF69sf-- From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:33:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17190645; Sat, 26 Jul 2014 18:33:49 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id C9DAB2496; Sat, 26 Jul 2014 18:33:48 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 7C68C783363; Sun, 27 Jul 2014 04:33:40 +1000 (EST) Date: Sun, 27 Jul 2014 04:33:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benjamin Kaduk Subject: Re: svn commit: r269112 - head/sys/boot/arm/at91/boot2 In-Reply-To: Message-ID: <20140727040529.X5986@besplex.bde.org> References: <201407260409.s6Q49i20065578@svn.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.1 cv=B4eAjodM c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Ur8WnqaOPh0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=6I5d2MoRAAAA:8 a=D2rKaxmZ94vHiccmnLcA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Ian Lepore X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 18:33:49 -0000 On Sat, 26 Jul 2014, Benjamin Kaduk wrote: > On Sat, Jul 26, 2014 at 12:09 AM, Ian Lepore wrote: > >> Author: ian >> Date: Sat Jul 26 04:09:43 2014 >> New Revision: 269112 >> URL: http://svnweb.freebsd.org/changeset/base/269112 >> >> Log: >> The 'flags' variable is conflicting with some inline code in a header >> file >> ("variable flags shadows a global..."), just rename this variable to >> wish away the problem. > > Not trying to pick on you, but we have lots of places where we get > "variable shadows a global..." -- we have a global variable 'buf' in > the kernel namespace, for one :) > Do we think it's a good use of our time to try and get this to zero > instances? Not very good, and it is negatively good to unimprove local names because of namespace pollution in global names. The shadowing for 'buf' can only be seen by C compilers that look only at source files for the file being compiled if is included, but namespace pollution makes it more visible. The pollution is relatively small. In freefall's kernel now, according to word counts of .depend, there are approx. 187338 included files only 174 of them are sys/buf.h. The number of nested includes (adjusted for kernel feature expansion) has increased by about a factor of 3 in the last 15 years since I stopped trying to police it. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:36:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1CDA794; Sat, 26 Jul 2014 18:36:39 +0000 (UTC) Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5045924AA; Sat, 26 Jul 2014 18:36:39 +0000 (UTC) Received: by mail-qg0-f53.google.com with SMTP id q107so6465148qgd.26 for ; Sat, 26 Jul 2014 11:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=bU33ZMwydXcPo0JNN5WkCZFN1zCza581hhYFrqAXcuE=; b=Q4rYdbKnTPOWsowxMfHXkvEcNm2e53dpoXBP6D4i7gw16KtuEKrUuO50Z3G0rw8VMk wVpLzO+t0tCls/twgKSmbXILtJoSi9pKZCbOHO2fwp+bEnYirATgKF7YOjM2jbnum1m7 X2ROkjnJ1VOK4iD/zJikQN6BTVrt5SFwt6aDtQdRz/vb/19jNd3XClGOxsDFxk6/zfKm y8k33LEksdFYMmfyDk0VvdQRR3U49ms+VEnAYPIzv6yDs1oTEiGC+3bTYQswYsyEgHKy nR2RkKDM4diR293SJ6ieBGxNwhQl6bcHyRaoKmJ3wVUe7N9VTjlk+Oz+nWHK+0SS/Z9K 8RjA== MIME-Version: 1.0 X-Received: by 10.140.41.133 with SMTP id z5mr40140009qgz.99.1406399797873; Sat, 26 Jul 2014 11:36:37 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sat, 26 Jul 2014 11:36:37 -0700 (PDT) In-Reply-To: <201407261606.s6QG61le092895@svn.freebsd.org> References: <201407261606.s6QG61le092895@svn.freebsd.org> Date: Sat, 26 Jul 2014 11:36:37 -0700 X-Google-Sender-Auth: BAS5PSv_0_WHSXTefd2LCR3oxxE Message-ID: Subject: Re: svn commit: r269127 - head/sys/dev/usb/wlan From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 18:36:39 -0000 Hi, We should likely review how the PLCP bits are being used and why it's getting a rate of 0 in the first place. So, why's it getting a rate of 0 passed into the transmit path? -a On 26 July 2014 09:06, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Jul 26 16:06:01 2014 > New Revision: 269127 > URL: http://svnweb.freebsd.org/changeset/base/269127 > > Log: > Fix for division by zero. > > MFC after: 3 days > > Modified: > head/sys/dev/usb/wlan/if_rum.c > head/sys/dev/usb/wlan/if_ural.c > head/sys/dev/usb/wlan/if_zyd.c > head/sys/dev/usb/wlan/if_zydreg.h > > Modified: head/sys/dev/usb/wlan/if_rum.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_rum.c Sat Jul 26 15:46:41 2014 (r269126) > +++ head/sys/dev/usb/wlan/if_rum.c Sat Jul 26 16:06:01 2014 (r269127) > @@ -1035,6 +1035,8 @@ rum_setup_tx_desc(struct rum_softc *sc, > desc->plcp_length_hi = plcp_length >> 6; > desc->plcp_length_lo = plcp_length & 0x3f; > } else { > + if (rate == 0) > + rate = 2; /* avoid division by zero */ > plcp_length = (16 * len + rate - 1) / rate; > if (rate == 22) { > remainder = (16 * len) % 22; > > Modified: head/sys/dev/usb/wlan/if_ural.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 15:46:41 2014 (r269126) > +++ head/sys/dev/usb/wlan/if_ural.c Sat Jul 26 16:06:01 2014 (r269127) > @@ -1038,6 +1038,8 @@ ural_setup_tx_desc(struct ural_softc *sc > desc->plcp_length_hi = plcp_length >> 6; > desc->plcp_length_lo = plcp_length & 0x3f; > } else { > + if (rate == 0) > + rate = 2; /* avoid division by zero */ > plcp_length = (16 * len + rate - 1) / rate; > if (rate == 22) { > remainder = (16 * len) % 22; > > Modified: head/sys/dev/usb/wlan/if_zyd.c > ============================================================================== > --- head/sys/dev/usb/wlan/if_zyd.c Sat Jul 26 15:46:41 2014 (r269126) > +++ head/sys/dev/usb/wlan/if_zyd.c Sat Jul 26 16:06:01 2014 (r269127) > @@ -2480,7 +2480,7 @@ zyd_tx_start(struct zyd_softc *sc, struc > const struct ieee80211_txparam *tp; > struct ieee80211_key *k; > int rate, totlen; > - static uint8_t ratediv[] = ZYD_TX_RATEDIV; > + static const uint8_t ratediv[] = ZYD_TX_RATEDIV; > uint8_t phy; > uint16_t pktlen; > uint32_t bits; > > Modified: head/sys/dev/usb/wlan/if_zydreg.h > ============================================================================== > --- head/sys/dev/usb/wlan/if_zydreg.h Sat Jul 26 15:46:41 2014 (r269126) > +++ head/sys/dev/usb/wlan/if_zydreg.h Sat Jul 26 16:06:01 2014 (r269127) > @@ -970,7 +970,7 @@ > > #define ZYD_TX_RATEDIV \ > { \ > - 0x1, 0x2, 0xb, 0xb, 0x0, 0x0, 0x0, 0x0, 0x30, 0x18, 0xc, 0x6, \ > + 0x1, 0x2, 0xb, 0xb, 0x1, 0x1, 0x1, 0x1, 0x30, 0x18, 0xc, 0x6, \ > 0x36, 0x24, 0x12, 0x9 \ > } > > From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 18:52:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1690F46; Sat, 26 Jul 2014 18:52:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC533263F; Sat, 26 Jul 2014 18:52:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QIqN9Q005299; Sat, 26 Jul 2014 18:52:23 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QIqN63005297; Sat, 26 Jul 2014 18:52:23 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261852.s6QIqN63005297@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 18:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269137 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 18:52:24 -0000 Author: marcel Date: Sat Jul 26 18:52:23 2014 New Revision: 269137 URL: http://svnweb.freebsd.org/changeset/base/269137 Log: Add missing definition of ELF_MACHINE_OK, now used by gcore(1). Modified: head/sys/mips/include/elf.h Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Sat Jul 26 18:19:43 2014 (r269136) +++ head/sys/mips/include/elf.h Sat Jul 26 18:52:23 2014 (r269137) @@ -77,6 +77,8 @@ #define ELF_ARCH EM_MIPS #define ELF_ARCH32 EM_MIPS +#define ELF_MACHINE_OK(x) ((x) == ELF_ARCH) + /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 #define ELF_TARG_CLASS ELFCLASS32 From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:07:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 48E5F292; Sat, 26 Jul 2014 19:07:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34D69278D; Sat, 26 Jul 2014 19:07:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QJ790m004478; Sat, 26 Jul 2014 19:07:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QJ79fN004477; Sat, 26 Jul 2014 19:07:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407261907.s6QJ79fN004477@svn.freebsd.org> From: Xin LI Date: Sat, 26 Jul 2014 19:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269138 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 19:07:09 -0000 Author: delphij Date: Sat Jul 26 19:07:08 2014 New Revision: 269138 URL: http://svnweb.freebsd.org/changeset/base/269138 Log: Add two sysctls for newly added tunables. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Jul 26 18:52:23 2014 (r269137) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Sat Jul 26 19:07:08 2014 (r269138) @@ -114,6 +114,11 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noallo * class have also crossed this threshold. */ int zfs_mg_fragmentation_threshold = 85; +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_fragmentation_threshold, CTLFLAG_RWTUN, + &zfs_mg_fragmentation_threshold, 0, + "Percentage of metaslab group size that should be considered " + "eligible for allocations unless all metaslab groups within the metaslab class " + "have also crossed this threshold"); /* * Allow metaslabs to keep their active state as long as their fragmentation @@ -122,6 +127,9 @@ int zfs_mg_fragmentation_threshold = 85; * status allowing better metaslabs to be selected. */ int zfs_metaslab_fragmentation_threshold = 70; +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, fragmentation_threshold, CTLFLAG_RWTUN, + &zfs_metaslab_fragmentation_threshold, 0, + "Maximum percentage of metaslab fragmentation level to keep their active state"); /* * When set will load all metaslabs when pool is first opened. From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:08:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 100DD4D0; Sat, 26 Jul 2014 19:08:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EFDCF279F; Sat, 26 Jul 2014 19:08:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QJ8qxo004944; Sat, 26 Jul 2014 19:08:52 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QJ8qk0004942; Sat, 26 Jul 2014 19:08:52 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407261908.s6QJ8qk0004942@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 26 Jul 2014 19:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269139 - head/sys/dev/usb/controller 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.18 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, 26 Jul 2014 19:08:53 -0000 Author: hselasky Date: Sat Jul 26 19:08:52 2014 New Revision: 269139 URL: http://svnweb.freebsd.org/changeset/base/269139 Log: Split the XHCI TRB allocations into smaller parts, so that we don't end up allocating contiguous busdma buffers above PAGE_SIZE bytes. MFC after: 1 week Tested by: Ruslan Bukin Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sat Jul 26 19:07:08 2014 (r269138) +++ head/sys/dev/usb/controller/xhci.c Sat Jul 26 19:08:52 2014 (r269139) @@ -2678,24 +2678,23 @@ xhci_alloc_device_ext(struct usb_device goto error; } - pc = &sc->sc_hw.devs[index].endpoint_pc; - pg = &sc->sc_hw.devs[index].endpoint_pg; + /* initialise all endpoint LINK TRBs */ - /* need to initialize the page cache */ - pc->tag_parent = sc->sc_bus.dma_parent_tag; + for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) { - if (usb_pc_alloc_mem(pc, pg, - sizeof(struct xhci_dev_endpoint_trbs), XHCI_PAGE_SIZE)) { - goto error; - } + pc = &sc->sc_hw.devs[index].endpoint_pc[i]; + pg = &sc->sc_hw.devs[index].endpoint_pg[i]; - /* initialise all endpoint LINK TRBs */ + /* need to initialize the page cache */ + pc->tag_parent = sc->sc_bus.dma_parent_tag; - for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) { + if (usb_pc_alloc_mem(pc, pg, + sizeof(struct xhci_dev_endpoint_trbs), XHCI_TRB_ALIGN)) { + goto error; + } /* lookup endpoint TRB ring */ - usbd_get_page(pc, (uintptr_t)& - ((struct xhci_dev_endpoint_trbs *)0)->trb[i][0], &buf_ep); + usbd_get_page(pc, 0, &buf_ep); /* get TRB pointer */ trb = buf_ep.buffer; @@ -2709,9 +2708,9 @@ xhci_alloc_device_ext(struct usb_device trb->dwTrb2 = htole32(XHCI_TRB_2_IRQ_SET(0)); trb->dwTrb3 = htole32(XHCI_TRB_3_CYCLE_BIT | XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_LINK)); - } - usb_pc_cpu_flush(pc); + usb_pc_cpu_flush(pc); + } xhci_set_slot_pointer(sc, index, buf_dev.physaddr); @@ -2728,13 +2727,15 @@ xhci_free_device_ext(struct usb_device * { struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); uint8_t index; + uint8_t i; index = udev->controller_slot_id; xhci_set_slot_pointer(sc, index, 0); usb_pc_free_mem(&sc->sc_hw.devs[index].device_pc); usb_pc_free_mem(&sc->sc_hw.devs[index].input_pc); - usb_pc_free_mem(&sc->sc_hw.devs[index].endpoint_pc); + for (i = 0; i != XHCI_MAX_ENDPOINTS; i++) + usb_pc_free_mem(&sc->sc_hw.devs[index].endpoint_pc[i]); } static struct xhci_endpoint_ext * @@ -2755,10 +2756,9 @@ xhci_get_endpoint_ext(struct usb_device index = udev->controller_slot_id; - pc = &sc->sc_hw.devs[index].endpoint_pc; + pc = &sc->sc_hw.devs[index].endpoint_pc[epno]; - usbd_get_page(pc, (uintptr_t)&((struct xhci_dev_endpoint_trbs *)0)-> - trb[epno][0], &buf_ep); + usbd_get_page(pc, 0, &buf_ep); pepext = &sc->sc_hw.devs[index].endp[epno]; pepext->page_cache = pc; Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Sat Jul 26 19:07:08 2014 (r269138) +++ head/sys/dev/usb/controller/xhci.h Sat Jul 26 19:08:52 2014 (r269139) @@ -316,8 +316,8 @@ struct xhci_trb { } __aligned(4); struct xhci_dev_endpoint_trbs { - struct xhci_trb trb[XHCI_MAX_ENDPOINTS] - [(XHCI_MAX_STREAMS * XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS]; + struct xhci_trb trb[(XHCI_MAX_STREAMS * + XHCI_MAX_TRANSFERS) + XHCI_MAX_STREAMS]; }; #define XHCI_TD_PAGE_NBUF 17 /* units, room enough for 64Kbytes */ @@ -385,11 +385,11 @@ enum { struct xhci_hw_dev { struct usb_page_cache device_pc; struct usb_page_cache input_pc; - struct usb_page_cache endpoint_pc; + struct usb_page_cache endpoint_pc[XHCI_MAX_ENDPOINTS]; struct usb_page device_pg; struct usb_page input_pg; - struct usb_page endpoint_pg; + struct usb_page endpoint_pg[XHCI_MAX_ENDPOINTS]; struct xhci_endpoint_ext endp[XHCI_MAX_ENDPOINTS]; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:13:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70FA264E; Sat, 26 Jul 2014 19:13:35 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1113E2831; Sat, 26 Jul 2014 19:13:34 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 030EB1FE027; Sat, 26 Jul 2014 21:13:25 +0200 (CEST) Message-ID: <53D3FDEC.5040000@selasky.org> Date: Sat, 26 Jul 2014 21:13:48 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r269127 - head/sys/dev/usb/wlan References: <201407261606.s6QG61le092895@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 19:13:35 -0000 On 07/26/14 20:36, Adrian Chadd wrote: > Hi, > > We should likely review how the PLCP bits are being used and why it's > getting a rate of 0 in the first place. > > So, why's it getting a rate of 0 passed into the transmit path? > > Hi Adrian, Here is the backtrace of the panic: Fatal trap 18: integer divide fault while in kernel mode cpuid = 2; apic id = 02 instruction pointer = 0x20:0xffffffff807826cf stack pointer = 0x28:0xffffff8000305090 frame pointer = 0x28:0xffffff80003050a0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 15 (usbus0) trap number = 18 panic: integer divide fault cpuid = 2 KDB: stack backtrace: #0 0xffffffff809257e6 at kdb_backtrace+0x66 #1 0xffffffff808eb3ae at panic+0x1ce #2 0xffffffff80cd2c30 at trap_fatal+0x290 #3 0xffffffff80cd3480 at trap+0x250 #4 0xffffffff80cbc783 at calltrap+0x8 #5 0xffffffff80783d90 at ural_start+0x1d0 #6 0xffffffff809aa2ea at if_transmit+0xea #7 0xffffffff809ef7b2 at ieee80211_start+0x542 #8 0xffffffff809aa2ea at if_transmit+0xea #9 0xffffffff809ae8b3 at ether_output_frame+0x33 #10 0xffffffff809aee30 at ether_output+0x530 #11 0xffffffff80a186b4 at ip_output+0xd74 #12 0xffffffff80a87d2a at tcp_output+0xfea #13 0xffffffff80a82222 at tcp_do_segment+0xc02 #14 0xffffffff80a85219 at tcp_input+0xa29 #15 0xffffffff80a155fa at ip_input+0xaa #16 0xffffffff809b7808 at netisr_dispatch_src+0x218 #17 0xffffffff809ae3fd at ether_demux+0x14d #0 doadump (textdump=) at pcpu.h:235 235 pcpu.h: No such file or directory. in pcpu.h (kgdb) #0 doadump (textdump=) at pcpu.h:235 #1 0xffffffff808eae86 in kern_reboot (howto=260) at /usr/img/freebsd.9/sys/kern/kern_shutdown.c:454 #2 0xffffffff808eb387 in panic (fmt=0x1
) at /usr/img/freebsd.9/sys/kern/kern_shutdown.c:642 #3 0xffffffff80cd2c30 in trap_fatal (frame=0x12, eva=) at /usr/img/freebsd.9/sys/amd64/amd64/trap.c:878 #4 0xffffffff80cd3480 in trap (frame=0xffffff8000304fe0) at /usr/img/freebsd.9/sys/amd64/amd64/trap.c:598 #5 0xffffffff80cbc783 in calltrap () at /usr/img/freebsd.9/sys/amd64/amd64/exception.S:232 #6 0xffffffff807826cf in ural_setup_tx_desc (sc=, desc=0xfffffe0002c2a500, flags=, len=, rate=0) at /usr/img/freebsd.9/sys/dev/usb/wlan/if_ural.c:1040 #7 0xffffffff80783d90 in ural_start (ifp=0xfffffe0005a64800) at /usr/img/freebsd.9/sys/dev/usb/wlan/if_ural.c:1335 #8 0xffffffff809aa2ea in if_transmit (ifp=0xfffffe0005a64800, m=) at /usr/img/freebsd.9/sys/net/if.c:3395 #9 0xffffffff809ef7b2 in ieee80211_start (ifp=0xfffffe00054f2800) at /usr/img/freebsd.9/sys/net80211/ieee80211_output.c:365 #10 0xffffffff809aa2ea in if_transmit (ifp=0xfffffe00054f2800, m=) at /usr/img/freebsd.9/sys/net/if.c:3395 #11 0xffffffff809ae8b3 in ether_output_frame (ifp=0xfffffe00054f2800, m=0xfffffe014400a200) at /usr/img/freebsd.9/sys/net/if_ethersubr.c:447 #12 0xffffffff809aee30 in ether_output (ifp=0xfffffe00054f2800, m=0xfffffe014400a200, dst=, ro=) at /usr/img/freebsd.9/sys/net/if_ethersubr.c:418 #13 0xffffffff80a186b4 in ip_output (m=0xfffffe014400a200, opt=, ro=0xffffff8000305480, flags=, imo=0x0, inp=0xfffffe0005911498) at /usr/img/freebsd.9/sys/netinet/ip_output.c:631 #14 0xffffffff80a87d2a in tcp_output (tp=0xfffffe0005908b70) at /usr/img/freebsd.9/sys/netinet/tcp_output.c:1281 #15 0xffffffff80a82222 in tcp_do_segment (m=0xfffffe0005701700, th=0xfffffe0144913338, so=0xfffffe01449132a8, tp=0xfffffe0005908b70, drop_hdrlen=52, tlen=1424, iptos=0 '\0', ti_locked=1) at /usr/img/freebsd.9/sys/netinet/tcp_input.c:1860 #16 0xffffffff80a85219 in tcp_input (m=0xfffffe0005701700, off0=) at /usr/img/freebsd.9/sys/netinet/tcp_input.c:1410 #17 0xffffffff80a155fa in ip_input (m=0xfffffe0005701700) at /usr/img/freebsd.9/sys/netinet/ip_input.c:760 #18 0xffffffff809b7808 in netisr_dispatch_src (proto=1, source=, m=) at /usr/img/freebsd.9/sys/net/netisr.c:1013 #19 0xffffffff809ae3fd in ether_demux (ifp=0xfffffe00054f2800, m=0xfffffe0005701700) at /usr/img/freebsd.9/sys/net/if_ethersubr.c:943 #20 0xffffffff809ae6de in ether_nh_input (m=) at /usr/img/freebsd.9/sys/net/if_ethersubr.c:762 #21 0xffffffff809b7808 in netisr_dispatch_src (proto=9, source=, m=) at /usr/img/freebsd.9/sys/net/netisr.c:1013 #22 0xffffffff809fdf7d in sta_input (ni=0xffffff8001f5d000, m=0xfffffe0005701700, rssi=73, nf=-95) at /usr/img/freebsd.9/sys/net80211/ieee80211_sta.c:827 #23 0xffffffff8078582d in ural_bulk_read_callback (xfer=0xffffff8001f56a00, error=) at /usr/img/freebsd.9/sys/dev/usb/wlan/if_ural.c:968 #24 0xffffffff8075d9c4 in usbd_callback_wrapper (pq=) at /usr/img/freebsd.9/sys/dev/usb/usb_transfer.c:2270 #25 0xffffffff8075b8d6 in usb_command_wrapper (pq=0xffffff8001f56060, xfer=) at /usr/img/freebsd.9/sys/dev/usb/usb_transfer.c:2921 #26 0xffffffff8075e160 in usb_callback_proc (_pm=) at /usr/img/freebsd.9/sys/dev/usb/usb_transfer.c:2135 #27 0xffffffff80758653 in usb_process (arg=) at /usr/img/freebsd.9/sys/dev/usb/usb_process.c:169 #28 0xffffffff808b934f in fork_exit ( callout=0xffffffff80758580 , arg=0xffffff80008a91f0, frame=0xffffff8000305b00) at /usr/img/freebsd.9/sys/kern/kern_fork.c:996 #29 0xffffffff80cbccae in fork_trampoline () at /usr/img/freebsd.9/sys/amd64/amd64/exception.S:606 --HPS From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:21:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DABD2B11; Sat, 26 Jul 2014 19:21:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA7252924; Sat, 26 Jul 2014 19:21:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QJLr6Q013475; Sat, 26 Jul 2014 19:21:53 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QJLrnf013474; Sat, 26 Jul 2014 19:21:53 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201407261921.s6QJLrnf013474@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sat, 26 Jul 2014 19:21:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269140 - head/cddl/contrib/dtracetoolkit 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.18 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, 26 Jul 2014 19:21:53 -0000 Author: gnn Date: Sat Jul 26 19:21:53 2014 New Revision: 269140 URL: http://svnweb.freebsd.org/changeset/base/269140 Log: Port the rwsnoop DTrace Toolkit script to FreeBSD. Remove dependency on the Korn Shell. Remove Zones in favor of Jails. Remove support (for now) for filename printing. Modified: head/cddl/contrib/dtracetoolkit/rwsnoop Modified: head/cddl/contrib/dtracetoolkit/rwsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:08:52 2014 (r269139) +++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:21:53 2014 (r269140) @@ -1,10 +1,10 @@ -#!/usr/bin/ksh +#!/bin/sh # # rwsnoop - snoop read/write events. -# Written using DTrace (Solaris 10 3/05). +# Originally written using DTrace (Solaris 10 3/05). # # This is measuring reads and writes at the application level. This matches -# the syscalls read, write, pread and pwrite. +# the syscalls read, and write. # # $Id: rwsnoop 3 2007-08-01 10:50:08Z brendan $ # @@ -12,15 +12,14 @@ # # rwsnoop # default output # -# -j # print project ID # -P # print parent process ID # -t # print timestamp, us # -v # print time, string -# -Z # print zone ID +# -J # print jail ID # -n name # this process name only # -p PID # this PID only # eg, -# rwsnoop -Z # print zone ID +# rwsnoop -J # print jail ID # rwsnoop -n bash # monitor processes named "bash" # rwsnoop > out.txt # recommended # @@ -32,8 +31,7 @@ # FIELDS: # TIME Timestamp, us # TIMESTR Time, string -# ZONE Zone ID -# PROJ Project ID +# JAIL JAIL ID # UID User ID # PID Process ID # PPID Parent Process ID @@ -71,6 +69,7 @@ # 24-Jul-2005 Brendan Gregg Created this. # 17-Sep-2005 " " Increased switchrate. # 17-Sep-2005 " " Last update. +# 26-Jul-2014 George Neville-Neil Port to FreeBSD # @@ -78,9 +77,11 @@ # --- Process Arguments --- # +set -x +set -v ### default variables -opt_name=0; opt_pid=0; opt_proj=0; opt_zone=0; opt_time=0; opt_timestr=0 -opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0 +opt_name=0; opt_pid=0; opt_jailid=0; opt_time=0; opt_timestr=0 +opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0; ### process options while getopts n:Pp:jtvZ name @@ -89,23 +90,21 @@ do n) opt_name=1; pname=$OPTARG ;; p) opt_pid=1; pid=$OPTARG ;; P) opt_ppid=1 ;; - j) opt_proj=1 ;; t) opt_time=1 ;; v) opt_timestr=1 ;; - Z) opt_zone=1 ;; + J) opt_jailid=1 ;; h|?) cat <<-END >&2 USAGE: rwsnoop [-jPtvZ] [-n name] [-p pid] - -j # print project ID -P # print parent process ID -t # print timestamp, us -v # print time, string - -Z # print zone ID + -J # print jail ID -n name # this process name only -p PID # this PID only eg, rwsnoop # default output - rwsnoop -Z # print zone ID + rwsnoop -J # print jail ID rwsnoop -n bash # monitor processes named "bash" END exit 1 @@ -115,11 +114,13 @@ done shift $(( $OPTIND - 1 )) ### option logic -if (( opt_name || opt_pid )); then +if [ $opt_name -ne 0 ]; then filter=1 fi - +if [ $opt_pid -ne 0 ]; then + filter=1 +fi ################################# # --- Main Program, DTrace --- @@ -128,8 +129,7 @@ fi /* * Command line arguments */ - inline int OPT_proj = '$opt_proj'; - inline int OPT_zone = '$opt_zone'; + inline int OPT_jailid = '$opt_jailid'; inline int OPT_bytes = '$opt_bytes'; inline int OPT_name = '$opt_name'; inline int OPT_ppid = '$opt_ppid'; @@ -151,8 +151,7 @@ fi /* print header */ OPT_time ? printf("%-14s ", "TIME") : 1; OPT_timestr ? printf("%-20s ", "TIMESTR") : 1; - OPT_proj ? printf("%5s ", "PROJ") : 1; - OPT_zone ? printf("%5s ", "ZONE") : 1; + OPT_jailid ? printf("%5s ", "JAILID") : 1; OPT_ppid ? printf("%6s ", "PPID") : 1; printf("%5s %6s %-12s %1s %7s %s\n", "UID", "PID", "CMD", "D", "BYTES", "FILE"); @@ -205,7 +204,10 @@ fi { /* * Fetch filename + * XXX Not yet implemented. */ +/* + this->filistp = curthread->t_procp->p_user.u_finfo.fi_list; this->ufentryp = (uf_entry_t *)((uint64_t)this->filistp + (uint64_t)self->fd * (uint64_t)sizeof(uf_entry_t)); @@ -213,17 +215,16 @@ fi this->vnodep = this->filep != 0 ? this->filep->f_vnode : 0; self->vpath = this->vnodep ? (this->vnodep->v_path != 0 ? cleanpath(this->vnodep->v_path) : "") : ""; - +*/ /* * Print details */ OPT_time ? printf("%-14d ", timestamp / 1000) : 1; OPT_timestr ? printf("%-20Y ", walltimestamp) : 1; - OPT_proj ? printf("%5d ", curpsinfo->pr_projid) : 1; - OPT_zone ? printf("%5d ", curpsinfo->pr_zoneid) : 1; + OPT_jailid ? printf("%5d ", curpsinfo->pr_jailid) : 1; OPT_ppid ? printf("%6d ", ppid) : 1; - printf("%5d %6d %-12.12s %1s %7d %s\n", - uid, pid, execname, self->rw, (int)self->size, self->vpath); + printf("%5d %6d %-12.12s %1s %7d \n", + uid, pid, execname, self->rw, (int)self->size); self->ok = 0; self->fd = 0; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:25:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7D6A7E6B; Sat, 26 Jul 2014 19:25:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69CFA297B; Sat, 26 Jul 2014 19:25:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QJPrah014658; Sat, 26 Jul 2014 19:25:53 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QJPrGF014657; Sat, 26 Jul 2014 19:25:53 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201407261925.s6QJPrGF014657@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sat, 26 Jul 2014 19:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269141 - head/cddl/contrib/dtracetoolkit 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.18 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, 26 Jul 2014 19:25:53 -0000 Author: gnn Date: Sat Jul 26 19:25:52 2014 New Revision: 269141 URL: http://svnweb.freebsd.org/changeset/base/269141 Log: Remove debugging options from the rwsnoop script. Modified: head/cddl/contrib/dtracetoolkit/rwsnoop Modified: head/cddl/contrib/dtracetoolkit/rwsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:21:53 2014 (r269140) +++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:25:52 2014 (r269141) @@ -77,8 +77,6 @@ # --- Process Arguments --- # -set -x -set -v ### default variables opt_name=0; opt_pid=0; opt_jailid=0; opt_time=0; opt_timestr=0 opt_bytes=1; filter=0; pname=.; pid=0; opt_ppid=0; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:27:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0F01A93; Sat, 26 Jul 2014 19:27:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEA192998; Sat, 26 Jul 2014 19:27:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QJRZcd015024; Sat, 26 Jul 2014 19:27:35 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QJRZsC015019; Sat, 26 Jul 2014 19:27:35 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407261927.s6QJRZsC015019@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 26 Jul 2014 19:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269142 - in head/sys: conf kern 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.18 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, 26 Jul 2014 19:27:36 -0000 Author: marcel Date: Sat Jul 26 19:27:34 2014 New Revision: 269142 URL: http://svnweb.freebsd.org/changeset/base/269142 Log: The accept filter code is not specific to the FreeBSD IPv4 network stack, so it really should not be under "optional inet". The fact that uipc_accf.c lives under kern/ lends some weight to making it a "standard" file. Moving kern/uipc_accf.c from "optional inet" to "standard" eliminates the need for #ifdef INET in kern/uipc_socket.c. Also, this meant the net.inet.accf.unloadable sysctl needed to move, as net.inet does not exist without networking compiled in (as it lives in netinet/in_proto.c.) The new sysctl has been named net.accf.unloadable. In order to support existing accept filter sysctls, the net.inet.accf node has been added netinet/in_proto.c. Submitted by: Steve Kiernan Obtained from: Juniper Networks, Inc. Modified: head/sys/conf/files head/sys/kern/uipc_accf.c head/sys/kern/uipc_socket.c head/sys/netinet/in_proto.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jul 26 19:25:52 2014 (r269141) +++ head/sys/conf/files Sat Jul 26 19:27:34 2014 (r269142) @@ -3017,7 +3017,7 @@ kern/tty_outq.c standard kern/tty_pts.c standard kern/tty_tty.c standard kern/tty_ttydisc.c standard -kern/uipc_accf.c optional inet +kern/uipc_accf.c standard kern/uipc_debug.c optional ddb kern/uipc_domain.c standard kern/uipc_mbuf.c standard Modified: head/sys/kern/uipc_accf.c ============================================================================== --- head/sys/kern/uipc_accf.c Sat Jul 26 19:25:52 2014 (r269141) +++ head/sys/kern/uipc_accf.c Sat Jul 26 19:27:34 2014 (r269142) @@ -60,9 +60,8 @@ MALLOC_DEFINE(M_ACCF, "accf", "accept fi static int unloadable = 0; -SYSCTL_DECL(_net_inet); /* XXX: some header should do this for me */ -SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW, 0, "Accept filters"); -SYSCTL_INT(_net_inet_accf, OID_AUTO, unloadable, CTLFLAG_RW, &unloadable, 0, +SYSCTL_NODE(_net, OID_AUTO, accf, CTLFLAG_RW, 0, "Accept filters"); +SYSCTL_INT(_net_accf, OID_AUTO, unloadable, CTLFLAG_RW, &unloadable, 0, "Allow unload of accept filters (not recommended)"); /* Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sat Jul 26 19:25:52 2014 (r269141) +++ head/sys/kern/uipc_socket.c Sat Jul 26 19:27:34 2014 (r269142) @@ -378,11 +378,9 @@ sodealloc(struct socket *so) if (so->so_snd.sb_hiwat) (void)chgsbsize(so->so_cred->cr_uidinfo, &so->so_snd.sb_hiwat, 0, RLIM_INFINITY); -#ifdef INET /* remove acccept filter if one is present. */ if (so->so_accf != NULL) do_setopt_accept_filter(so, NULL); -#endif #ifdef MAC mac_socket_destroy(so); #endif @@ -2402,13 +2400,12 @@ sosetopt(struct socket *so, struct socko error = ENOPROTOOPT; } else { switch (sopt->sopt_name) { -#ifdef INET case SO_ACCEPTFILTER: error = do_setopt_accept_filter(so, sopt); if (error) goto bad; break; -#endif + case SO_LINGER: error = sooptcopyin(sopt, &l, sizeof l, sizeof l); if (error) @@ -2635,11 +2632,10 @@ sogetopt(struct socket *so, struct socko return (error); } else { switch (sopt->sopt_name) { -#ifdef INET case SO_ACCEPTFILTER: error = do_getopt_accept_filter(so, sopt); break; -#endif + case SO_LINGER: SOCK_LOCK(so); l.l_onoff = so->so_options & SO_LINGER; Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Sat Jul 26 19:25:52 2014 (r269141) +++ head/sys/netinet/in_proto.c Sat Jul 26 19:27:34 2014 (r269142) @@ -394,3 +394,5 @@ SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, i SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW, 0, "IPIP"); #endif /* IPSEC */ SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); +SYSCTL_NODE(_net_inet, OID_AUTO, accf, CTLFLAG_RW, 0, + "Accept filters"); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 19:44:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5A7A663; Sat, 26 Jul 2014 19:44:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 784AE2B3D; Sat, 26 Jul 2014 19:44:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QJik5Q024005; Sat, 26 Jul 2014 19:44:46 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QJikAI024004; Sat, 26 Jul 2014 19:44:46 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201407261944.s6QJikAI024004@svn.freebsd.org> From: Andreas Tobler Date: Sat, 26 Jul 2014 19:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269143 - head/usr.bin/elfdump 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.18 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, 26 Jul 2014 19:44:46 -0000 Author: andreast Date: Sat Jul 26 19:44:45 2014 New Revision: 269143 URL: http://svnweb.freebsd.org/changeset/base/269143 Log: Further improvements on elfdump, to follow up r269092: - Add ARM specific section header types. - Add SHT_GNU_HASH section header type. - Improve reporting of undefined tags in d_tags. - Add DT_GNU_HASH tag. Reviewed by: emaste Modified: head/usr.bin/elfdump/elfdump.c Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Sat Jul 26 19:27:34 2014 (r269142) +++ head/usr.bin/elfdump/elfdump.c Sat Jul 26 19:44:45 2014 (r269143) @@ -167,7 +167,10 @@ static int elf64_offsets[] = { /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings */ static const char * -d_tags(u_int64_t tag) { +d_tags(u_int64_t tag) +{ + static char unknown_tag[48]; + switch (tag) { case 0: return "DT_NULL"; case 1: return "DT_NEEDED"; @@ -215,6 +218,7 @@ d_tags(u_int64_t tag) { case 0x6ffffdfe: return "DT_SYMINSZ"; case 0x6ffffdff: return "DT_SYMINENT (DT_VALRNGHI)"; case 0x6ffffe00: return "DT_ADDRRNGLO"; + case 0x6ffffef5: return "DT_GNU_HASH"; case 0x6ffffef8: return "DT_GNU_CONFLICT"; case 0x6ffffef9: return "DT_GNU_LIBLIST"; case 0x6ffffefa: return "DT_SUNW_CONFIG"; @@ -236,8 +240,10 @@ d_tags(u_int64_t tag) { case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; case 0x7ffffffe: return "DT_SUNW_USED"; case 0x7fffffff: return "DT_SUNW_FILTER"; - default: return "ERROR: TAG NOT DEFINED"; } + snprintf(unknown_tag, sizeof(unknown_tag), + "ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag); + return (unknown_tag); } static const char * @@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht) switch (sht) { case 0x6ffffff0: return "XXX:VERSYM"; case 0x6ffffff4: return "SHT_SUNW_dof"; + case 0x6ffffff6: return "SHT_GNU_HASH"; case 0x6ffffff7: return "SHT_GNU_LIBLIST"; case 0x6ffffffc: return "XXX:VERDEF"; case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef"; @@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht) } else if (sht < 0x80000000) { /* 0x70000000-0x7fffffff processor-specific semantics */ switch (machine) { + case EM_ARM: + switch (sht) { + case 0x70000001: return "SHT_ARM_EXIDX"; + case 0x70000002: return "SHT_ARM_PREEMPTMAP"; + case 0x70000003: return "SHT_ARM_ATTRIBUTES"; + case 0x70000004: return "SHT_ARM_DEBUGOVERLAY"; + case 0x70000005: return "SHT_ARM_OVERLAYSECTION"; + } + break; case EM_MIPS: switch (sht) { case 0x7000000d: return "SHT_MIPS_OPTIONS"; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 20:00:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E315D84; Sat, 26 Jul 2014 20:00:46 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 20E662D03; Sat, 26 Jul 2014 20:00:45 +0000 (UTC) Received: from c-50-155-136-3.hsd1.co.comcast.net ([50.155.136.3] helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XB895-000AaP-RD; Sat, 26 Jul 2014 20:00:44 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s6QK0gtt003975; Sat, 26 Jul 2014 14:00:42 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.155.136.3 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/yoUwbtYLMlB9BmNXlZCzw X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r269143 - head/usr.bin/elfdump From: Ian Lepore To: Andreas Tobler In-Reply-To: <201407261944.s6QJikAI024004@svn.freebsd.org> References: <201407261944.s6QJikAI024004@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 26 Jul 2014 14:00:42 -0600 Message-ID: <1406404842.56408.26.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 20:00:46 -0000 On Sat, 2014-07-26 at 19:44 +0000, Andreas Tobler wrote: > Author: andreast > Date: Sat Jul 26 19:44:45 2014 > New Revision: 269143 > URL: http://svnweb.freebsd.org/changeset/base/269143 > > Log: > Further improvements on elfdump, to follow up r269092: > > - Add ARM specific section header types. > - Add SHT_GNU_HASH section header type. > - Improve reporting of undefined tags in d_tags. > - Add DT_GNU_HASH tag. > > Reviewed by: emaste > > Modified: > head/usr.bin/elfdump/elfdump.c > > Modified: head/usr.bin/elfdump/elfdump.c > ============================================================================== > --- head/usr.bin/elfdump/elfdump.c Sat Jul 26 19:27:34 2014 (r269142) > +++ head/usr.bin/elfdump/elfdump.c Sat Jul 26 19:44:45 2014 (r269143) > @@ -167,7 +167,10 @@ static int elf64_offsets[] = { > > /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings */ > static const char * > -d_tags(u_int64_t tag) { > +d_tags(u_int64_t tag) > +{ > + static char unknown_tag[48]; > + > switch (tag) { > case 0: return "DT_NULL"; > case 1: return "DT_NEEDED"; > @@ -215,6 +218,7 @@ d_tags(u_int64_t tag) { > case 0x6ffffdfe: return "DT_SYMINSZ"; > case 0x6ffffdff: return "DT_SYMINENT (DT_VALRNGHI)"; > case 0x6ffffe00: return "DT_ADDRRNGLO"; > + case 0x6ffffef5: return "DT_GNU_HASH"; > case 0x6ffffef8: return "DT_GNU_CONFLICT"; > case 0x6ffffef9: return "DT_GNU_LIBLIST"; > case 0x6ffffefa: return "DT_SUNW_CONFIG"; > @@ -236,8 +240,10 @@ d_tags(u_int64_t tag) { > case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; > case 0x7ffffffe: return "DT_SUNW_USED"; > case 0x7fffffff: return "DT_SUNW_FILTER"; > - default: return "ERROR: TAG NOT DEFINED"; > } > + snprintf(unknown_tag, sizeof(unknown_tag), > + "ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag); > + return (unknown_tag); > } > > static const char * > @@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht) > switch (sht) { > case 0x6ffffff0: return "XXX:VERSYM"; > case 0x6ffffff4: return "SHT_SUNW_dof"; > + case 0x6ffffff6: return "SHT_GNU_HASH"; > case 0x6ffffff7: return "SHT_GNU_LIBLIST"; > case 0x6ffffffc: return "XXX:VERDEF"; > case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef"; > @@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht) > } else if (sht < 0x80000000) { > /* 0x70000000-0x7fffffff processor-specific semantics */ > switch (machine) { > + case EM_ARM: > + switch (sht) { > + case 0x70000001: return "SHT_ARM_EXIDX"; > + case 0x70000002: return "SHT_ARM_PREEMPTMAP"; > + case 0x70000003: return "SHT_ARM_ATTRIBUTES"; > + case 0x70000004: return "SHT_ARM_DEBUGOVERLAY"; > + case 0x70000005: return "SHT_ARM_OVERLAYSECTION"; > + } > + break; > case EM_MIPS: > switch (sht) { > case 0x7000000d: return "SHT_MIPS_OPTIONS"; > I'm curious why this code is all full of 0xnnnnnnnn numbers when there are named constants defined for all this stuff. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 20:11:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 342A2278; Sat, 26 Jul 2014 20:11:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20F932DE2; Sat, 26 Jul 2014 20:11:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QKBbLP036561; Sat, 26 Jul 2014 20:11:37 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QKBabL036560; Sat, 26 Jul 2014 20:11:36 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201407262011.s6QKBabL036560@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sat, 26 Jul 2014 20:11:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269144 - head/cddl/contrib/dtracetoolkit 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.18 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, 26 Jul 2014 20:11:37 -0000 Author: gnn Date: Sat Jul 26 20:11:36 2014 New Revision: 269144 URL: http://svnweb.freebsd.org/changeset/base/269144 Log: Since we cannot yet display the name print the file descriptor so that it can be looked up manually using procstat(1). Modified: head/cddl/contrib/dtracetoolkit/rwsnoop Modified: head/cddl/contrib/dtracetoolkit/rwsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 19:44:45 2014 (r269143) +++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 20:11:36 2014 (r269144) @@ -152,7 +152,7 @@ fi OPT_jailid ? printf("%5s ", "JAILID") : 1; OPT_ppid ? printf("%6s ", "PPID") : 1; printf("%5s %6s %-12s %1s %7s %s\n", - "UID", "PID", "CMD", "D", "BYTES", "FILE"); + "UID", "PID", "CMD", "FD", "D", "BYTES"); } /* @@ -221,8 +221,8 @@ fi OPT_timestr ? printf("%-20Y ", walltimestamp) : 1; OPT_jailid ? printf("%5d ", curpsinfo->pr_jailid) : 1; OPT_ppid ? printf("%6d ", ppid) : 1; - printf("%5d %6d %-12.12s %1s %7d \n", - uid, pid, execname, self->rw, (int)self->size); + printf("%5d %6d %-12.12s %4d %1s %7d\n", + uid, pid, execname, self->fd, self->rw, (int)self->size); self->ok = 0; self->fd = 0; From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 20:12:23 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFA944D1; Sat, 26 Jul 2014 20:12:23 +0000 (UTC) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) (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 393DA2DFF; Sat, 26 Jul 2014 20:12:22 +0000 (UTC) Received: from [192.168.225.11] (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id s6QKCD7M070483; Sat, 26 Jul 2014 22:12:18 +0200 (CEST) (envelope-from andreast@FreeBSD.org) Message-ID: <53D40B9D.7040606@FreeBSD.org> Date: Sat, 26 Jul 2014 22:12:13 +0200 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r269143 - head/usr.bin/elfdump References: <201407261944.s6QJikAI024004@svn.freebsd.org> <1406404842.56408.26.camel@revolution.hippie.lan> In-Reply-To: <1406404842.56408.26.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 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, 26 Jul 2014 20:12:23 -0000 On 26.07.14 22:00, Ian Lepore wrote: > On Sat, 2014-07-26 at 19:44 +0000, Andreas Tobler wrote: >> Author: andreast >> Date: Sat Jul 26 19:44:45 2014 >> New Revision: 269143 >> URL: http://svnweb.freebsd.org/changeset/base/269143 >> >> Log: >> Further improvements on elfdump, to follow up r269092: >> >> - Add ARM specific section header types. >> - Add SHT_GNU_HASH section header type. >> - Improve reporting of undefined tags in d_tags. >> - Add DT_GNU_HASH tag. >> >> Reviewed by: emaste >> >> Modified: >> head/usr.bin/elfdump/elfdump.c >> >> Modified: head/usr.bin/elfdump/elfdump.c >> ============================================================================== >> --- head/usr.bin/elfdump/elfdump.c Sat Jul 26 19:27:34 2014 (r269142) >> +++ head/usr.bin/elfdump/elfdump.c Sat Jul 26 19:44:45 2014 (r269143) >> @@ -167,7 +167,10 @@ static int elf64_offsets[] = { >> >> /* http://www.sco.com/developers/gabi/latest/ch5.dynamic.html#tag_encodings */ >> static const char * >> -d_tags(u_int64_t tag) { >> +d_tags(u_int64_t tag) >> +{ >> + static char unknown_tag[48]; >> + >> switch (tag) { >> case 0: return "DT_NULL"; >> case 1: return "DT_NEEDED"; >> @@ -215,6 +218,7 @@ d_tags(u_int64_t tag) { >> case 0x6ffffdfe: return "DT_SYMINSZ"; >> case 0x6ffffdff: return "DT_SYMINENT (DT_VALRNGHI)"; >> case 0x6ffffe00: return "DT_ADDRRNGLO"; >> + case 0x6ffffef5: return "DT_GNU_HASH"; >> case 0x6ffffef8: return "DT_GNU_CONFLICT"; >> case 0x6ffffef9: return "DT_GNU_LIBLIST"; >> case 0x6ffffefa: return "DT_SUNW_CONFIG"; >> @@ -236,8 +240,10 @@ d_tags(u_int64_t tag) { >> case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; >> case 0x7ffffffe: return "DT_SUNW_USED"; >> case 0x7fffffff: return "DT_SUNW_FILTER"; >> - default: return "ERROR: TAG NOT DEFINED"; >> } >> + snprintf(unknown_tag, sizeof(unknown_tag), >> + "ERROR: TAG NOT DEFINED -- tag 0x%jx", (uintmax_t)tag); >> + return (unknown_tag); >> } >> >> static const char * >> @@ -334,6 +340,7 @@ sh_types(uint64_t machine, uint64_t sht) >> switch (sht) { >> case 0x6ffffff0: return "XXX:VERSYM"; >> case 0x6ffffff4: return "SHT_SUNW_dof"; >> + case 0x6ffffff6: return "SHT_GNU_HASH"; >> case 0x6ffffff7: return "SHT_GNU_LIBLIST"; >> case 0x6ffffffc: return "XXX:VERDEF"; >> case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef"; >> @@ -347,6 +354,15 @@ sh_types(uint64_t machine, uint64_t sht) >> } else if (sht < 0x80000000) { >> /* 0x70000000-0x7fffffff processor-specific semantics */ >> switch (machine) { >> + case EM_ARM: >> + switch (sht) { >> + case 0x70000001: return "SHT_ARM_EXIDX"; >> + case 0x70000002: return "SHT_ARM_PREEMPTMAP"; >> + case 0x70000003: return "SHT_ARM_ATTRIBUTES"; >> + case 0x70000004: return "SHT_ARM_DEBUGOVERLAY"; >> + case 0x70000005: return "SHT_ARM_OVERLAYSECTION"; >> + } >> + break; >> case EM_MIPS: >> switch (sht) { >> case 0x7000000d: return "SHT_MIPS_OPTIONS"; >> > > I'm curious why this code is all full of 0xnnnnnnnn numbers when there > are named constants defined for all this stuff. No clue. I continued the used pattern. It would make more sense to use the defines from elf_common.h, less error prone. Andreas From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 20:42:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D383D8B5; Sat, 26 Jul 2014 20:42:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C462033; Sat, 26 Jul 2014 20:42:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QKgs6L051973; Sat, 26 Jul 2014 20:42:54 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QKgsUG051972; Sat, 26 Jul 2014 20:42:54 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201407262042.s6QKgsUG051972@svn.freebsd.org> From: "George V. Neville-Neil" Date: Sat, 26 Jul 2014 20:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269145 - head/cddl/contrib/dtracetoolkit 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.18 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, 26 Jul 2014 20:42:54 -0000 Author: gnn Date: Sat Jul 26 20:42:54 2014 New Revision: 269145 URL: http://svnweb.freebsd.org/changeset/base/269145 Log: Update the header printing to match the rest of the output. Pointed out by: mdf Modified: head/cddl/contrib/dtracetoolkit/rwsnoop Modified: head/cddl/contrib/dtracetoolkit/rwsnoop ============================================================================== --- head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 20:11:36 2014 (r269144) +++ head/cddl/contrib/dtracetoolkit/rwsnoop Sat Jul 26 20:42:54 2014 (r269145) @@ -151,7 +151,7 @@ fi OPT_timestr ? printf("%-20s ", "TIMESTR") : 1; OPT_jailid ? printf("%5s ", "JAILID") : 1; OPT_ppid ? printf("%6s ", "PPID") : 1; - printf("%5s %6s %-12s %1s %7s %s\n", + printf("%5s %6s %-12s %4s %1s %7s\n", "UID", "PID", "CMD", "FD", "D", "BYTES"); } From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 21:32:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F23F9C; Sat, 26 Jul 2014 21:32:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9D123C6; Sat, 26 Jul 2014 21:32:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QLW4cu074595; Sat, 26 Jul 2014 21:32:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QLW4g2074594; Sat, 26 Jul 2014 21:32:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407262132.s6QLW4g2074594@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 Jul 2014 21:32:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269146 - head/sys/contrib/dev/ath/ath_hal/ar9300 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.18 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, 26 Jul 2014 21:32:04 -0000 Author: adrian Date: Sat Jul 26 21:32:03 2014 New Revision: 269146 URL: http://svnweb.freebsd.org/changeset/base/269146 Log: store the AR9300 interrupts away when doing interrupt debugging. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Sat Jul 26 20:42:54 2014 (r269145) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_interrupts.c Sat Jul 26 21:32:03 2014 (r269146) @@ -142,6 +142,21 @@ ar9300_get_pending_interrupts( sync_en_def = AR9340_INTR_SYNC_DEFAULT; } + /* Store away the async and sync cause registers */ + /* XXX Do this before the filtering done below */ +#ifdef AH_INTERRUPT_DEBUGGING + ah->ah_intrstate[0] = OS_REG_READ(ah, AR_ISR); + ah->ah_intrstate[1] = OS_REG_READ(ah, AR_ISR_S0); + ah->ah_intrstate[2] = OS_REG_READ(ah, AR_ISR_S1); + ah->ah_intrstate[3] = OS_REG_READ(ah, AR_ISR_S2); + ah->ah_intrstate[4] = OS_REG_READ(ah, AR_ISR_S3); + ah->ah_intrstate[5] = OS_REG_READ(ah, AR_ISR_S4); + ah->ah_intrstate[6] = OS_REG_READ(ah, AR_ISR_S5); + + /* XXX double reading? */ + ah->ah_syncstate = OS_REG_READ(ah, AR_HOSTIF_REG(ah, AR_INTR_SYNC_CAUSE)); +#endif + sync_cause = OS_REG_READ(ah, AR_HOSTIF_REG(ah, AR_INTR_SYNC_CAUSE)) & (sync_en_def | AR_INTR_SYNC_MASK_GPIO); From owner-svn-src-head@FreeBSD.ORG Sat Jul 26 21:33:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95BC01E7; Sat, 26 Jul 2014 21:33:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 833D123CD; Sat, 26 Jul 2014 21:33:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6QLXHdA074830; Sat, 26 Jul 2014 21:33:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6QLXHr2074829; Sat, 26 Jul 2014 21:33:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407262133.s6QLXHr2074829@svn.freebsd.org> From: Adrian Chadd Date: Sat, 26 Jul 2014 21:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269147 - head/sys/dev/etherswitch/arswitch 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.18 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, 26 Jul 2014 21:33:17 -0000 Author: adrian Date: Sat Jul 26 21:33:17 2014 New Revision: 269147 URL: http://svnweb.freebsd.org/changeset/base/269147 Log: Add another revision of the AR8327. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Sat Jul 26 21:32:03 2014 (r269146) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Sat Jul 26 21:33:17 2014 (r269147) @@ -135,6 +135,7 @@ arswitch_probe(device_t dev) sc->sc_switchtype = AR8X16_SWITCH_AR8316; break; case 0x1202: + case 0x1204: chipname = "AR8327"; sc->sc_switchtype = AR8X16_SWITCH_AR8327; sc->mii_lo_first = 1;